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

# Webhooks

> Where call notifications and tool requests are configured now.

There is no separate "webhooks" configuration surface. What used to be one setting
(`webhook_url` + `webhook_events` on an agent) is now two things, both already documented
elsewhere:

* **A tool your workflow calls.** Any step — during the call or after it — can call your own
  HTTP endpoint. See [Create a Tool](https://docs.goyappr.com/api-reference/tools/create.md) and
  [Add a Tool Contract Revision](https://docs.goyappr.com/api-reference/tools/create-revision.md) for the request shape,
  including the `call` package every request carries.
* **An After trigger.** A workflow's After section runs one or more tool steps in response to
  one named event — `call.ended`, `analysis.ready`, `call.answered` (the pickup itself, live),
  and the rest. See [Trigger events](https://docs.goyappr.com/api-reference/workflows/events.md) for the full list and the
  mapping from the agent-level `webhook_events` values you may already be using, and
  [Follow-up triggers](https://docs.goyappr.com/api-reference/workflows/save.md#follow-up-triggers) for how a trigger is
  authored.

## Confirming a delivery

Every delivery, from either of the two above, is recorded — whether it landed, what your
endpoint answered, how many attempts it took, and one sentence when it failed.

* **For one call**, read its [timeline](https://docs.goyappr.com/api-reference/calls/get.md): the `delivery` rows are in it
  beside the turns and the tool calls.
* **Across calls**, list them with [`GET /deliveries`](https://docs.goyappr.com/api-reference/deliveries/list) —
  filtered by tool, by agent, by `status=failed`, or by a window. The rows are the same shape as
  the timeline's, so one parser reads both.

## Recognising a resend

The same request can reach your endpoint more than once: you [retry](https://docs.goyappr.com/api-reference/deliveries/retry.md)
a delivery your endpoint refused or never answered, or the platform sends a `call.dnc_blocked`
event again on its own. Every send says which request it is:

* **`X-Webhook-Delivery-Id`** is the id of the chain's **first** delivery — the same on the
  first send and on every retry of it. **Dedupe on it**: if you already acted on that id, skip
  the request and answer `2xx`. It is the `chain_root_id` of every
  [delivery row](https://docs.goyappr.com/api-reference/deliveries/list.md), so a row and the request your endpoint
  received can be matched.
* **`X-Webhook-Retry-Of`** is on a retry only, and names the attempt that was retried — on a
  second retry, the first retry.
* **`X-Webhook-Delivery-Attempt`** counts the sends across the chain: `1`, then `2` on its
  first retry, and so on.

[Get Delivery](https://docs.goyappr.com/api-reference/deliveries/get.md#the-headers-every-delivery-carries) lists every
header a delivery carries and shows the values the platform sent. A prompt or flow agent's own
webhook tool, called during a live call, sends only the headers you configured, so it cannot be
deduped this way.

An agent not yet moved to the workflow engine keeps its `webhook_url` / `webhook_events`
fields working exactly as before — see [Update Agent](https://docs.goyappr.com/api-reference/agents/update.md). Once it
is moved, those three fields are cleared and its notifications live as After triggers instead.
The event names stay the same and each request still carries `event` at the top level, but the
rest of the body changes shape: the call is under `call`, and `data` and `timestamp` are gone.
Your endpoint has to read the new shape — see
[what a trigger's step sends](https://docs.goyappr.com/api-reference/workflows/events.md#what-a-triggers-step-sends).

## What an agent's call event carries

An agent's `webhook_url` receives `{event, timestamp, agent_id, company_id, call_id, data}`.
On every call event (`call.ended`, `transcript.ready`, `call.analyzed` and the rest), `data`
carries the call's facts as [Get call](https://docs.goyappr.com/api-reference/calls/get.md) reads them:

| Key | What it is |
| - | - |
| `direction`, `status` | As on the call. |
| `from_number`, `to_number` | The caller and the number dialled. |
| `duration_seconds` | Connected time in whole seconds. |
| `started_at` | When the call was placed. |
| `answered_at` | When its audio came up. Absent until it did. |
| `recording_started_at` | When its recording began. `transcript[].start` and `end` are milliseconds from here — see [Placing the transcript on the clock](https://docs.goyappr.com/api-reference/calls/get.md#placing-the-transcript-on-the-clock). `null` until the recording is saved (so usually on `call.ended`), on a browser call, and on older calls recorded before the field was added. |
| `disposition`, `summary`, `transcript`, `extracted_data` | Once they exist. |

Every moment is ISO 8601 in UTC with a `+00:00` offset, as `GET /calls/{id}` writes it.
`transcript.ready` and `call.analyzed` are sent after the recording is saved, so on a phone
call they carry `recording_started_at`. No event carries the conversation while the call is
still going; [Get call](https://docs.goyappr.com/api-reference/calls/get.md#reading-the-conversation-while-the-call-runs)
shows how to act on what a caller agrees to during the call.

## When the analysis notification arrives twice

An agent's `call.analyzed` notification is sent once per call as a rule. It is sent a second
time only when a later analysis pass fills in something the first one lacked: a summary, a
disposition, or an extracted field that had no value. The later pass never changes a value
already sent, so the second payload is the first one plus what was missing. Key on the call's
`id` and keep the later payload; the disposition is the same in both. A workflow's
`analysis.ready` trigger opens once per call.


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