End-of-call report
When a call ends and a server URL is configured, Vapi sends an end-of-call-report message after post-call processing. The report can include the call’s transcript, messages, recording links, costs, ended reason, and structured outputs. By default, Vapi sends the report once and doesn’t retry, so respond quickly and save the report when it arrives. Handle duplicate requests, too. For more information, see Handle duplicates.
What you can use it for
- Save call records: Store transcripts, recordings, and structured outputs in your database or CRM.
- Start follow-up work: Create a ticket, send a confirmation, or update a lead from the call’s structured outputs.
- Track costs: Record the cost of each call and its components.
- Monitor quality: Track ended reasons and latency to find failed or slow calls.
- Keep call content under Zero Data Retention: Save the report in your application when Vapi doesn’t retain the transcript and messages. If you configured custom storage, call content may also be available there.
Receive your first report
Create an endpoint
For a first test, create an HTTPS endpoint that accepts JSON POST requests. Handle each report in this order:
- Receive the report.
- Return
200. - Do any work on the report, such as saving it or updating your CRM.
Vapi waits up to 20 seconds for a response by default and doesn’t retry unless you configure retries. See Timeouts and retries. These minimal examples follow that order and log fields from the report.
The examples listen on local port 3000. Set your server URL to the public HTTPS address that reaches that port, such as your hosting provider’s URL or a tunnel to your machine.
Set the server URL
Set your endpoint as the server URL on the assistant, phone number, or organization. For more information, see Setting server URLs.
Replace YOUR_CREDENTIAL_ID with the ID of the custom credential Vapi uses to sign requests. To create one, see Verify requests. For a first test without verification, remove the credentialId line.
Make a test call
Call the assistant and end the call. The report usually arrives within seconds. For exceptions, see When an end-of-call report is sent.
If it doesn’t arrive, open Webhook logs and filter by the call or the end-of-call-report type. See Troubleshooting.
Choose which server URL receives the report
Vapi sends the report to one server URL only. It uses the first server URL that is set, in this order:
- The assistant’s server URL.
- The phone number’s server URL.
- The organization’s server URL.
For a squad call, Vapi sends one end-of-call report using the server URL selected for the assistant active when the call ends. It doesn’t send a separate report for each assistant that handled the call.
Turn the report on or off
The default serverMessages list includes end-of-call-report. Setting serverMessages replaces that list, so include end-of-call-report and any other messages your server needs. For valid values, see the assistant API reference.
This example subscribes to only these two server messages. To stop receiving the report, leave end-of-call-report out of the list.
Verify requests
Add a custom credential and set its ID in server.credentialId on the assistant, phone number, or organization whose server URL receives the report.
Always set server.credentialId. Without it, Vapi may sign the request with a different credential from your organization, and your signature check fails.
Signing options
With an HMAC credential, Vapi signs each request with your credential’s secret. Choose these settings when you create the credential:
With the defaults, each request includes these headers:
x-timestamp: Unix time in milliseconds when the request was signed.x-signature: A hex-encoded HMAC of{x-timestamp}.{raw request body}.
If you can’t verify signatures, you can use a Bearer token or OAuth 2.0 credential instead. For more information, see Server authentication.
What your endpoint should check
- Compute the signature from the raw request body before you parse it.
- Compare it to the signature header with a constant-time comparison.
- Reject requests with a timestamp outside a short window to prevent replay. Retries reuse the original timestamp, so make the window longer than your total retry delay.
Example verification code
These examples use the default settings with the sha256 algorithm. They check the signature only, so add the timestamp check for production. Match the code to your credential’s settings.
When an end-of-call report is sent
Vapi sends the report after post-call processing finishes. This can include structured outputs, analysis, and recording uploads. The report usually arrives within seconds of the call ending.
- Twilio calls that end outside the conversation: Sometimes Vapi learns that a Twilio call ended only from Twilio’s status update, for example with the
call.in-progress.twilio-completed-callended reason. In that case, the report can arrive up to 10 minutes after the call ends. - Calls that never connect: Vapi still sends a report, with the ended reason that explains why. These reports have empty or zero values for conversation fields and costs.
- Calls that fail before they start: Vapi may not send a report. To find these calls, use List calls and check
endedReason. - Analysis that fails: If a structured output or analysis step fails, Vapi still sends the report without that result.
For more information about each ended reason, see Call ended reasons.
Payload
Every server message has the same body shape: a message object. For the report, message.type is end-of-call-report. This example is shortened:
Fields
These fields are inside the report’s message object. Some appear only for certain calls or settings, as noted in each description. You can’t choose which fields Vapi sends, but you can control which optional fields Vapi fills. See Settings that change the report.
Settings that change the report
The report includes the data generated for the call. Configure these settings before the call to control which artifacts and analysis Vapi generates. The linked guides explain each setting.
Recordings
For artifacts stored by Vapi, the recordingUrl, stereoRecordingUrl, and recording fields identify private files. Use your private API key with the artifact endpoints to download them, for example GET /call/{id}/mono-recording. If you use custom storage, access follows your storage configuration.
The presigned fields, such as presignedMonoUrl, are temporary links that need no authentication. They stop working at presignedUrlsExpiresAt. Save the stable fields, and download what you need before the presigned links expire.
Timeouts and retries
- Timeout: Vapi waits for your response for
server.timeoutSeconds, 20 seconds by default. - Success: Any
2xxstatus. Vapi ignores the response body. - Retries: By default, Vapi tries once. If your server times out or returns an error, Vapi doesn’t send the report again, and you can’t request it again later.
To turn on retries, set server.backoffPlan. The maxRetries value is the total number of attempts, so set it to at least 2:
The backoff plan applies to every server message sent to that server URL, not only the report.
Handle duplicates
Your server can receive the same report more than once, for example after a retry. Retried requests are identical to the first attempt. Use message.call.id to make processing idempotent: If you have already saved a report for that call, return 200 and skip it.
Don’t rely on the order of server messages. The report can arrive before or after the status-update message that says the call ended.
Zero Data Retention and HIPAA
- Zero Data Retention: Vapi can send generated transcripts and messages in the report, but doesn’t keep them on the call. Recordings are available only if you use your own storage. Save the report when it arrives.
- HIPAA: The report can include transcripts, messages, and recording links when those artifacts are generated.
Troubleshooting
Related
- Server events: Every message Vapi sends to your server URL.
- Setting server URLs: Where to set server URLs and which one wins.
- Server authentication: Create credentials to verify requests.
- Structured outputs: Extract data from calls into the report.
- Webhook logs: Inspect deliveries and responses.