# Restore an older version (mints a new one)

Source: https://docs.usetone.ai/reference/agents/rollback

> Rolling back MINTS A NEW VERSION carrying the old content rather than moving a pointer backwards, so the history stays append-only and the rollback itself is visible in it.

`POST /v1/agents/{id}/rollback`
Rolling back MINTS A NEW VERSION carrying the old content rather than moving a pointer backwards, so the history stays append-only and the rollback itself is visible in it.

Requires the `write` scope.

## Parameters

| Name | In | | Meaning |
|---|---|---|---|
| `id` | path | required | The agent's id. |

## Request body

| Field | Type | | Meaning |
|---|---|---|---|
| `version` | integer | required | Which published version to restore. Rolling back MINTS A NEW VERSION carrying that content rather than moving a pointer, so the history stays append-only and the rollback itself is visible in it. |

### Example request

```json
{
  "version": 3
}
```

## Response

| Field | Type | | Meaning |
|---|---|---|---|
| `agentId` | string | required | Which agent this version belongs to. |
| `callSettings` | object | required | Opening line, nudges, voicemail, background, hangup. |
| `createdAt` | string | required | When it was published. RFC 3339, UTC. |
| `evaluationCriteria` | object | required | The post-call judge’s criteria. |
| `id` | string | required | The agent version's unique id. |
| `inputVariables` | object | required | Declared input variables. |
| `knowledgeBaseIds` | string[] | required | Bases attached when this version was published. Their CONTENT is not frozen. |
| `llmModel` | string | required | The model this version thought on. |
| `outputVariables` | object | required | Declared output variables — what extraction fills in. |
| `purpose` | string | required | The regulatory classification this version ran under. Open set — handle an unrecognised value rather than throwing. Today: `promotional`, `service`, `transactional`, `collections`. |
| `systemPrompt` | string | required | The prompt exactly as it was when this version was published. Immutable. |
| `tools` | object | required | Tool definitions. Credentials appear only as `secretId` references — a version never holds a decrypted secret. |
| `ttsOptions` | object | required | Model-specific tuning as it stood. |
| `version` | integer | required | Monotonic per agent, starting at 1. The number to quote in a rollback. |
| `voice` | object | required | The resolved Sarvam stack. A `(ttsModel, ttsVoice)` pair is validated at write time, so a version always holds a legal one. |
| `voice.languages` | string[] | required | Every language this version was allowed to speak, most-preferred first. |
| `voice.sttLanguage` | string | required | The language expected from the caller, or the auto-detect value. |
| `voice.sttMode` | string | required | How the transcriber treated the caller's language. |
| `voice.sttModel` | string | required | Which model transcribed the caller on calls pinned to this version. |
| `voice.ttsModel` | string | required | Which model spoke. |
| `voice.ttsVoice` | string | required | Which voice spoke. Always legal for `ttsModel` — the pair is validated before a version is published. |

### Example response

```json
{
  "data": {
    "agentId": "9f1c2d84-4e3a-4f6c-b902-7d1e8a33c451",
    "callSettings": {
      "background": {
        "sound": "none",
        "volume": 0.3
      },
      "hangupLine": {
        "text": "Thanks for your time. Goodbye."
      },
      "maxCallSeconds": 600,
      "nudges": {
        "enabled": true,
        "hangupAfter": true,
        "steps": [
          {
            "afterSeconds": 15,
            "line": {
              "text": null
            }
          }
        ]
      },
      "openingLine": {
        "text": "Hi {{customer_name}}, I’m calling from Acme about your order."
      },
      "voicemail": {
        "enabled": true,
        "windowSeconds": 30
      }
    },
    "createdAt": "2026-08-25T09:14:22Z",
    "evaluationCriteria": [
      {
        "id": "confirmed_order",
        "name": "Confirmed the order",
        "prompt": "Did the customer explicitly confirm they still want the order?"
      }
    ],
    "id": "9f1c2d84-4e3a-4f6c-b902-7d1e8a33c451",
    "inputVariables": [
      {
        "default": "there",
        "description": "The customer’s first name, as it appears on the order.",
        "name": "customer_name"
      }
    ],
    "knowledgeBaseIds": [
      "9f1c2d84-4e3a-4f6c-b902-7d1e8a33c451"
    ],
    "llmModel": "gemini-2.5-flash",
    "outputVariables": [
      {
        "description": "Which day the customer agreed to take delivery. Leave empty if they did not commit to one.",
        "enumValues": [
          "monday",
          "tuesday",
          "wednesday"
        ],
        "name": "delivery_day",
        "type": "enum"
      }
    ],
    "purpose": "promotional",
    "systemPrompt": "You call customers to confirm a cash-on-delivery order…",
    "tools": [
      {
        "connectionId": "b4e6d8a1-9c3f-4b2e-8d7a-1f0e9c8b7a6d",
        "description": "Call this once the customer has agreed to a specific delivery date and time window.",
        "http": {
          "auth": {
            "header": "x-api-key",
            "in": "header",
            "name": "api_key",
            "secondary": {
              "in": "header",
              "name": "x-acme-secret",
              "secretId": "7c2b8e5d-1a3f-4e6b-8c9d-0e1f2a3b4c5d"
            },
            "secretId": "3f1a7f6e-2b4c-4d1e-9a8b-5c6d7e8f9a0b",
            "type": "bearer"
          },
          "bodyFormat": "json",
          "bodyRoot": "object",
          "headers": {
            "x-acme-source": "tone"
          },
          "method": "POST",
          "timeoutMs": 5000,
          "url": "https://api.acme.example/v1/deliveries"
        },
        "mock": {
          "enabled": true,
          "response": "{\"status\":\"booked\",\"slot\":\"2026-09-02T10:00:00+05:30\"}"
        },
        "name": "book_delivery_slot",
        "parameters": [
          {
            "description": "The agreed date as YYYY-MM-DD.",
            "name": "delivery_date",
            "required": true,
            "type": "string"
          }
        ],
        "preset": "cal.com/book",
        "speech": {
          "en-IN": "Let me check that for you.",
          "hi-IN": "मैं अभी देखता हूँ।"
        }
      }
    ],
    "ttsOptions": {
      "pace": 1
    },
    "version": 0,
    "voice": {
      "languages": [
        "hi-IN",
        "en-IN"
      ],
      "sttLanguage": "auto",
      "sttMode": "transcribe",
      "sttModel": "saaras:v3",
      "ttsModel": "bulbul:v3",
      "ttsVoice": "simran"
    }
  }
}
```
