Node SDK
group
Associate a user with an organization or account.
Use group to associate a user with an organization, workspace, team, or account. This makes organization-level reporting possible, such as comparing usage by plan, industry, seat count, or lifecycle stage. groupId and either userId or anonymousId are required.
| Field | Required | Type | Description |
|---|---|---|---|
groupId | true | string | Identifies the organization, workspace, team, or account. |
userId or anonymousId | true | string | Identifies the user associated with the group. At least one is required. |
traits | false | object | Safe attributes describing the group, such as plan, seat count, industry, or lifecycle state. |
context | false | object | Additional context about the group event. |
timestamp | false | string | Date | The time the group association occurred. |
integrations | false | object | Per-call destination controls that enable or disable specific integrations. |
messageId | false | string | An application-provided identifier used to deduplicate the group event. |
callback | false | function | Runs after dispatch processing. |
Optional fields are context, timestamp, integrations, and messageId. The callback is the second argument.
Reserved traits#
Use reserved traits only for their intended meanings. Custom traits are also supported.
| Trait | Type | Description |
|---|---|---|
address | object | Group address; may contain city, country, postalCode, state, or street. |
avatar | string | URL to the group avatar. |
createdAt | date | Date the group account was created; use ISO-8601. |
description | string | Group description. |
email | string | Group email address. |
employees | string | Number of employees, typically for companies. |
id | string | Unique group ID in your database. |
industry | string | Industry the group belongs to. |
name | string | Group name. |
phone | string | Group phone number. |
website | string | Group website. |
plan | string | Group plan. |