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

# Publish agent version

> Publish this agent version and set it as the active version. Returns 409 if the version was already published.



## OpenAPI

````yaml post /v1/agents/{id}/versions/{versionId}/publish
openapi: 3.0.3
info:
  title: Vatel AI REST API
  description: >-
    Programmatic access for agents, telephony, and session tokens. Send
    `Authorization: Bearer <organization API key>` on all requests unless noted.
    Most error responses return JSON with an `error` string message.
  version: 0.2.4
servers:
  - url: https://api.vatel.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: organization
    description: Organization tied to your API key
  - name: llms
    description: LLM model identifiers
  - name: voices
    description: TTS voice catalog
  - name: agents
    description: Agents, outbound dial, agent versions
  - name: twilio
    description: Imported Twilio phone numbers
  - name: sip-trunks
    description: SIP trunk configuration
  - name: session
    description: Session tokens and voice WebSocket connections.
  - name: calls
    description: Call history, recordings, and live eavesdrop for your organization
  - name: eavesdrop
    description: Listen to live calls and send supervisor commands over WebSocket.
paths:
  /v1/agents/{id}/versions/{versionId}/publish:
    post:
      tags:
        - agents
      summary: Publish agent version
      description: >-
        Publish this agent version and set it as the active version. Returns 409
        if the version was already published.
      operationId: publishAgentGraphVersion
      parameters:
        - name: id
          in: path
          required: true
          description: Agent id
          schema:
            type: string
            format: uuid
        - name: versionId
          in: path
          required: true
          description: Agent version id
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Published version
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GraphVersion'
        '400':
          description: Invalid ids
        '401':
          description: Unauthorized
        '404':
          description: Agent or agent version not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Version already published
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    GraphVersion:
      type: object
      description: An agent version (tagged snapshot of the conversation flow).
      properties:
        id:
          type: string
          format: uuid
          description: Agent version id; use with `GET .../versions/{versionId}`.
        agent_id:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        published_at:
          type: string
          format: date-time
          nullable: true
          description: When published, if applicable.
        tag:
          type: string
          description: Optional label (e.g. draft or release name).
    ErrorResponse:
      type: object
      description: Standard error body for most non-2xx JSON responses on this API.
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable message; may include validation detail.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Send your organization API key as `Authorization: Bearer <key>`.'

````