# Restore an agent version (/docs/api-reference/agents/restoreAgentVersion)

> Restore a version onto the live agent. Your current setup is saved first as a backup version, so restoring is undoable. Configuration is brought back; any knowledge files or integrations that were deleted since this version was saved can't be re-linked, and are reported in `skipped`.

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

Restore a version onto the live agent. Your current setup is saved first as a backup version, so restoring is undoable. Configuration is brought back; any knowledge files or integrations that were deleted since this version was saved can't be re-linked, and are reported in `skipped`.

```yaml
operationId: restoreAgentVersion
responses:
  '200':
    description: Version restored.
    content:
      application/json:
        schema:
          type: object
          properties:
            success:
              type: boolean
            restored_from:
              type: integer
              description: The version number that was restored.
            safety_version:
              type: integer
              nullable: true
              description: >-
                Version number of the backup taken of the agent's setup right before this restore,
                or null if no backup was needed.
            skipped:
              type: array
              description: >-
                References the restore could not bring back (e.g. a knowledge file or integration
                deleted since this version was saved).
              items:
                type: object
                properties:
                  item:
                    type: string
                  label:
                    type: string
                  reason:
                    type: string
        example:
          success: true
          restored_from: 5
          safety_version: 7
          skipped:
            - item: knowledge_file
              label: old-pricing-sheet.pdf
              reason: deleted
  '403':
    description: Version history is not enabled for this organization.
    content:
      application/json:
        schema:
          type: object
          properties:
            error:
              type: string
            error_description:
              type: string
        example:
          error: feature_disabled
          error_description: Version history is not enabled for this organization
  '404':
    description: No agent or version matching that ID.
    content:
      application/json:
        schema:
          type: object
          properties:
            error:
              type: string
            error_description:
              type: string
        example:
          error: not_found
          error_description: Version not found for this agent
```

**Python SDK**

```python
from omnidimension import Client
client = Client(api_key)

# Restore an agent to a previous version
agent_id = "your_agent_id_here"
version_number = 5
response = client.agent.restore_version(agent_id, version_number)
print(response)
```

**curl**

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