Create a tag Experimental; added in 9.5.0

POST /api/tags

Spaces method and path for this operation:

post /s/{space_id}/api/tags

Refer to Spaces for more information.

Creates a new tag and returns it.

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

application/json

Body

  • color string

    The tag color as a hex value (e.g. #772299). If omitted, a random color is generated.

  • description string

    Optional description of the tag.

  • name string Required

    The display name of the tag.

Responses

  • 201 application/json

    created

    Hide response attributes Show response attributes object
    • data object Required

      Additional properties are NOT allowed.

      Hide data attributes Show data attributes object
      • color string Required

        The tag color as a hex value (e.g. #772299). If omitted, a random color is generated.

      • description string

        Optional description of the tag.

      • name string Required

        The display name of the tag.

    • id string Required

      The tag ID.

    • meta object Required

      Additional properties are NOT allowed.

      Hide meta attributes Show meta attributes object
      • created_at string

        Timestamp when the object was created (ISO 8601).

      • created_by string

        User profile ID of the user who created the object.

      • managed boolean

        When true, the object is managed by Kibana and cannot be edited by users.

      • owner string

        Identifier of the plugin or team that owns this object.

      • updated_at string

        Timestamp when the object was last updated (ISO 8601).

      • updated_by string

        User profile ID of the user who last updated the object.

      • version string

        Internal version identifier for optimistic concurrency control.

  • 400

    invalid request

  • 403

    forbidden

  • 409

    conflict

POST /api/tags
curl \
 --request POST 'https://localhost:5601/api/tags' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "kbn-xsrf: true" \
 --data '{"color":"#F04E98","description":"Content related to security investigations.","name":"Security"}'
Request example
{
  "color": "#F04E98",
  "description": "Content related to security investigations.",
  "name": "Security"
}
Response examples (201)
{
  "data": {
    "color": "#F04E98",
    "description": "Content related to security investigations.",
    "name": "Security"
  },
  "id": "tag-security",
  "meta": {
    "created_at": "2026-06-03T14:15:00.000Z",
    "managed": false,
    "updated_at": "2026-06-03T14:15:00.000Z",
    "version": "WzMsMV0="
  }
}