> ## Documentation Index
> Fetch the complete documentation index at: https://help.statisfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a tag

> Creates a tag (201), as typing a new name into the app's tag picker does. `name` takes letters, digits, spaces, hyphens and underscores; leading and trailing spaces are dropped. `color_hex` is #RGB or #RRGGBB; left out, the tag gets one of the app's tag colors. A name another tag has is a 409 (names are unique, and case counts): list with `search` to find it. The workspace has one catalogue of tags, shared by tasks, accounts, projects, documents, prompts and conversations. To tag a task, send the tag's id in the task's `tags`.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/tags
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/tags:
    post:
      tags:
        - tags
      summary: Create a tag
      description: >-
        Creates a tag (201), as typing a new name into the app's tag picker
        does. `name` takes letters, digits, spaces, hyphens and underscores;
        leading and trailing spaces are dropped. `color_hex` is #RGB or #RRGGBB;
        left out, the tag gets one of the app's tag colors. A name another tag
        has is a 409 (names are unique, and case counts): list with `search` to
        find it. The workspace has one catalogue of tags, shared by tasks,
        accounts, projects, documents, prompts and conversations. To tag a task,
        send the tag's id in the task's `tags`.
      operationId: tags_create
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                color_hex:
                  anyOf:
                    - maxLength: 7
                      minLength: 4
                      type: string
                    - type: 'null'
                  default: null
                  description: >-
                    #RGB or #RRGGBB, such as #5474FF; one of the app's tag
                    colors when left out
                  title: Color Hex
                name:
                  description: >-
                    Letters, digits, spaces, hyphens and underscores; unique in
                    your workspace (case counts)
                  maxLength: 255
                  minLength: 1
                  title: Name
                  type: string
              required:
                - name
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
          description: Successful Response
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
          description: Created
      security:
        - HTTPBearer: []
components:
  schemas:
    Tag:
      properties:
        color_hex:
          anyOf:
            - type: string
            - type: 'null'
          description: 'Its color, as #RRGGBB or #RGB'
          title: Color Hex
        id:
          description: 'The tag''s id: a task''s `tags` and filter[tags] take it'
          title: Id
          type: integer
        name:
          title: Name
          type: string
      required:
        - id
        - name
      title: Tag
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.