Agent Teams

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

  1. Triggered — escalation created with reason and context
  2. Acknowledged — an agent accepts the escalation
  3. 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

MethodEndpointDescription
POST/escalation-chainsCreate chain
GET/escalation-chainsList chains
GET/escalation-chains/:idGet chain details
PUT/escalation-chains/:idUpdate chain
DELETE/escalation-chains/:idDelete chain
POST/escalation-chains/:id/triggerTrigger escalation
GET/escalationsList escalations (filter by status)
POST/escalations/:id/acknowledgeAcknowledge
POST/escalations/:id/resolveResolve