CtrlK
BlogDocsLog inGet started
Tessl Logo

sinch-partnerships-ecosystems/sinch-skills

Official Sinch API skills for AI coding agents — SMS, Voice, Verification, Numbers, Mailgun email, and more.

71

Quality

89%

Does it follow best practices?

Impact

No eval scenarios have been run

SecuritybySnyk

Advisory

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

callbacks.mdskills/sinch-voice-api/references/

Voice API Callback Events

Contents

  • Common Fields
  • ICE — Incoming Call Event
  • ACE — Answered Call Event
  • DiCE — Disconnected Call Event
  • PIE — Prompt Input Event
  • Notify Event
  • AMD — Answering Machine Detection

The Sinch platform sends callback events as POST requests to your configured callback URL. Events that accept SVAML must return a valid SVAML response. Events that don't accept SVAML (DiCE, Notify) are fire-and-forget — return 200 OK with empty body.

Common Fields

All callback events include these base fields:

FieldTypeDescription
eventstringEvent type: ice, ace, dice, pie, notify
callIdstringUnique call identifier
versionintegerAPI version
customstringCustom data passed with the call
applicationKeystringYour application key

Call-related events (ICE, ACE, DiCE) also include:

FieldTypeDescription
callResourceUrlstringURL to manage this call via REST
timestampstringISO 8601 timestamp

ICE — Incoming Call Event

Fired when a call reaches the Sinch platform. Requires SVAML response.

Additional Fields

