# Create a tag

```http
POST https://trydimmi.com/api/v1/tags
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `conversations:write`.

## Body

- `color` (string): A hex color such as #3b82f6.
- `icon` (string): An icon name such as bug, question, lightbulb, rocket, refund-2 or star.
- `name` (string, required): Up to 100 characters; names are unique whatever their case.

## Response 201 (Created)

- `data` (object, required)
  - `color` (string | null, required): The tag's color as a hex value, such as #ff5500, kept as the workspace wrote it; null when it has none.
  - `icon` (string | null, required): Name of the tag's icon; null when it has none.
  - `id` (string, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
  - `name` (string, required): The tag's name.
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request POST \
  --url 'https://trydimmi.com/api/v1/tags' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "color": "<string>",
  "icon": "<string>",
  "name": "<string>"
}'
```

## Example response

```json
{
  "data": {
    "color": "<string>",
    "icon": "<string>",
    "id": "<string>",
    "name": "<string>",
    "object": "<string>"
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
