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

# Outbound webhooks

> Receive Ringee activity in your application, verified and idempotent

Ringee pushes the events selected on your Custom Integration to its configured HTTP(S) endpoint. Every delivery is **HMAC-signed** and retried up to 10 times until your endpoint acknowledges it.

Calls generate terminal events only. Human and AI Voice Agent calls use the same
delivery pipeline, envelope, subscriptions and retry policy.

## Configure the endpoint

In **Integrations → Custom Integrations → Configure → Settings**:

1. Set **outbound URL** to your public HTTPS endpoint.
2. Select the events you want under the outbound event selector.
3. Click **Test webhook** to send a `test.ping`.

> [!NOTE]
>
> The endpoint must be reachable from the public internet and must **not**
> require your own auth token — Ringee authenticates by signing the body, not by
> sending credentials. Disable JWT verification on the route and verify the
> signature instead.

## Delivery format

```http theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
POST https://your-crm.example.com/webhooks/ringee
Content-Type: application/json
User-Agent: Ringee-Webhooks/1.0
Ringee-Signature: t=1747999938,v1=8f4c…
Ringee-Timestamp: 1747999938
```

```json theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
{
  "event": "call.completed",
  "eventId": "evt_01HX5ZBN7Y0Q3S4M2K1WJ8V5DC",
  "occurredAt": "2026-05-23T14:42:18.000Z",
  "workspaceId": "org_2k7yX…",
  "integrationId": "ci_…",
  "data": {
    "callId": "f3b1…",
    "externalId": "crm-contact-42",
    "user": {
      "id": "usr_…",
      "email": "ada@babbage.example.com",
      "fullName": "Ada Lovelace"
    },
    "agent": { "id": "va_…", "name": "Sofia" }
  }
}
```

## Identify the source

Outbound events can include these shared `data` fields:

| Field | When present |
| - | - |
| `data.user` | The Ringee user the event belongs to, including `id`, primary `email` and `fullName`. |
| `data.agent` | The AI Voice Agent that produced the event, as `{ id, name }`. It is absent for human-operated calls. |
| `data.externalId` | Your correlation id for an AI Voice Agent call, copied from `metadata.external_id` or `metadata.externalId`. |

Actor enrichment is best-effort. Ringee still delivers the event if the user or
agent can no longer be resolved, so treat `data.user` and `data.agent` as
optional. `data.externalId` follows every call-linked event from the same AI
Voice Agent call, including terminal, outcome, callback, meeting and recording
events.

> [!TIP]
>
> Set `metadata.external_id` when you start an AI Voice Agent call. You can then
> join every related webhook to your own record without parsing arbitrary
> metadata.

## Verify the signature

> [!WARNING]
>
> Read the request body as **raw text** first. Parsing the JSON before verifying
> — or re-serializing it — changes the bytes and the signature will never match.

The signature is `HMAC_SHA256(signingSecret, "<timestamp>.<rawBody>")`, hex-encoded.

**1. Parse the header**

`Ringee-Signature` has the form `t=<unixSeconds>,v1=<hexDigest>`. Extract both parts.

**2. Check the timestamp**

Confirm `t` matches the `Ringee-Timestamp` header, and reject anything more than **5 minutes** old. This blocks replay attacks.

**3. Recompute and compare**

Compute the HMAC over `` `${timestamp}.${rawBody}` `` with your `whsec_…` secret and compare in **constant time**.

**4. Reject failures with 401**

A missing header or a bad signature is a `401`. Never store or process an unverified event.

```ts Node / TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
import { createHmac, timingSafeEqual } from "node:crypto";

const TOLERANCE_SECONDS = 300;

export function verifyRingeeWebhook(
  rawBody: string,
  signatureHeader: string | null,
  timestampHeader: string | null,
  secret: string,
): boolean {
  if (!signatureHeader || !timestampHeader) return false;

  const parts = Object.fromEntries(
    signatureHeader.split(",").map((p) => p.split("=") as [string, string]),
  );
  const timestamp = parts.t;
  const signature = parts.v1;
  if (!timestamp || !signature) return false;
  if (timestamp !== timestampHeader) return false;
  if (!/^[0-9a-f]{64}$/i.test(signature)) return false;

  const age = Math.abs(Math.floor(Date.now() / 1000) - Number(timestamp));
  if (!Number.isFinite(age) || age > TOLERANCE_SECONDS) return false;

  const expected = createHmac("sha256", secret)
    .update(`${timestamp}.${rawBody}`)
    .digest("hex");

  if (expected.length !== signature.length) return false;
  return timingSafeEqual(
    Buffer.from(expected, "hex"),
    Buffer.from(signature, "hex"),
  );
}
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
import hashlib, hmac, time

TOLERANCE_SECONDS = 300

def verify_ringee_webhook(raw_body: str, signature_header: str,
                          timestamp_header: str, secret: str) -> bool:
    if not signature_header or not timestamp_header:
        return False

    try:
        parts = dict(p.split("=", 1) for p in signature_header.split(","))
    except ValueError:
        return False

    timestamp, signature = parts.get("t"), parts.get("v1")
    if not timestamp or not signature or timestamp != timestamp_header:
        return False

    if len(signature) != 64 or any(c not in "0123456789abcdefABCDEF" for c in signature):
        return False

    try:
        age = abs(int(time.time()) - int(timestamp))
    except ValueError:
        return False
    if age > TOLERANCE_SECONDS:
        return False

    expected = hmac.new(
        secret.encode(), f"{timestamp}.{raw_body}".encode(), hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(expected, signature)
```