FieldTypeDescription
clistringCaller ID (E.164)
toobjectDestination: `{ "type": "number"
domainstring"pstn" or "mxp"
originationTypestringOrigin domain
durationintegerCall duration in seconds
rdnisstringRedirected Dialled Number Identification Service
callHeadersarrayHeaders from SDK client: [{ "key": "k", "value": "v" }]
userRateobject{ "currencyId": "USD", "amount": 0.01 }

Example Request

{
  "event": "ice",
  "callId": "aaa11111222233334444555566667777",
  "callResourceUrl": "https://calling-euc1.api.sinch.com/calling/v1/calls/id/aaa11111222233334444555566667777",
  "timestamp": "2024-01-15T10:30:00Z",
  "version": 1,
  "custom": "",
  "applicationKey": "00000000-0000-0000-0000-000000000000",
  "cli": "+15551000001",
  "to": { "type": "number", "endpoint": "+15551000002" },
  "domain": "pstn",
  "originationType": "pstn",
  "userRate": { "currencyId": "USD", "amount": 0.0 }
}

Example SVAML Response

{
  "instructions": [
    { "name": "say", "text": "Welcome to our service.", "locale": "en-US" }
  ],
  "action": {
    "name": "connectPstn",
    "number": "+15551000003",
    "cli": "+15551000001"
  }
}

ACE — Answered Call Event

Fired when the callee answers. Requires SVAML response. Not sent for in-app (username) destinations, even with enableAce: true.

Additional Fields

FieldTypeDescription
amdobjectAnswering Machine Detection result (if AMD was enabled). See AMD section below

Example Request

{
  "event": "ace",
  "callId": "aaa11111222233334444555566667777",
  "callResourceUrl": "https://calling-euc1.api.sinch.com/calling/v1/calls/id/aaa11111222233334444555566667777",
  "timestamp": "2024-01-15T10:30:05Z",
  "version": 1,
  "custom": "",
  "applicationKey": "00000000-0000-0000-0000-000000000000"
}

Example SVAML Responses

Continue the call (no rerouting):

{ "action": { "name": "continue" } }

Play a menu:

{
  "instructions": [
    { "name": "startRecording", "options": { "notificationEvents": true } }
  ],
  "action": {
    "name": "runMenu",
    "mainMenu": "main",
    "menus": [
      {
        "id": "main",
        "mainPrompt": "#tts[Press 1 for sales or 2 for support.]",
        "options": [
          { "dtmf": 1, "action": "return(sales)" },
          { "dtmf": 2, "action": "return(support)" }
        ]
      }
    ]
  }
}

DiCE — Disconnected Call Event

Fired when the call ends. Fire-and-forget — no SVAML response. Return 200 OK. Use for logging, cleanup, and billing reconciliation.

Additional Fields

FieldTypeDescription
reasonstringDisconnect reason (see table below)
resultstring"ANSWERED", "BUSY", "NOANSWER", "FAILED", "N/A"
durationintegerCall duration in seconds
debitobject{ "currencyId": "USD", "amount": 0.05 } — actual cost
userRateobjectPer-minute rate
toobjectDestination
fromstringCaller info
callHeadersarrayHeaders from SDK client

Disconnect Reasons

ReasonDescription
CALLERHANGUPCaller hung up
CALLEEHANGUPCallee hung up
TIMEOUTExceeded configured timeout
CANCELCall was canceled
BUSYCallee line busy
NOANSWERNo answer
BLOCKEDCall blocked
MANAGERHANGUPCall manager terminated
NOCREDITPARTNERInsufficient credit
CONGESTIONNo available routes
GENERALERRORUnspecified error
CALLBACKERRORCallback URL error
USERNOTFOUNDUser not found
OTHERPEERANSWEREDAnother instance answered

Example Request

{
  "event": "dice",
  "callId": "aaa11111222233334444555566667777",
  "timestamp": "2024-01-15T10:35:00Z",
  "version": 1,
  "custom": "",
  "applicationKey": "00000000-0000-0000-0000-000000000000",
  "reason": "CALLEEHANGUP",
  "result": "ANSWERED",
  "duration": 295,
  "debit": { "currencyId": "USD", "amount": 0.05 },
  "userRate": { "currencyId": "USD", "amount": 0.01 }
}

PIE — Prompt Input Event

Fired when a runMenu action collects input. Requires SVAML response.

Additional Fields

FieldTypeDescription
menuResultobjectThe collected input (see below)

menuResult Object

FieldTypeDescription
menuIdstringID of the menu that triggered the event
typestring"return", "sequence", "timeout", "hangup", "invalidinput", "error"
valuestringThe collected value (e.g., "support" for return(support), or DTMF digits for sequence)
inputMethodstring"dtmf" or "voice"

Example Request

{
  "event": "pie",
  "callId": "aaa11111222233334444555566667777",
  "timestamp": "2024-01-15T10:30:10Z",
  "version": 1,
  "applicationKey": "00000000-0000-0000-0000-000000000000",
  "menuResult": {
    "menuId": "main",
    "type": "return",
    "value": "support",
    "inputMethod": "dtmf"
  }
}

Example SVAML Response

{
  "instructions": [
    { "name": "say", "text": "Connecting you to support.", "locale": "en-US" }
  ],
  "action": {
    "name": "connectPstn",
    "number": "+15551000003",
    "cli": "+15551000001"
  }
}

Notify Event

Fired for notifications (e.g., recording finished, AMD result for async mode). Fire-and-forget — no SVAML response.

Additional Fields

FieldTypeDescription
typestringNotification type (e.g., "recording_finished", "transcription_complete")
destinationstringURL of the generated recording/transcription file
amdobjectAMD result (for async AMD mode)

Example Request

{
  "event": "notify",
  "callId": "aaa11111222233334444555566667777",
  "version": 1,
  "applicationKey": "00000000-0000-0000-0000-000000000000",
  "type": "recording_finished",
  "destination": "https://storage.example.com/recordings/aaa11111.wav"
}

AMD — Answering Machine Detection

When amd: { enabled: true } is set on connectPstn, the ACE event includes an amd field:

FieldTypeDescription
amd.statusstring"human", "machine", "notsure", "hangup"
amd.reasonstring"longgreeting", "initialsilence", etc.
amd.durationintegerTime taken for detection (ms)

For async AMD (amd: { enabled: true, async: true }), the initial ACE has amd.status: "inprogress". The final result comes in a Notify event.

Links

skills

README.md

tile.json