Create Tag

POST /api/v1/tags

Creates a new tag in your organization.

Request Body

FieldTypeRequiredDescription
namestringYesTag name (must be unique within the organization)
descriptionstringNoOptional description
colorstringNoHex color code (e.g., #0075ca). Defaults to #6b7280

Example Request

curl -X POST "https://orchestrator.assemblyline.sh/api/v1/tags" \
  -H "api-key: al_xxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "monthly",
    "color": "#0075ca",
    "description": "Monthly recurring stations"
  }'

Response

Status: 201 Created

{
  "data": {
    "id": "tag_abc123",
    "name": "monthly",
    "description": "Monthly recurring stations",
    "color": "#0075ca",
    "created_at": "2024-01-10T08:00:00Z"
  }
}

Errors

CodeDescription
400Validation error (missing name, invalid color, duplicate name)
401Invalid or missing API credentials
403API key lacks tags:create permission

Duplicate Name

{
  "error": {
    "code": "DUPLICATE_ERROR",
    "message": "Tag \"monthly\" already exists"
  }
}

Invalid Color

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "color must be a valid hex color (e.g., #0075ca)"
  }
}