POST /tag
Create a new tag in your library. Useful for scripting workflows, e.g. batch-creating a standard tag set before importing a new library.
This endpoint is also available as
POST /api/tag— both paths are equivalent.
Request
{
"title": "Thunder",
"color": "#5E5CE6"
}
Request Fields
| Field | Type | Description |
|---|---|---|
title | string | Required. The tag name (leading/trailing whitespace is trimmed; must not be empty) |
color | string | Optional hex color, e.g. "#FF4500". If omitted, a color is assigned automatically |
Response
Returns 201 Created with the new tag.
{
"id": 42,
"title": "Thunder",
"color": "#5E5CE6"
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | number | The unique identifier of the created tag |
title | string | The tag name |
color | string | The tag color as a hex string |
Errors
| Status | Meaning |
|---|---|
400 | Missing title field, or the title is empty after trimming |