curl -X POST 'https://api.60db.ai/deep-analytics/calls/7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d/agent-fix/apply' \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"base_hash": "<64-hex-characters>", "script": "<instructions to save>"}'
const res = await fetch('https://api.60db.ai/deep-analytics/calls/7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d/agent-fix/apply', {
method: 'POST',
headers: {
Authorization: 'Bearer your-api-key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"base_hash": "<64-hex-characters>",
"script": "<instructions to save>"
}),
});
const { success, data, message, code } = await res.json();
if (!success) throw new Error(`${code}: ${message}`);
Call Analysis
Apply Agent Fix
Save suggested instructions to the AI agent
POST
/
deep-analytics
/
calls
/
:callId
/
agent-fix
/
apply
curl -X POST 'https://api.60db.ai/deep-analytics/calls/7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d/agent-fix/apply' \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"base_hash": "<64-hex-characters>", "script": "<instructions to save>"}'
const res = await fetch('https://api.60db.ai/deep-analytics/calls/7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d/agent-fix/apply', {
method: 'POST',
headers: {
Authorization: 'Bearer your-api-key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"base_hash": "<64-hex-characters>",
"script": "<instructions to save>"
}),
});
const { success, data, message, code } = await res.json();
if (!success) throw new Error(`${code}: ${message}`);
Writes the script to the AI agent. The previous text is kept so you can undo.
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
Path
Body
64 hex characters. The
base_hash from Suggest Agent FixThe instructions to save, usually
after from the suggestion, optionally edited. Limited to the agent script limitResponse
200{
"success": true,
"data": {
"fix_id": "<fix-id>",
"agent": {
"id": "<ai-agent-uuid>",
"name": "Front desk"
},
"previous_script": "...",
"new_hash": "<64-hex-characters>"
}
}
Errors
Errors use{ "success": false, "message": "...", "code": "..." }. See the overview for the codes every route can return.
This endpoint
| Status | Code | When |
|---|---|---|
| 409 | AGENT_CHANGED | The agent changed since the preview. Suggest again |
| 429 | AGENT_FIX_RATE_LIMITED | More than 10 per minute |
Example
curl -X POST 'https://api.60db.ai/deep-analytics/calls/7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d/agent-fix/apply' \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"base_hash": "<64-hex-characters>", "script": "<instructions to save>"}'
const res = await fetch('https://api.60db.ai/deep-analytics/calls/7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d/agent-fix/apply', {
method: 'POST',
headers: {
Authorization: 'Bearer your-api-key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"base_hash": "<64-hex-characters>",
"script": "<instructions to save>"
}),
});
const { success, data, message, code } = await res.json();
if (!success) throw new Error(`${code}: ${message}`);