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

# Synthflow

> Send finished Synthflow calls to Agnost AI

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

Setup takes about five minutes.

Synthflow is a hosted platform and does not export OpenTelemetry traces, so this guide uses its webhook instead of an OpenTelemetry setup.

## 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/synthflow?org_id=<your-agnost-org-id>&agent_name=<display-name>
```

`agent_name` is optional and must be URL-encoded, for example `Front%20Desk`. Synthflow's payload carries the agent ID (`model_id`) but not the agent's name, so without `agent_name` the agent ID becomes the agent name in Agnost AI.

## 3. Connect the agent's webhook to Agnost AI

In the [Synthflow dashboard](https://app.synthflow.ai), open the agent and select **Deployment**. Paste the URL into the **Webhook** field and save.

Or set it through the API with the agent's `external_webhook_url`:

```bash theme={null}
curl -X PUT "https://api.synthflow.ai/v2/assistants/<model-id>" \
  -H "Authorization: Bearer $SYNTHFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"external_webhook_url": "<your-webhook-url>"}'
```

If you start calls with the [Make a call](https://docs.synthflow.ai/api-reference/platform-api/calls/voice-call) API, you can also pass the URL as `external_webhook_url` on each call request.

The webhook is set per agent. Repeat these steps for each agent you want to monitor, with its own `agent_name`.

Synthflow sends the post-call webhook to one URL. 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

Place or receive a call with the agent. Synthflow sends the webhook after the call ends and its post-call analysis finishes, so the conversation appears shortly after hang-up.

In [app.agnost.ai](https://app.agnost.ai), open **Users**. Each call is a session for the lead's phone number, with the full transcript in the conversation panel. The conversation's **Metadata** tab shows Synthflow's call details, such as the status, end reason, summary, analysis, and collected variables.

## 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 "Book an appointment" or "Agent books without confirming the time." Agnost AI classifies each call automatically about 15 minutes after it ends.

## Verify

1. Place a short test call and say at least one sentence as the caller.
2. In Synthflow, open **Logs** and then **Webhook logs**. The delivery to the Agnost AI URL shows a `200` response with `"status": "accepted"`.
3. In Agnost AI, open **Users** and find the lead's phone number. The conversation shows each caller and agent exchange.

## Troubleshooting

* **The webhook log shows `400`:** check that `org_id` is a valid UUID.
* **The webhook log shows `204` and no conversation appears:** the caller did not speak, or the call did not reach a final status. Calls where only the agent spoke (no answer, busy, voicemail) are not captured.
* **No delivery appears in Webhook logs:** check that the URL is saved in the agent's **Deployment** tab, or that your Make a call request includes `external_webhook_url`.
* **Calls do not appear in Agnost AI:** check that `org_id` matches the organization selected in Agnost AI.
* **Calls appear under the call ID instead of a phone number:** the payload had no `lead.phone_number`.

## Data mapping

* `call.call_id` becomes the Agnost AI conversation ID.
* `lead.phone_number` becomes the user ID, and `lead.name` is stored with the user. Without a phone number, Agnost AI uses the call ID.
* `call.transcript` lines that start with `bot:` or `human:` become agent and caller turns. A line without a speaker prefix continues the previous turn.
* `call.start_time` anchors the conversation start time.
* `call.status`, `end_call_reason`, `custom_end_call_reason`, `duration`, `timezone`, `call_sid`, `external_id`, and `model_id` become conversation metadata.
* `analysis.call_summary_feedback` becomes `call_summary`. The whole `analysis` object, `collected_variables`, `metadata`, `lead.prompt_variables`, and the values from information extractor actions (`extracted_info`) are stored as JSON metadata.
* A `call.recording_url` with an `http` or `https` scheme becomes the conversation recording.
* Actions in `executed_actions` with `real_time_action: true` become tool events, with `parameters_from_llm` as the input and `return_value` (or `error_message`, marked as failed) as the output. Post-call actions such as the information extractor ran after the call, so they stay in metadata.

Synthflow does not send per-turn timestamps. Agnost AI spreads the turns across `call.duration` in proportion to their length and marks the conversation with `transcript_timing: estimated`, so per-exchange durations for Synthflow calls are approximate.

## Delivery behavior

Synthflow sends one post-call webhook per call. On a warm transfer it is sent at the handoff, and the transcript stops there.

Agnost AI captures calls whose `call.status` is final (`completed`, `no-answer`, `busy`, `failed`, `canceled`, `user-canceled`, `hangup_on_voicemail`, `left_voicemail`, or `spam`) and where the caller spoke, and returns `200`. It returns `204` for any other status and for calls where the caller never spoke. An invalid `org_id`, or a payload without `call` or `call.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) returns `413`. Downstream ingestion failures return `502`.

If the same call is delivered 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 a later delivery of it is captured.

Synthflow can sign webhooks with an HMAC of the call ID in the `HTTP_SYNTHFLOW_SIGNATURE` header. Verifying it requires storing each organization's Synthflow secret key, so this integration follows the same organization-routing trust model as the other voice webhook adapters and does not verify the signature. Treat the webhook URL as sensitive until per-organization signature verification is available.

## References

* [Synthflow post-call webhook](https://docs.synthflow.ai/webhooks)
* [Synthflow webhook security](https://docs.synthflow.ai/security#webhook-security)
* [Synthflow Webhook logs](https://docs.synthflow.ai/logs#webhook-logs)
* [Update an agent API](https://docs.synthflow.ai/api-reference/platform-api/agents/update-assistant)

## Next steps

* [Conversations](https://docs.agnost.ai/using-conversations.md): review complete Synthflow calls.
* [Events](https://docs.agnost.ai/using-events.md): inspect each caller and agent exchange.
* [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.