# Create a tag

`POST /api/tag`

URL: https://repsona.com/api/post-tag

## Request body

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `name` | body | string | required | Name of the tag (1 to 255 characters). Must be unique in the space. |
| `type` | body | tag \| reaction \| null |  | What the tag is used for: `tag` is a label you attach to tasks and notes, `reaction` is used for reactions on comments. `null` leaves it unspecified. Defaults to `tag`. |
| `color` | body | string \| null |  | Color as a hex code such as `#3b82f6` (up to 20 characters). Defaults to `null` (no color). |

## Request

```sh
curl -X POST "https://<space>.repsona.com/api/tag" \
  -H "Authorization: Bearer $REPSONA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Design",
    "type": "tag",
    "color": "#3b82f6"
  }'
```

## Responses

- 200: Created tag id
- 400: Invalid request payload
- 401: Authentication is required

## Example response

```json
{
  "tagId": 75
}
```
