# Unpublish an agent (/docs/api-reference/agents/unpublishAgent)

> Stop serving a published version. Every edit is live again at once.

**POST** `/agents/{agent_id}/unpublish`

Stop serving a published version. Every edit is live again at once.

```yaml
operationId: unpublishAgent
parameters:
  - name: agent_id
    in: path
    required: true
    schema:
      type: integer
    description: The ID of the agent.
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 not found or not yours.
```

**curl**

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