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.

FieldRequiredTypeDescription
groupIdtruestringIdentifies the organization, workspace, team, or account.
userId or anonymousIdtruestringIdentifies the user associated with the group. At least one is required.
traitsfalseobjectSafe attributes describing the group, such as plan, seat count, industry, or lifecycle state.
contextfalseobjectAdditional context about the group event.
timestampfalsestring | DateThe time the group association occurred.
integrationsfalseobjectPer-call destination controls that enable or disable specific integrations.
messageIdfalsestringAn application-provided identifier used to deduplicate the group event.
callbackfalsefunctionRuns 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.

TraitTypeDescription
addressobjectGroup address; may contain city, country, postalCode, state, or street.
avatarstringURL to the group avatar.
createdAtdateDate the group account was created; use ISO-8601.
descriptionstringGroup description.
emailstringGroup email address.
employeesstringNumber of employees, typically for companies.
idstringUnique group ID in your database.
industrystringIndustry the group belongs to.
namestringGroup name.
phonestringGroup phone number.
websitestringGroup website.
planstringGroup plan.