Skip to main content

PUT /api/tags/{tag_id} · PATCH /api/tags/{tag_id}

Updates an existing tag’s name, color, or description. Both PUT and PATCH methods are accepted — only the fields present in the request body are changed. This endpoint is restricted to administrators.

Authentication

Requires a valid Bearer access token. The authenticated user must have the admin role.
Authorization: Bearer <access_token>

Path Parameters

tag_id
integer
required
The ID of the tag to update.

Request Body

name
string
New name for the tag. Must be unique across all tags. Maximum 50 characters.
color
string
New hex color code for the tag. Must match the pattern ^#[0-9A-Fa-f]{6}$ (e.g. #FF5733).
description
string
Updated description for the tag. Pass an empty string or null to clear the description.

Response

success
boolean
true when the update succeeds.
message
string
Human-readable confirmation message.
data
object
The updated tag object.

Errors

StatusDescription
400No data provided, name is empty, or color does not match the required hex pattern.
401Missing or invalid access token.
403The authenticated user does not have the admin role.
404No tag exists with the given tag_id.

Example

curl -X PATCH "https://task-forge-gbd6h8gtg8hchve9.chilecentral-01.azurewebsites.net/api/tags/3" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "color": "#6366F1",
    "description": "Backend and infrastructure tasks"
  }'
{
  "success": true,
  "message": "Etiqueta actualizada con exito",
  "data": {
    "id": 3,
    "name": "Backend",
    "color": "#6366F1",
    "description": "Backend and infrastructure tasks",
    "task_count": 12,
    "created_at": "2024-01-10T09:00:00",
    "updated_at": "2024-03-17T14:05:00"
  }
}

Build docs developers (and LLMs) love