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

FieldTypeDescription
titlestringRequired. The tag name (leading/trailing whitespace is trimmed; must not be empty)
colorstringOptional 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

FieldTypeDescription
idnumberThe unique identifier of the created tag
titlestringThe tag name
colorstringThe tag color as a hex string

Errors

StatusMeaning
400Missing title field, or the title is empty after trimming