> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agnost.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Vapi

> Send Vapi end-of-call reports to Agnost AI

Agnost AI accepts Vapi's standard `end-of-call-report` payload and turns its transcript into a conversation with events for each caller and assistant exchange. Vapi already provides the transcript, so Agnost AI does not run speech-to-text again.

## Configure the webhook

Configure the Vapi assistant or phone number server with:

```text theme={null}
URL: https://api.agnost.ai/api/voice/v1/webhooks/vapi
Method: POST
Header: X-Org-Id: <your-agnost-org-id>
Server message: end-of-call-report
```

Get your organization ID from [app.agnost.ai](https://app.agnost.ai). It must be a UUID.

If the assistant or phone number already sends events to another server URL, forward the unchanged Vapi request body from that server to Agnost AI. Vapi selects one server URL for each event rather than broadcasting it to every configured URL.

## Required data

The report must contain:

* `message.type` equal to `end-of-call-report`.
* A stable call ID in `message.call.id`.
* The caller number in `message.call.customer.number` or `message.customer.number`.
* Structured turns in `message.artifact.messages`, or a transcript in `message.artifact.transcript` or `message.transcript`.

The call ID becomes the Agnost AI conversation ID, the caller number becomes the user ID, and the Vapi assistant name becomes the agent name. `AI`, `Assistant`, and `Bot` transcript labels map to the agent; `User`, `Customer`, and `Caller` map to the user.

Repeated deliveries map to the same conversation but can duplicate its events. Avoid manually replaying a successful report; retry only reports that received a non-2xx response.

## Response

```json theme={null}
{
  "status": "accepted",
  "session_id": "01a01158-b8d1-7000-aafb-c3bd72914986",
  "user_id": "+15559876543",
  "event_count": 3
}
```

The conversation metadata includes available Vapi call status, timing, end reason, cost, summary, structured analysis, assistant and phone-number identifiers, and safe recording or log URLs. Agnost also attaches Vapi's completed total cost to exactly one event so the conversation cost appears without being multiplied by the number of exchanges. The call is timestamped from Vapi's `startedAt` value.

## Troubleshooting

* **`422` for a missing header**: add `X-Org-Id` to the Vapi server configuration or forwarded request.
* **`400` for the organization ID**: confirm `X-Org-Id` is a valid UUID.
* **`400` for the event type**: enable `end-of-call-report` in Vapi's server messages.
* **`400` for identity**: ensure `message.call.id` and the caller number are present.
* **`422` for an empty transcript**: ensure Vapi transcript artifacts are enabled for the call.

## Next steps

* [Conversations](/using-conversations): review complete Vapi calls.
* [Events](/using-events): inspect each caller and assistant exchange.
* [Intents](/using-intents): understand why callers contacted the agent.
