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

# Attach/Set Version Tag

> Attaches a unique string tag (e.g. 'prod') to the specified prompt version, replacing the tag on any other version of this prompt if it was already assigned.



## OpenAPI

````yaml /openapi.yaml post /v1/prompts/{id}/versions/{version}/tags
openapi: 3.1.0
info:
  title: px0 API
  description: >
    px[0] is an open-source prompt infrastructure toolkit for managing prompts
    in production. It replaces hardcoded prompt strings with versioned
    templates, in-process caching, and OpenTelemetry observability, so teams can
    iterate on prompts without touching application code. This is the OpenAPI
    specification for all the public APIs of px0.
  version: 1.0.0
servers:
  - url: http://localhost:3000
    description: Local development server
security: []
paths:
  /v1/prompts/{id}/versions/{version}/tags:
    post:
      tags:
        - Prompt Versions
      summary: Attach/Set Version Tag
      description: >-
        Attaches a unique string tag (e.g. 'prod') to the specified prompt
        version, replacing the tag on any other version of this prompt if it was
        already assigned.
      operationId: setVersionTag
      parameters:
        - name: id
          in: path
          required: true
          description: Unique prompt UUID.
          schema:
            type: string
            format: uuid
        - name: version
          in: path
          required: true
          description: Version sequence number (integer) or version tag (string) to tag.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                tag:
                  type: string
                  description: Tag string (alphanumeric, dots, dashes, underscores).
                  example: prod
                  maxLength: 50
              required:
                - tag
      responses:
        '200':
          description: Tag attached successfully. Returns the updated version.
          content:
            application/json:
              schema:
                type: object
                properties:
                  version:
                    $ref: '#/components/schemas/PromptVersion'
                required:
                  - version
        '400':
          description: Invalid request or tag format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
        '404':
          description: Prompt or version not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
      security:
        - BearerAuth: []
components:
  schemas:
    PromptVersion:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique version identifier.
        prompt_id:
          type: string
          format: uuid
          description: Reference to parent Prompt ID.
        version:
          type: integer
          description: Incrementing sequence number of the version.
        template:
          type: string
          description: The template syntax code with Go template parameters.
          example: Hello {{.name}}!
        status:
          type: string
          enum:
            - draft
            - stable
            - live
            - archived
          description: Active lifecycle status of this template version.
        created_at:
          type: string
          format: date-time
        published_at:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when status was set to live. Null if draft.
        tags:
          type: array
          items:
            type: string
          description: List of tag strings attached to this version.
      required:
        - id
        - prompt_id
        - version
        - template
        - status
        - created_at
        - published_at
        - tags
    APIError:
      type: object
      properties:
        error:
          type: string
          example: invalid credentials
      required:
        - error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Use an access token retrieved from login (Bearer sess_...) or a
        programmatic API key (Bearer ak_...).

````