Skip to main content
POST
Groups

Groups

Groups allow you to organize users into entities like companies, accounts, or organizations. Group analytics let you analyze behavior at the group level.

Base URL

Authentication

Use your project token for authentication.

Set Group Property

Update or add properties to a group profile. Creates the group if it doesn’t exist.

Request Body

string
required
Your project token
string
required
The group key (e.g., “company”, “account_id”)
string
required
The unique identifier for this group
object
required
Object containing properties to set

Example


Set Group Property Once

Set properties only if they don’t already exist on the group.

Request Body

string
required
Your project token
string
required
The group key
string
required
The unique identifier for this group
object
required
Properties to set only if they don’t exist

Example


Delete Group Property

Remove specific properties from a group profile.

Request Body

string
required
Your project token
string
required
The group key
string
required
The unique identifier for this group
array
required
Array of property names to delete

Example


Union To List Property

Add values to a list property, ensuring uniqueness.

Request Body

string
required
Your project token
string
required
The group key
string
required
The unique identifier for this group
object
required
Object with arrays of values to add

Example


Remove from List Property

Remove specific values from a list property.

Request Body

string
required
Your project token
string
required
The group key
string
required
The unique identifier for this group
object
required
Object with values to remove

Example


Delete Group

Permanently delete a group profile.

Request Body

string
required
Your project token
string
required
The group key
string
required
The unique identifier for this group
string
required
Set to empty string (value is ignored)

Example


Batch Update Groups

Update multiple groups in a single request.

Example

Linking Users to Groups

To associate users with groups, send events with group properties:
The group key (e.g., “company”) must be defined in your project settings under Group Keys before you can use it.

Best Practices

Before sending group data, configure your group keys in Project Settings > Group Keys. Common examples:
  • company: For B2B SaaS products
  • organization: For enterprise customers
  • team: For team-based features
  • workspace: For workspace-based products
Use the same identifier format across all systems:
Track aggregate information about the group:
Keep group data in sync with your systems:

Common Use Cases

B2B SaaS Company Analytics

Multi-tenant Applications