# Assign tags (/docs/api-reference/tags/assign-tags)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 976 · updated: 2026-07-30 -->
Related: [Delete tags](/docs/api-reference/tags/delete-tags.md), [List template tags](/docs/api-reference/tags/list-template-tags.md), [Get template by alias](/docs/api-reference/templates/get-template-by-alias.md)

# Assign tags

`POST /templates/tags`

Assign tag(s) to a template build

## OpenAPI

```json
{
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "required": [
            "target",
            "tags"
          ],
          "properties": {
            "target": {
              "type": "string",
              "description": "Target template in \"name:tag\" format"
            },
            "tags": {
              "description": "Tags to assign to the template",
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "type": "object"
        }
      }
    }
  },
  "responses": {
    "201": {
      "description": "Tag assigned successfully",
      "content": {
        "application/json": {
          "schema": {
            "required": [
              "tags",
              "buildID"
            ],
            "properties": {
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Assigned tags of the template"
              },
              "buildID": {
                "type": "string",
                "format": "uuid",
                "description": "Identifier of the build associated with these tags"
              }
            },
            "type": "object"
          }
        }
      }
    },
    "400": {
      "description": "Bad request",
      "content": {
        "application/json": {
          "schema": {
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "integer",
                "format": "int32",
                "description": "Error code"
              },
              "message": {
                "type": "string",
                "description": "Error"
              }
            },
            "type": "object"
          }
        }
      }
    },
    "401": {
      "description": "Authentication error",
      "content": {
        "application/json": {
          "schema": {
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "integer",
                "format": "int32",
                "description": "Error code"
              },
              "message": {
                "type": "string",
                "description": "Error"
              }
            },
            "type": "object"
          }
        }
      }
    },
    "404": {
      "description": "Not found",
      "content": {
        "application/json": {
          "schema": {
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "integer",
                "format": "int32",
                "description": "Error code"
              },
              "message": {
                "type": "string",
                "description": "Error"
              }
            },
            "type": "object"
          }
        }
      }
    },
    "500": {
      "description": "Server error",
      "content": {
        "application/json": {
          "schema": {
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "integer",
                "format": "int32",
                "description": "Error code"
              },
              "message": {
                "type": "string",
                "description": "Error"
              }
            },
            "type": "object"
          }
        }
      }
    }
  }
}
```
