# Publish an agent version (/docs/api-reference/agents/publishAgentVersion)

> Put one saved version live. Callers hear it until the next publish. Your working draft is not touched.

**POST** `/agents/{agent_id}/versions/{version_number}/publish`

Put one saved version live. Callers hear it until the next publish. Your
working draft is not touched.

```yaml
operationId: publishAgentVersion
parameters:
  - name: agent_id
    in: path
    required: true
    schema:
      type: integer
    description: The ID of the agent.
  - name: version_number
    in: path
    required: true
    schema:
      type: integer
    description: The version number, as returned in `version_number` from the list or save endpoints.
requestBody:
  required: false
  content:
    application/json:
      schema:
        type: object
        properties:
          user_id:
            type: integer
            description: |
              Reseller keys only: act as one of your clients by its user id. Omit
              it to act on your own account.
              [How acting for a client works](/docs/reseller/your-clients/acting-as-clients).
            example: 1234
responses:
  '200':
    description: The agent's published state.
    content:
      application/json:
        schema:
          type: object
          properties:
            is_published:
              type: boolean
            published_version_id:
              oneOf:
                - type: integer
                - type: 'null'
            published_version_number:
              oneOf:
                - type: integer
                - type: 'null'
              description: The version callers hear. Null when every edit is live.
            has_unpublished_changes:
              type: boolean
            current_version_id:
              oneOf:
                - type: integer
                - type: 'null'
            current_version_number:
              oneOf:
                - type: integer
                - type: 'null'
              description: The saved version the current setup matches, if any.
  '403':
    description: The API key's user cannot change agents, or versioning is not on your plan.
  '404':
    description: Agent or version not found.
```

**curl**

```bash
curl -X POST "https://omnidim.io/api/v1/agents/{agent_id}/versions/{version_number}/publish" \
  -H "Authorization: Bearer $OMNIDIM_API_KEY"
```