> For the complete documentation index, see [llms.txt](https://docs.n8n.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.n8n.io/connect/n8n-api/build-and-run/tags.md). Agents can also search and read this documentation through its [MCP server](https://docs.n8n.io/~gitbook/mcp).

# Tags

Operations about tags

## Retrieve all tags

> Retrieve all tags from your instance.\
> \
> Requires the \`tag:list\` API key scope.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Tags","description":"Operations about tags"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"CookieAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"CookieAuth":{"type":"apiKey","in":"cookie","name":"n8n-auth"}},"parameters":{"limit":{"name":"limit","in":"query","description":"The maximum number of items to return.","required":false,"schema":{"type":"number","default":100,"maximum":250}},"cursor":{"name":"cursor","in":"query","description":"Paginate by setting the cursor parameter to the nextCursor attribute returned by the previous request's response. Default value fetches the first \"page\" of the collection. See pagination for more detail.","required":false,"style":"form","schema":{"type":"string"}}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"forbidden":{"description":"Forbidden"},"tooManyRequests":{"description":"Too many requests.","headers":{"Retry-After":{"description":"The number of seconds to wait before you retry the request.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"The maximum number of requests allowed in the rate-limit window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the rate-limit window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"The time when the rate-limit window resets, as a Unix timestamp in seconds.","schema":{"type":"integer","format":"int64","minimum":0}}},"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"paths":{"/tags":{"get":{"operationId":"getTags","tags":["Tags"],"summary":"Retrieve all tags","description":"Retrieve all tags from your instance.\n\nRequires the `tag:list` API key scope.","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"}],"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}},"required":["id","name","createdAt","updatedAt"]}},"nextCursor":{"type":"string","nullable":true}},"required":["data","nextCursor"]}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"403":{"$ref":"#/components/responses/forbidden"},"429":{"$ref":"#/components/responses/tooManyRequests"}}}}}}
```

## Create a tag

> Create a tag in your instance.\
> \
> Requires the \`tag:create\` API key scope.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Tags","description":"Operations about tags"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"CookieAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"CookieAuth":{"type":"apiKey","in":"cookie","name":"n8n-auth"}},"parameters":{"idempotencyKey":{"name":"Idempotency-Key","in":"header","description":"Safe retry key for this POST. Use 1 to 128 visible ASCII characters. The same key and the same request return the first successful response. A different request with this key returns 422. A retry while the first request is in progress returns 409.","required":false,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[\\x21-\\x7E]+$"}}},"schemas":{"tagPublicDto.generated":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}},"required":["id","name","createdAt","updatedAt"]}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"forbidden":{"description":"Forbidden"},"conflict":{"description":"Conflict"},"unsupportedMediaType":{"description":"Unsupported media type."},"unprocessableEntity":{"description":"Unprocessable Entity"},"tooManyRequests":{"description":"Too many requests.","headers":{"Retry-After":{"description":"The number of seconds to wait before you retry the request.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"The maximum number of requests allowed in the rate-limit window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the rate-limit window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"The time when the rate-limit window resets, as a Unix timestamp in seconds.","schema":{"type":"integer","format":"int64","minimum":0}}},"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"paths":{"/tags":{"post":{"operationId":"createTag","tags":["Tags"],"summary":"Create a tag","description":"Create a tag in your instance.\n\nRequires the `tag:create` API key scope.","parameters":[{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tagPublicDto.generated"}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"403":{"$ref":"#/components/responses/forbidden"},"409":{"$ref":"#/components/responses/conflict"},"415":{"$ref":"#/components/responses/unsupportedMediaType"},"422":{"$ref":"#/components/responses/unprocessableEntity"},"429":{"$ref":"#/components/responses/tooManyRequests"}}}}}}
```

## Retrieves a tag

> Retrieves a tag.\
> \
> Requires the \`tag:read\` API key scope.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Tags","description":"Operations about tags"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"CookieAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"CookieAuth":{"type":"apiKey","in":"cookie","name":"n8n-auth"}},"schemas":{"tagPublicDto.generated":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}},"required":["id","name","createdAt","updatedAt"]}},"responses":{"unauthorized":{"description":"Unauthorized"},"forbidden":{"description":"Forbidden"},"notFound":{"description":"The specified resource was not found."},"tooManyRequests":{"description":"Too many requests.","headers":{"Retry-After":{"description":"The number of seconds to wait before you retry the request.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"The maximum number of requests allowed in the rate-limit window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the rate-limit window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"The time when the rate-limit window resets, as a Unix timestamp in seconds.","schema":{"type":"integer","format":"int64","minimum":0}}},"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"paths":{"/tags/{tagId}":{"get":{"operationId":"getTag","tags":["Tags"],"summary":"Retrieves a tag","description":"Retrieves a tag.\n\nRequires the `tag:read` API key scope.","parameters":[{"schema":{"type":"string"},"required":true,"description":"The ID of the tag.","name":"tagId","in":"path"}],"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tagPublicDto.generated"}}}},"401":{"$ref":"#/components/responses/unauthorized"},"403":{"$ref":"#/components/responses/forbidden"},"404":{"$ref":"#/components/responses/notFound"},"429":{"$ref":"#/components/responses/tooManyRequests"}}}}}}
```

## Update a tag

> Update a tag.\
> \
> Requires the \`tag:update\` API key scope.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Tags","description":"Operations about tags"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"CookieAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"CookieAuth":{"type":"apiKey","in":"cookie","name":"n8n-auth"}},"responses":{"badRequest":{"description":"The request is invalid or provides malformed data."},"unauthorized":{"description":"Unauthorized"},"forbidden":{"description":"Forbidden"},"notFound":{"description":"The specified resource was not found."},"conflict":{"description":"Conflict"},"unsupportedMediaType":{"description":"Unsupported media type."},"tooManyRequests":{"description":"Too many requests.","headers":{"Retry-After":{"description":"The number of seconds to wait before you retry the request.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"The maximum number of requests allowed in the rate-limit window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the rate-limit window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"The time when the rate-limit window resets, as a Unix timestamp in seconds.","schema":{"type":"integer","format":"int64","minimum":0}}},"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"paths":{"/tags/{tagId}":{"put":{"operationId":"updateTag","tags":["Tags"],"summary":"Update a tag","description":"Update a tag.\n\nRequires the `tag:update` API key scope.","parameters":[{"schema":{"type":"string"},"required":true,"description":"The ID of the tag.","name":"tagId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}},"required":["id","name"]}}}},"400":{"$ref":"#/components/responses/badRequest"},"401":{"$ref":"#/components/responses/unauthorized"},"403":{"$ref":"#/components/responses/forbidden"},"404":{"$ref":"#/components/responses/notFound"},"409":{"$ref":"#/components/responses/conflict"},"415":{"$ref":"#/components/responses/unsupportedMediaType"},"429":{"$ref":"#/components/responses/tooManyRequests"}}}}}}
```

## Delete a tag

> Deletes a tag.\
> \
> Requires the \`tag:delete\` API key scope.

```json
{"openapi":"3.0.0","info":{"title":"n8n Public API","version":"1.1.1"},"tags":[{"name":"Tags","description":"Operations about tags"}],"servers":[{"url":"/api/v1","description":"Current n8n instance (self-hosted built-in playground)"},{"url":"{url}/api/v1","description":"Self-hosted n8n instance","variables":{"url":{"default":"https://example.com"}}}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]},{"CookieAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-N8N-API-KEY"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"CookieAuth":{"type":"apiKey","in":"cookie","name":"n8n-auth"}},"schemas":{"tagPublicDto.generated":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}},"required":["id","name","createdAt","updatedAt"]}},"responses":{"unauthorized":{"description":"Unauthorized"},"forbidden":{"description":"Forbidden"},"notFound":{"description":"The specified resource was not found."},"tooManyRequests":{"description":"Too many requests.","headers":{"Retry-After":{"description":"The number of seconds to wait before you retry the request.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Limit":{"description":"The maximum number of requests allowed in the rate-limit window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Remaining":{"description":"The number of requests remaining in the rate-limit window.","schema":{"type":"integer","minimum":0}},"X-RateLimit-Reset":{"description":"The time when the rate-limit window resets, as a Unix timestamp in seconds.","schema":{"type":"integer","format":"int64","minimum":0}}},"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"paths":{"/tags/{tagId}":{"delete":{"operationId":"deleteTag","tags":["Tags"],"summary":"Delete a tag","description":"Deletes a tag.\n\nRequires the `tag:delete` API key scope.","parameters":[{"schema":{"type":"string"},"required":true,"description":"The ID of the tag.","name":"tagId","in":"path"}],"responses":{"200":{"description":"Operation successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/tagPublicDto.generated"}}}},"401":{"$ref":"#/components/responses/unauthorized"},"403":{"$ref":"#/components/responses/forbidden"},"404":{"$ref":"#/components/responses/notFound"},"429":{"$ref":"#/components/responses/tooManyRequests"}}}}}}
```
