> For the complete documentation index, see [llms.txt](https://docs.athenachat.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.athenachat.ai/api-reference/en/endpoints/tags.md).

# Tags

Create tags, add them to chats and remove them

Tags help you organize chats — for example, mark VIP customers or chats that need a call back. Tags you set through the API are the same tags your team sees in the **Inbox**. To get the chats with a tag, use the `tag` filter of [List chats](/api-reference/en/endpoints/chats.md#list-chats).

## List tags

`GET /chats/chat/tags`

Returns the tags of your account, the most used first.

| Parameter | Type    | Required | Description                             |
| --------- | ------- | -------- | --------------------------------------- |
| `limit`   | integer | No       | Number of tags to return. Default: `50` |
| `offset`  | integer | No       | Number of tags to skip. Default: `0`    |

```bash
curl "https://hub.athenachat.ai/api/v1/chats/chat/tags" \
  -H "Authorization: YOUR_API_KEY"
```

`200 OK`

```json
{
  "tags": [
    {
      "id": "17344594-73c5-407b-a8b9-6d09053700aa",
      "name": "VIP",
      "chatsWithTags": ["a646fb76-3675-4451-9b92-d85863e4e2a1"]
    }
  ]
}
```

`chatsWithTags` lists the IDs of the chats that have the tag.

## Create a tag

`GET /chats/chat/tags/create`

Creates a tag without adding it to a chat.

| Parameter | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| `tag`     | string | Yes      | Tag name    |

```bash
curl "https://hub.athenachat.ai/api/v1/chats/chat/tags/create?tag=VIP" \
  -H "Authorization: YOUR_API_KEY"
```

`200 OK`

```json
{ "tag": "VIP", "success": true }
```

If the tag already exists, you get `400` with the message `Tag already exist`.

## Add a tag to a chat

`GET /chats/chat/tags/tag-chat`

Adds a tag to a chat. If the tag doesn't exist yet, Athena creates it.

| Parameter | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| `id`      | string | Yes      | Chat ID     |
| `tag`     | string | Yes      | Tag name    |

```bash
curl "https://hub.athenachat.ai/api/v1/chats/chat/tags/tag-chat?id=a646fb76-3675-4451-9b92-d85863e4e2a1&tag=VIP" \
  -H "Authorization: YOUR_API_KEY"
```

`200 OK` — `id` is the ID of the tag:

```json
{ "id": "17344594-73c5-407b-a8b9-6d09053700aa", "success": true }
```

If the chat already has the tag, you get `400` with the message `Tag already exist`.

## Remove a tag from a chat

`DELETE /chats/chat/tags/remove-from-chat`

Removes a tag from a chat. The tag itself stays in your account.

| Parameter | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| `id`      | string | Yes      | Chat ID     |
| `tag`     | string | Yes      | Tag name    |

```bash
curl -X DELETE "https://hub.athenachat.ai/api/v1/chats/chat/tags/remove-from-chat?id=a646fb76-3675-4451-9b92-d85863e4e2a1&tag=VIP" \
  -H "Authorization: YOUR_API_KEY"
```

`200 OK` — `id` is the ID of the tag:

```json
{ "id": "17344594-73c5-407b-a8b9-6d09053700aa", "success": true }
```

## Delete a tag

`DELETE /chats/chat/tags/remove`

Deletes the tag from your account and from all chats.

| Parameter | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| `tag`     | string | Yes      | Tag name    |

```bash
curl -X DELETE "https://hub.athenachat.ai/api/v1/chats/chat/tags/remove?tag=VIP" \
  -H "Authorization: YOUR_API_KEY"
```

`200 OK`

```json
{ "tag": "VIP", "success": true }
```

***

## Errors

If the chat or the tag isn't found, these endpoints return `400` with the message `Chat not found` or `Tag not found`. See [Errors and limits](/api-reference/en/errors-and-limits.md) for the other errors.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.athenachat.ai/api-reference/en/endpoints/tags.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
