Skip to main content
POST
/
tags
Create a tag definition
curl --request POST \
  --url https://api.altostrat.io/tags \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "Site Status",
  "color": "#4CAF50",
  "mandatory_on": [
    "site"
  ]
}'
{
  "id": "tag_01E8Z4Q6J7B6A5P4E3D2C1B0A9",
  "key": "Region",
  "color": "#3F51B5",
  "mandatory_on": [
    "site"
  ],
  "created_at": "2025-10-29T12:00:00Z",
  "updated_at": "2025-10-29T12:30:00Z"
}

Authorizations

Authorization
string
header
required

A bearer token is required for all API requests.

Body

application/json

The details of the tag definition to create.

key
string
required

The display name for the tag category.

Maximum length: 100
Example:

"Customer Segment"

color
string
required

A hex color code for UI display.

Example:

"#FF9800"

mandatory_on
enum<string>[]

A list of resource types for which this tag is mandatory.

Response

The tag definition was created successfully.

id
string

The unique identifier for the tag definition.

Example:

"tag_01E8Z4Q6J7B6A5P4E3D2C1B0A9"

key
string

The display name for the tag category (e.g., "Region", "Priority").

Example:

"Region"

color
string

A hex color code used for UI display.

Example:

"#3F51B5"

mandatory_on
enum<string>[]

A list of resource types where this tag must be applied.

created_at
string<date-time>

The timestamp when the tag definition was created.

Example:

"2025-10-29T12:00:00Z"

updated_at
string<date-time>

The timestamp when the tag definition was last updated.

Example:

"2025-10-29T12:30:00Z"