# Group

The `group` call allows you to link an identified user with a group, such as a company, organization, or an account. It also lets you record any custom traits associated with that group, such as the name of the company, the number of employees, etc.

An identified user can be a part of more than one group.

## Sample payload

A sample payload for the `group` event after removing the [**Common Fields**](https://rudderstack.com/docs/rudderstack-api/api-specification/rudderstack-spec/common-fields/) is as shown:

```javascript
{
  "type": "group",
  "groupId": "12345",
  "traits": {
    "name": "MyGroup",
    "industry": "IT",
    "employees": 450,
    "plan": "basic"
  }
}
```

The corresponding event that generates the above payload via the JavaScript SDK is shown below:

```javascript
rudderanalytics.group("12345", {
  name: "MyGroup",
  industry: "IT",
  employees: 450,
  plan: "basic"
})
```

## Group fields

The `group` call has the following fields in addition to the [**Common Fields**](https://rudderstack.com/docs/rudderstack-api/api-specification/rudderstack-spec/common-fields/):

| **Field** | **Type** | **Presence** | **Description**                                                                                                                                                                                                                             |
| --------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `groupId` | String   | Required     | Your group's unique identifier which lets you identify the group in your database.                                                                                                                                                          |
| `traits`  | Object   | Optional     | Includes the traits of the group such as `name`, `email`, `employees`, etc. For more more information, check the [**Traits**](https://rudderstack.com/docs/rudderstack-api/api-specification/rudderstack-spec/group/#traits) section below. |

## Traits

Traits are bits of information included in an `group` call that add more context to the group. Some example of traits include the number of employees in the group, name of the industry the group is a part of, or the website of the group.

RudderStack has some reserved traits that it handles in special ways. These are listed in the table below:

| **Trait**     | **Type** | **Description**                                                                                                                                                                                                                                           |
| ------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`          | String   | The group's unique ID.                                                                                                                                                                                                                                    |
| `name`        | String   | The group name.                                                                                                                                                                                                                                           |
| `email`       | String   | The group's email address.                                                                                                                                                                                                                                |
| `phone`       | String   | Phone number associated with the group                                                                                                                                                                                                                    |
| `address`     | Object   | <p>The group's street address. This can optionally contain either/all of the following fields:</p><ul><li><code>city</code></li><li><code>country</code></li><li><code>postalCode</code></li><li><code>state</code></li><li><code>street</code></li></ul> |
| `industry`    | String   | The name of the industry that the group is a part of.                                                                                                                                                                                                     |
| `createdAt`   | Date     | Date of the group's account creation. We recommend using the **ISO-8601** date string format.                                                                                                                                                             |
| `description` | String   | The group's description.                                                                                                                                                                                                                                  |
| `employees`   | String   | Number of the employees in the group. This is typically used for companies.                                                                                                                                                                               |
| `plan`        | String   | The plan that the group is subscribed to.                                                                                                                                                                                                                 |
| `website`     | String   | The group's website.                                                                                                                                                                                                                                      |
| `avatar`      | String   | URL of the group's avatar image.                                                                                                                                                                                                                          |

## Contact us

For more information on any of the sections covered in this doc, you can [**contact us**](mailto:%20docs@rudderstack.com) or start a conversation in our [**Slack**](https://rudderstack.com/join-rudderstack-slack-community) community.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rudderlabs.gitbook.io/rudderlabs-1/docs/rudderstack-api/api-specification/rudderstack-spec/group.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
