Escalation Chains
Escalation chains define multi-level routing for issues that need progressively more capable agents. Each level has a timeout and optional confidence threshold — if the current agent can't resolve the issue in time, it escalates to the next level.
Creating a chain
bash
# Create an escalation chain
curl -X POST http://localhost:3000/escalation-chains \
-H "Authorization: Bearer ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"name": "support-escalation",
"levels": [
{ "agentId": "support-agent", "timeoutSeconds": 300 },
{ "agentId": "senior-agent", "timeoutSeconds": 600, "confidenceThreshold": 0.5 },
{ "agentId": "human-escalation", "timeoutSeconds": 3600 }
]
}'Triggering escalation
bash
# Trigger an escalation
curl -X POST http://localhost:3000/escalation-chains/esc_abc123/trigger \
-H "Authorization: Bearer ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"reason": "Customer cannot access their account after password reset",
"context": { "ticketId": "T-4821", "severity": "high" }
}'Escalation lifecycle
- Triggered — escalation created with reason and context
- Acknowledged — an agent accepts the escalation
- Resolved — the issue is resolved with a resolution note
bash
# Acknowledge an escalation
curl -X POST http://localhost:3000/escalations/e_abc123/acknowledge \
-H "Authorization: Bearer ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-d '{ "agentId": "senior-agent" }'
# Resolve an escalation
curl -X POST http://localhost:3000/escalations/e_abc123/resolve \
-H "Authorization: Bearer ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-d '{ "resolution": "Password reset link was expired. Regenerated and confirmed access." }'Endpoint reference
| Method | Endpoint | Description |
|---|---|---|
POST | /escalation-chains | Create chain |
GET | /escalation-chains | List chains |
GET | /escalation-chains/:id | Get chain details |
PUT | /escalation-chains/:id | Update chain |
DELETE | /escalation-chains/:id | Delete chain |
POST | /escalation-chains/:id/trigger | Trigger escalation |
GET | /escalations | List escalations (filter by status) |
POST | /escalations/:id/acknowledge | Acknowledge |
POST | /escalations/:id/resolve | Resolve |