Skip to main content
Integrations

Webhooks for developers: events, signatures and retries

What an Olatti webhook event contains, how to verify its signature, how retries, pausing and secret changes work, and how to fetch recordings and transcripts with an API key.

Written By Axel Molist

Last updated 13 days ago

This is the reference for writing your own webhook receiver: what each event contains, how to check it came from Olatti, how Olatti behaves when your receiver fails, and how to fetch recordings and transcripts with an API key. To set the webhook up, see Send your call history to another system with a webhook.

What you receive

Each event is an HTTPS POST with a JSON body like this:

{
  "event_id": "4f3c2a…",
  "event": "call_history.updated",
  "occurred_at": "2026-04-28T14:55:57.053Z",
  "changed": ["recording", "call.status"],
  "data": {
    "type": "recording",
    "…": "the call history record"
  }
}
  • event is call_history.created, call_history.updated or call_history.deleted, or one of the call events below.

  • changed lists what changed on an update: recording, voicemail, videocall, call.status, call.duration, call.response_time, transcript or summary. It's empty for created and deleted events.

  • data is the call history record, including callId. A deleted event carries the record as it was before it was removed.

  • data.type is call, recording, voicemail or videocall, and it can change. When a recording is attached, the record becomes recording; when the recording expires, it goes back to call.

  • Video meetings have no call section, so build your receiver to cope when it's missing. Each of your users who joins a meeting gets a record, sent as they join and before anything is recorded, so media_ids starts empty. Each recording follows once it's stored, as a call_history.updated with videocall in changed. Recordings belong to the account of whoever set up the meeting, so a user who joins another company's meeting gets a record without them.

  • Where your plan includes call summaries, data carries the summary text and a hasTranscript flag. Audio and the full transcript are never included. Events carry media IDs instead, and you fetch the files with the API.

Plan for three things:

  • The same call arrives more than once. It's usually sent when it's created and again as it changes. Changes made before the last update went out are combined into one call_history.updated that lists them all in changed. A record removed before its created event went out isn't sent at all. Use event_id to spot repeats.

  • Events can arrive out of order. A retried event may turn up after a later one. Put events in order with occurred_at, never by when they arrive or by the X-Olatti-Timestamp header. occurred_at is when Olatti recorded the change, and it stays the same on every retry. For each record (data._id), keep the event with the latest occurred_at and ignore older ones that turn up afterwards.

  • Voicemails arrive in two steps. The first event arrives before the audio is stored, so its media_id is null. An update with changed: ["voicemail"] follows with the ID filled in.

Call started and call ended

If the webhook sends Calls, Olatti also sends two events for every call, whatever you've chosen under Delivery events:

  • call.started, when a user's device starts ringing, or a moment after they dial, once the call has been routed. data holds callId, accountId, userId, startedAt and a call section with direction, user_number, user_name, companion_number and companion_name.

  • call.ended, a few seconds after the user's last device on the call hangs up. data is the user's call history record as it is when the event is sent, with the final status and duration. A recording or voicemail is often attached in those seconds, so data.type may already be recording or voicemail, with its media_id. A call whose record is already a recording or voicemail when it's first written gets no call.ended.

Each user on a call gets their own pair, sent within seconds rather than with the regular batch. A user whose phone and computer both ring still gets one call.started. If a call comes back to a user after their call.ended, for example when it's transferred to someone who missed it earlier, they get a second pair with the same callId.

Use callId to tie both events to the call_history events for the same call. Don't count on getting both halves of a pair. A call cut off in the first instant may send only call.ended, and a user whose phone rang while a colleague answered may get call.started with no call.ended. In rare cases callId is null; match on userId and the time instead. If your receiver only expects call_history events, make it ignore names it doesn't know.

Every event also carries these headers:

Header

Contains

X-Olatti-Event-Id

The same value as event_id

X-Olatti-Timestamp

When this attempt was sent, in milliseconds since 1970. Each retry gets a new one.

X-Olatti-Signature

sha256= followed by the signature

Content-Type is application/json, and any custom headers you set in Olatti are added too.

Verify the signature

The signature is an HMAC-SHA256 of the timestamp, a dot and the raw request body, keyed with your signing secret:

X-Olatti-Signature = "sha256=" + hex( HMAC_SHA256( secret, X-Olatti-Timestamp + "." + raw_body ) )

To check it in your receiver:

import crypto from 'crypto';
import express from 'express';

const app = express();
const SECRET = process.env.OLATTI_WEBHOOK_SECRET;
const TOLERANCE_MS = 5 * 60 * 1000;

// express.raw keeps the body exactly as sent; parsing it first would break the signature.
app.post('/olatti-webhook', express.raw({ type: 'application/json' }), (req, res) => {
  const timestamp = req.get('X-Olatti-Timestamp') ?? '';
  const signature = req.get('X-Olatti-Signature') ?? '';

  const expected = Buffer.from(
    `sha256=${crypto
      .createHmac('sha256', SECRET)
      .update(`${timestamp}.${req.body}`)
      .digest('hex')}`
  );
  const received = Buffer.from(signature);

  const signatureOk =
    received.length === expected.length && crypto.timingSafeEqual(received, expected);
  const fresh = Math.abs(Date.now() - Number(timestamp)) <= TOLERANCE_MS;

  if (!signatureOk || !fresh) return res.sendStatus(401);

  const event = JSON.parse(req.body);
  // Store the event, answer straight away, and do the real work afterwards.
  res.sendStatus(200);
});

