Skip to main content

POST /api/tags

Creates a new tag that can be applied to tasks. Any authenticated user can create tags, subject to a rate limit.
This endpoint is rate-limited to 20 requests per hour per user.

Authentication

Requires a valid Bearer access token.
Authorization: Bearer <access_token>

Request Body

name
string
required
The name for the new tag. Must be unique across all tags. Maximum 50 characters.
color
string
default:"#808080"
A hex color code to visually identify the tag. Must match the pattern ^#[0-9A-Fa-f]{6}$ (e.g. #FF5733). Defaults to #808080 if not provided.
description
string
An optional description of the tag’s purpose. Maximum 255 characters.

Response

Returns 201 Created on success.
success
boolean
true when the tag is created successfully.
message
string
Human-readable confirmation message.
data
object
The newly created tag object.

Errors

StatusDescription
400Missing required name field, or color does not match the required hex pattern.
401Missing or invalid access token.
409A tag with the given name already exists.
429Rate limit exceeded (20 requests per hour).

Example

curl -X POST "https://task-forge-gbd6h8gtg8hchve9.chilecentral-01.azurewebsites.net/api/tags" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Backend",
    "color": "#3B82F6",
    "description": "Backend development tasks"
  }'
{
  "success": true,
  "message": "Etiqueta creada con exito",
  "data": {
    "id": 3,
    "name": "Backend",
    "color": "#3B82F6",
    "description": "Backend development tasks",
    "task_count": 0,
    "created_at": "2024-03-17T14:00:00",
    "updated_at": "2024-03-17T14:00:00"
  }
}

Build docs developers (and LLMs) love