# User mentioned

The user, user group, or app agent mentioned and returned from the comments API

## Endpoints that reference this object

- [Create comment](https://airtable.com/developers/web/api/create-comment.md)
- [List comments](https://airtable.com/developers/web/api/list-comments.md)
- [Update comment](https://airtable.com/developers/web/api/update-comment.md)

Model is one of the following variants:

### Variant 1

A **user** mention

Users can be mentioned by including the userId or email surrounded by `@[]`
in the text field of the request body
```
{
  "text": "...@[userId]....@[userEmail]..."
}
```

Responses from listing, creating, or updating comments
will indicate user mentions by including the userId surrounded by
the same `@[]` in the text field of the response body. The response will also
include a `mentioned` objectMap that maps mentioned user and user group ids
to detailed information

If you wish to have a list of all possible user ids, these can be found:
 - from the admin panel, by downloading the CSV available from the Users table
 - from Airtable's [Enterprise API](https://airtable.com/developers/web/api/get-base-collaborators.md)
 - by using [automations](https://support.airtable.com/docs/automations-overview) or the [scripting](https://airtable.com/developers/scripting) extension

```
{
  "mentioned": {
    "userId": {
      "type": "user",
      "id": "userId",
      "name": "User Name",
      "email": "User Email"
    }
  }
}
```

- `id: string` — required

  A user ID

- `type: "user"` — required

- `displayName: string` — required

- `email: string` — required

### Variant 2

A **user group** mention

User Groups can be mentioned by including the userGroupId surrounded by `@[]`
in the text field of the request body
```
{
  "text": "...@[userGroupId]..."
}
```

Responses from listing, creating, or updating comments
will indicate user group mentions by including the userGroupId surrounded by
the same `@[]` in the text field of the response body. It will also include
a `mentions` objectMap that maps mentioned user and group ids to detailed information.

If you wish to have a list of all possible user group ids, these can be found:
 - from the admin panel, by downloading the CSV available from the Groups table
 - from Airtable's [Enterprise API](https://airtable.com/developers/web/api/get-base-collaborators.md)
 - by using [automations](https://support.airtable.com/docs/automations-overview) or the [scripting](https://airtable.com/developers/scripting) extension

```
{
  "mentioned": {
    "userGroupId": {
      "type": "userGroup",
      "id": "userGroupId",
      "name": "Group Name"
    }
  }
}
```

- `id: string` — required

  A user group ID

- `type: "userGroup"` — required

- `displayName: string` — required

### Variant 3

An **app agent** mention

App agents can be mentioned by including the appAgentId surrounded by `@[]`
in the text field of the request body
```
{
  "text": "...@[appAgentId]..."
}
```

Mentioning an app agent triggers the agent to execute in the context of the
row comment's record.

```
{
  "mentioned": {
    "appAgentId": {
      "type": "appAgent",
      "id": "appAgentId",
      "displayName": "Agent Name"
    }
  }
}
```

- `id: string` — required

- `type: "appAgent"` — required

- `displayName: string` — required
