> ## 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.

# Cartesia

> Send finished Cartesia voice agent calls to Agnost AI

Agnost AI accepts Cartesia's call webhook and turns each finished call into a conversation with an event for every caller and agent exchange, plus a tool event for every tool call. Cartesia already provides the transcript with per-turn timing, so Agnost AI does not run speech-to-text again. No SDK or code change is needed.

This works for Cartesia Managed Agents and for Line SDK agents, which send the same call webhook.

Setup takes about five minutes.

## 1. Get your organization ID

Sign in to [app.agnost.ai](https://app.agnost.ai), open **Settings**, and copy the **Organization ID** under **General**. It is a UUID.

## 2. Build your webhook URL

```text theme={null}
https://api.agnost.ai/api/voice/v1/webhooks/cartesia?org_id=<your-agnost-org-id>
```

To show a different name in Agnost AI, add `&agent_name=<display-name>`, URL-encoded, for example `Booking%20Agent`. Without it, Agnost AI uses the agent name from Cartesia.

## 3. Add the webhook to the agent

In the [Cartesia Playground](https://play.cartesia.ai/agents), open the agent and go to **Advanced**:

1. Under **Context**, select **Add webhook** next to **Post-call webhooks**.
2. Enter a **Name**, paste the URL into **URL**, and enter any **Authentication Secret**. Cartesia requires a secret; Agnost AI does not check it.
3. Select **Add**.

The webhook applies to new calls right away, without **Publish**.

You can also create the webhook through the API and then attach its `id` to the agent, as shown in Cartesia's [Call webhooks](https://docs.cartesia.ai/agents/webhooks) guide:

```bash theme={null}
curl -X POST "https://api.cartesia.ai/agents/webhooks" \
  -H "X-API-Key: $CARTESIA_API_KEY" \
  -H "Cartesia-Version: 2026-08-14" \
  -H "Content-Type: application/json" \
  -d '{
    "display_name": "Agnost AI",
    "url": "<your-webhook-url>",
    "secret": "<any-secret>"
  }'
```

An agent has one webhook, and several agents can share one. If the agent's webhook already points at your own server, keep your server as the webhook and forward each delivery's JSON body to the Agnost AI URL unchanged.

## 4. Place a call and find it in Agnost AI

Talk to the agent with **Preview**, over the WebSocket API, or on a phone call. Cartesia sends the finished call as soon as it ends.

In [app.agnost.ai](https://app.agnost.ai), open **Users**. Each call is a session with the full transcript in the conversation panel. The conversation's **Metadata** tab shows Cartesia's call details, such as the end reason, connection type, direction, and duration.

## 5. Add patterns

Agnost AI evaluates the full call against your patterns, including caller needs and agent behavior. Create definitions on the **Patterns** page, such as "Reschedule an appointment" or "Agent books a slot without confirming the time." Agnost AI classifies each call automatically about 15 minutes after it ends.

## Troubleshooting

* **No calls appear:** check that the URL starts with `https://api.agnost.ai`, that `org_id` is a valid UUID, and that it matches the organization selected in Agnost AI.
* **Some calls are missing:** Agnost AI skips calls where the caller never spoke, such as unanswered outbound calls, voicemail, and failed dials.
* **Calls appear under the call ID instead of a person:** the call came over WebSocket or Preview, which carry no phone number. Pass a `user_id` value in [`dynamic_variables`](https://docs.cartesia.ai/agents/dynamic-variables) when you create the WebSocket session or outbound call.
* **Testing with curl:** the sample in Cartesia's docs has an empty transcript, so Agnost AI returns `204` and stores nothing. Place a real call to see data.

## Data mapping

* The Cartesia call `id` becomes the Agnost AI conversation ID.
* The user ID is the `user_id` dynamic variable. Without it, Agnost AI uses `telephony_params.from` on inbound phone calls and `telephony_params.to` on outbound phone calls, then the call ID.
* `transcript` turns with `role` `user` and `assistant` become caller and agent turns, timed by their `start_timestamp` and `end_timestamp` from `call.start_time`. `system` turns are skipped.
* Each entry in a turn's `tool_calls` becomes a tool event with its `name`, `arguments`, and `result`. Cartesia does not report whether a tool call failed, so every tool event is marked successful; check the result text for errors.
* `status`, `end_reason`, `error_message`, start and end times, duration, connection type, direction, call SID, telephony account type, agent and agent version IDs, deployment details, `summary`, and `dynamic_variables` become conversation metadata.

Cartesia's call summary usually arrives later in a separate `post_call_analysis` event. Agnost AI stores the summary only when it is already on the finished call.

## Delivery behavior

Cartesia sends every event of a call to the same webhook: `call_started`, one `call_turn` per turn, then `call_completed` or `call_failed`, and later `post_call_analysis`. Agnost AI captures the call from `call_completed` or `call_failed` and returns `200`. Calls that fail mid-conversation are captured too, with their `end_reason` and `error_message` in the metadata.

Agnost AI returns `204` for `call_started`, `call_turn`, `post_call_analysis`, event types it does not know, and calls where the caller never spoke. An invalid `org_id`, or a final event missing its `type`, `call` object, or call ID, returns `400`. A missing `org_id` or data that cannot be normalized returns `422`. A transcript over 1 MiB (1,048,576 bytes) or more than 100 tool calls returns `413`. Downstream ingestion failures return `502`, which Cartesia retries.

Cartesia retries a failed delivery up to 3 times. If the same call's final event arrives again, Agnost AI returns `200` with `"status": "duplicate"` and does not store it twice. Captured calls are remembered in memory for 24 hours, so a redelivery after the voice service restarts is stored again. A call whose capture failed is not remembered, so Cartesia's retry captures it.

Cartesia sends your secret in the `X-Webhook-Secret` header. Verifying it requires storing each organization's Cartesia secret, so this integration follows the same organization-routing trust model as the other voice webhook adapters and does not check the header. Treat the webhook URL as sensitive.

## References

* [Cartesia: Call webhooks](https://docs.cartesia.ai/agents/webhooks)
* [Cartesia: Observability and webhook payloads](https://docs.cartesia.ai/line/infrastructure/observability)
* [Cartesia: Get Call API](https://docs.cartesia.ai/api-reference/agents/calls/get-call)

## Next steps

* [Conversations](https://docs.agnost.ai/using-conversations.md): review complete Cartesia calls.
* [Events](https://docs.agnost.ai/using-events.md): inspect each caller and agent exchange and tool call.
* [Patterns](https://docs.agnost.ai/using-patterns.md): understand why callers contacted the agent.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.