Four rules:

  • Use the raw body. Sign the bytes exactly as they arrived. Parsing the JSON and turning it back into text can change it.

  • Compare in constant time, with timingSafeEqual or compare_digest, never ==.

  • Reject old timestamps. X-Olatti-Timestamp is when this attempt was sent, in milliseconds, and it's signed with the body. Turning away anything more than a few minutes off stops someone replaying a captured event later. Retries aren't affected, because every retry is signed again with a fresh timestamp. Keep your server clock in sync.

  • Reject unsigned requests. A missing signature is a failed signature.

How to answer

Answer fast, work later. Olatti waits 10 seconds for an answer. Save the event, answer 200, then process it in the background. Downloading a recording belongs after the answer.

Make repeats harmless. Delivery is at least once, so the same event_id can arrive twice. Skip IDs you've already stored.

Choose your status code with care.

Your receiver answers

What Olatti does

2xx

Marks the event Success

408, 429, any 5xx, no answer within 10 seconds, or no connection

Tries again later

Anything else: 400, 401, 403, 404, a redirect

Marks the event Error and pauses the webhook

Use 5xx or 429 for temporary problems, such as your database being down. Use 401 for a bad signature: if it's your secret that's wrong, the pause tells you at once.

Retries happen 1, 4, 16, 64, 256 and 1,024 minutes after each failure, about 23 hours in all. After the last one the event is marked Error, but the webhook stays on.

Retry-After. If a 408, 429 or 5xx answer carries a Retry-After header in seconds, Olatti waits that long instead of following the schedule. There's no upper limit, so a receiver that keeps sending it keeps the event pending. A date in Retry-After is ignored.

Manual retries. Retry in the delivery list sends an Error or Not sent event again, picking up the retry schedule where it left off. If that attempt gets a temporary failure and retries are left, the event goes back to Pending; if all six were used, it goes back to Error. While the webhook is paused, Retry sends nothing.

While the webhook is paused, nothing new is queued. An event waiting for a retry is marked Error if the webhook is still paused when the retry is due, and one that hadn't been sent yet is marked Not sent. Resume before then and it's sent as normal. To fill the gap, see Catch up after a pause.

Olatti keeps the first 500 characters of your receiver's answer, shown in Event details. Keep error messages short and useful.

Keep secrets out of logs. Don't log the signing secret, custom header values or full payloads anywhere they're widely read.

Fetch recordings, voicemails and transcripts

Events point at audio and transcripts rather than carrying them. To fetch those, call the Olatti API with an API key.

Create an API key

You need to be an admin.

  1. Click Settings, then under Admin settings click Integrations.

  2. On the API Keys card, click Configure.

  3. Click Create key.

  4. Enter a Key name, such as the name of the integration, and click Create key.

  5. Click Copy key, save the key in your password manager, then click Done. Olatti only stores a fingerprint of it, so it's shown once and can't be viewed again.

The Create API key dialog showing a new key, with the Copy key and Done buttons

The key's card shows its name, who created it, and the start of the key (olatti_ext_…), so you can tell which key an integration is using. Every key can read your call history, recordings and transcripts.

The API Keys page with an active key: its name, who created it, the start of the key and its permissions

An account has one key at a time. Once you have one, the button in step 4 reads Replace key, with a note that the old key will stop working immediately. It does, so update your integration at the same moment. If a key leaks, or an integration no longer needs it, click the menu on the key's card, then Revoke key, and confirm with Revoke key. It stops working immediately.

Treat the key like a password. Anyone who has it can read your call history and download your recordings.

Call the API

Every request goes to https://app.olatti.com/api/external/v1, with the key as a bearer token:

GET https://app.olatti.com/api/external/v1/media/6a1f0bc6c33ab07a27c3cad4
Authorization: Bearer olatti_ext_…

Request

Returns

GET /api/external/v1/media/{id}

The file for a media_id: audio for a call or voicemail, or video for one of a meeting's media_ids. Range requests work.

GET /api/external/v1/call-history/{id}/transcript

The transcript of a recorded call, by the record's _id, once hasTranscript is true.

GET /api/external/v1/call-history

Your call history. Narrow it with from and to (ISO 8601 dates), type, and limit (up to 200). Pass data.nextCursor back as cursor for the next page; null means the last one.

Each key can make up to 120 requests a minute. Fetch audio after you've answered the webhook, not while Olatti is waiting.

The API answers

It means

401

The key is missing, wrong or revoked. There's no further detail, on purpose.

403 on a transcript

Call transcription isn't on for your account.

404

The file or transcript has passed its retention period, or the ID isn't one from your call history. Don't retry.

Catch up after a pause

Nothing is queued while the webhook is paused. Once your receiver is fixed and the webhook is back on, read the calls you missed from /call-history, using from and to to cover the gap.

Change your secret without a gap

A new secret signs events the moment you save, including retries of older events.

  1. Update your receiver to accept a signature made with either the old secret or the new one.

  2. In Olatti, open the webhook Settings, click Replace secret, then Generate, Copy secret and Save.

  3. Once events signed with the new secret are arriving, remove the old one from your receiver.

If your receiver can only hold one secret, change both sides together at a quiet time. Anything rejected in between pauses the webhook; click Resume, then Retry those events.

Related

  • Send your call history to another system with a webhook

  • Integrations: what connects to Olatti today