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

# Undo Agent Fix

> Restore the instructions an applied fix replaced

Restores the previous instructions of the agent.

> [!NOTE]
>
> Only for calls made by a 60db AI agent. The API key needs the `agents` permission on top of analyzer access, and the owner needs workspace role owner, admin, developer or member. Keys created with default scopes include `agents`. A key created with explicit `permissions` that leaves `agents` out gets `403 POLICY_DENY`. Limit: 10 requests per minute per owner for suggest and apply.

## Request

### Headers

**Authorization** `string` *required*

Bearer token with your API key: `Bearer sk_...`

**Content-Type** `string` *required*

application/json

### Path

**callId** `string` *required*

Call ID (UUID)

**fixId** `string` *required*

The `fix_id` from [Apply Agent Fix](https://docs.60db.ai/api-reference/call-analysis/apply-agent-fix.md)

No body.

## Response

**200**

```json theme={null}
{
  "success": true,
  "data": {
    "fix_id": "<fix-id>",
    "agent": {
      "id": "<ai-agent-uuid>",
      "name": "Front desk"
    },
    "restored_hash": "<64-hex-characters>"
  }
}
```

## Errors

Errors use `{ "success": false, "message": "...", "code": "..." }`. See the [overview](https://docs.60db.ai/api-reference/call-analysis/overview.md#errors) for the codes every route can return.

### This endpoint

| Status | Code | When |
| - | - | - |
| 404 | `FIX_NOT_FOUND` | No such fix on this call |
| 409 | `FIX_NOT_UNDOABLE` | The fix cannot be undone |
| 409 | `AGENT_CHANGED` | The agent changed after the fix |

## Example

```bash cURL theme={null}
curl -X POST 'https://api.60db.ai/deep-analytics/calls/7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d/agent-fix/<fix-id>/undo' \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{}'
```

```javascript JavaScript theme={null}
const res = await fetch('https://api.60db.ai/deep-analytics/calls/7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d/agent-fix/<fix-id>/undo', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer your-api-key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({}),
});
const { success, data, message, code } = await res.json();
if (!success) throw new Error(`${code}: ${message}`);
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.