End of Call
Sends an HTTP notification to your endpoint when a call ends, regardless of attempt. The payload contains the full transcript, recording, duration, and analysis of the completed call.
Delivery
- Method:
POST - Content-Type:
application/json - Request timeout: 30 seconds. If your endpoint does not respond in 30s, the attempt is treated as failed and retried.
- Authorization: If a bearer token is configured for the agent, requests include an
Authorization: Bearer <token>header.
Payload
{
"id": "cHYqKdGz25Rq",
"session": {
"id": "sn_8Qd1mTbR"
},
"startedAt": "2024-09-24T18:20:22.724Z",
"endedReason": "customer-ended-call",
"messages": [{
"role": "system",
"message": "You are a helpful assistant"
}, {
"role": "agent",
"message": "Hello"
}, {
"role": "user",
"message": "Hi"
}],
"customer": {
"name": "Jane Doe",
"phoneNumber": "+15551234567"
},
"variableValues": {
"myVariable": "myValue"
},
"durationSeconds": 15,
"detailsURL": "https://fonema.ai/shareable/cHYqKdGz25Rq",
"recordingURL": "https://fonema.ai/api/v1/storage/calls/cHYqKdGz25Rq.mp3",
"analysis": {
"successEvaluation": true,
"structuredData": {
"myData": "myValueFromCall"
},
"summary": "The customer confirmed the appointment."
}
}
Main fields
| Field | Type | Description |
|---|---|---|
id | string | Unique call ID, consistent across all webhooks for the same call. |
session.id | string | Session ID that groups all call attempts to the same customer. |
startedAt | string | Call start date-time in ISO 8601. |
endedReason | string | Why the call ended (for example customer-ended-call, user-not-contacted). |
messages | array | Full conversation transcript. |
customer.name | string | Optional. Present when a name was provided when creating the call. |
customer.phoneNumber | string | Destination phone number in E.164 format. |
variableValues | object | Input variables provided when the call was created. |
durationSeconds | integer | Total call duration in seconds. |
detailsURL | string | URL to view call details in the dashboard. |
recordingURL | string | Optional. URL to download the audio recording. Present only when a recording is available. |
analysis.successEvaluation | boolean | Whether the success criteria was met. |
analysis.structuredData | object | Output variables and extracted values. |
analysis.summary | string | Natural-language summary of the call. |
Message details
The messages field contains the complete call transcript:
role: Participant role (system,agent,user)message: Message content
Responding to events
Return any HTTP 2xx status code to acknowledge receipt. Response body is ignored.
Any of the following is treated as failure and triggers a retry:
- 3xx, 4xx, or 5xx response
- Network error (connection refused, DNS failure, TLS error)
- No response within the 30-second timeout
Your endpoint must be idempotent. Since non-2xx responses are retried, the same event may be delivered multiple times. Deduplicate using id.
Respond well under 30 seconds—ideally acknowledge immediately (for example by queueing the event) and do heavy processing asynchronously.
Retry policy
Failed deliveries are retried automatically with exponential backoff (each delay is 3× the previous one):
| Attempt | Delay after previous attempt |
|---|---|
| 1 | — (initial delivery) |
| 2 | 5 seconds |
| 3 | 15 seconds |
| 4 | 45 seconds |
| 5 | 2 min 15 sec |
| 6 | 6 min 45 sec |
| 7 | 20 min 15 sec |
| 8 | 1 hr 45 sec |
| 9 | 3 hr 2 min 15 sec |
After nine attempts the event is dropped and won't be resent. If your endpoint was down longer than the retry window, reconcile state using the API instead of waiting for redelivery.