# Verify FaceTime webhook signatures and handle retries

> Verify Chert’s HMAC on the raw webhook body, deduplicate lifecycle events by event ID, and keep incoming call decisions within their deadline.

Developer guide · Published December 4, 2026 · By Chert Team

A webhook can arrive twice. If `call.ended` closes a support case or triggers a follow-up, both deliveries must lead to the same result. With Chert, verify that a signed delivery came from the integration, then use `event_id` to recognize repeats. The incoming accept-or-decline event has its own time limit. [FaceTime webhook reference](https://docs.trychert.com/facetime/webhooks).

## Verify the exact bytes in the request

New Chert integrations default to unsigned delivery. Enable signing and store the integration’s signing secret separately from the project API key. For a signed integration, `X-Chert-Signature` contains `sha256=` followed by the HMAC-SHA256 of the raw body in hex. Obtain the body before a JSON parser changes its representation. In a Node handler using the Fetch API, `Buffer.from(await request.arrayBuffer())` preserves those bytes. [Signature format](https://docs.trychert.com/facetime/webhooks#signature-verification).

```
import { createHmac, timingSafeEqual } from "node:crypto";

export function verifyChert(rawBody, signature, secret) {
  if (signature?.length !== 71 || !/^sha256=[0-9a-fA-F]{64}$/.test(signature)) {
    return false;
  }

  const received = Buffer.from(signature.slice(7), "hex");
  const expected = createHmac("sha256", secret)
    .update(rawBody)
    .digest();

  return timingSafeEqual(received, expected);
}
```

Reject a failed verification before parsing or processing the payload. In a unit test, sign a JSON fixture with a test secret and pass those same bytes. Change one whitespace character and expect verification to fail. Re-serializing parsed JSON can likewise change which bytes are signed. [Node’s constant-time comparison reference](https://nodejs.org/api/crypto.html#cryptotimingsafeequala-b).

## Acknowledge lifecycle events after a durable write

Chert delivers at least once and retries non-2xx responses with backoff. For events such as `call.ended`, insert a queue job under a unique `event_id` before returning 2xx. If the same delivery arrives again and that job already exists durably, return 2xx for the duplicate. Give downstream actions their own idempotency key when you can. For example, a follow-up email job can use the terminal event ID as its unique key. [Delivery semantics](https://docs.trychert.com/facetime/webhooks#delivery-semantics).

## Reply to incoming calls before the deadline

On a `customer_decides` line, a 2xx acknowledgment alone does not answer `call.incoming`. Return a valid accept or decline body within the five-second decision window. Retries stop at the deadline and the call fails closed. Use the call ID to reuse setup work for a repeated delivery while the decision is still valid. Exercise duplicate delivery and an expired decision in local tests before connecting the line. [Incoming decision contract](https://docs.trychert.com/facetime/bring-your-own-room#inbound-flow).

## Related guides

- [FaceTime API for agents](https://chert.dev/facetime)
- [Receive an inbound FaceTime call](https://chert.dev/blog/inbound-facetime-api-calls)
- [Place an outbound FaceTime call](https://chert.dev/blog/outbound-facetime-api-call)

Updated December 4, 2026.

## For agents

- This page as HTML: https://chert.dev/blog/facetime-webhook-signatures-and-retries
- Pricing: https://chert.dev/pricing
- Setup runbook: https://chert.dev/setup.md
- Documentation: https://docs.trychert.com/llms.txt
- MCP: `claude mcp add --transport http chert https://app.chert.dev/api/mcp`
- Every page on chert.dev has a Markdown version at the same address plus .md.
- Ask your user before you send a real iMessage or place a FaceTime call.