```ts Supabase Edge Function theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
Deno.serve(async (req) => {
  const rawBody = await req.text(); // raw first — never req.json()

  const ok = verifyRingeeWebhook(
    rawBody,
    req.headers.get("Ringee-Signature"),
    req.headers.get("Ringee-Timestamp"),
    Deno.env.get("RINGEE_WEBHOOK_SIGNING_SECRET")!,
  );

  if (!ok) return new Response("invalid signature", { status: 401 });

  const event = JSON.parse(rawBody);
  await handleEvent(event);

  return new Response(JSON.stringify({ received: true }), { status: 200 });
});
```

> [!NOTE]
>
> The Edge Function that receives Ringee webhooks must have `verify_jwt =
>     false`. Ringee does not send a Supabase JWT — the HMAC signature is the
> authentication.

## Respond correctly

| Rule | Detail |
| - | - |
| Respond fast | Ringee aborts the request after **15 seconds**. |
| Respond `2xx` | Anything else counts as a failed delivery and is retried. |
| Do the work after | Acknowledge first, process asynchronously if your handler is slow. |
| Answer `test.ping` | Any `2xx` response succeeds; the response body is ignored. |

`200 { "received": true }` and `204 No Content` are both valid acknowledgements.

## Idempotency

The same `eventId` can arrive more than once — that is by design, not a bug.
Transport retries reuse the exact stored payload and `eventId`.

Store received events in a table with a `UNIQUE` constraint on the event id:

```sql theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
create table ringee_webhook_events (
  id                uuid primary key default gen_random_uuid(),
  event_id          text unique not null,
  event_type        text not null,
  occurred_at       timestamptz,
  payload           jsonb,
  processing_status text not null default 'pending',
  error_message     text,
  received_at       timestamptz not null default now(),
  processed_at      timestamptz
);
```

Insert the `eventId` **before** processing. If the insert conflicts, the event is a duplicate: return `200` and do nothing else.

## Retries

| Setting | Value |
| - | - |
| Max attempts | 10 |
| Backoff | Exponential from 2s, doubling per attempt |
| Backoff cap | 5 minutes |
| Request timeout | 15 seconds |

After the final attempt the delivery is marked `failed` and Ringee sends email and device push notifications to the integration owner or organization admins. Alerts are throttled per integration for six hours. Deliveries are also failed immediately if the integration has been disabled or deleted.

The queued delivery worker runs every 5 seconds and claims up to 100 due
deliveries. It sends independent deliveries in parallel, so neither the queue
cadence nor creation time establishes ordering.

> [!TIP]
>
> Inspect the delivery status, cumulative attempt count and last error in the
> dashboard, or via `GET /api/integrations/custom/:id/outbound-logs`. See [Logs
> and errors](https://docs.ringee.io/api/logs-and-errors.md).

## Event ordering

Deliveries are independent rows sent in parallel waves — **order is not guaranteed**.

Design for this:

* `call.outcome.updated` can arrive before `call.completed`. Upsert the activity by `callId` from either event.
* `call.outcome.updated` includes `data.call` when the telephony row can still be resolved, so it can create or update the activity by itself.
* `recording.ready` can arrive seconds or minutes after the call ended.
* `meeting.created` and `call.outcome.updated` both fire when an outcome is `meeting_booked`.
* A subscribed AI Voice Agent call can produce `call.completed` or `call.failed`, then `call.outcome.updated`, and later callback, meeting or recording events. Do not wait for a fixed sequence.

## Next steps

> [card] [Event reference](https://docs.ringee.io/api/events-reference.md)
>
> Every outbound payload, field by field

> [card] [Build an integration](https://docs.ringee.io/api/build-an-integration.md)
>
> Mapping, loop prevention and a test checklist


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