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"
}
}eventiscall_history.created,call_history.updatedorcall_history.deleted, or one of the call events below.changedlists what changed on an update:recording,voicemail,videocall,call.status,call.duration,call.response_time,transcriptorsummary. It's empty for created and deleted events.datais the call history record, includingcallId. A deleted event carries the record as it was before it was removed.data.typeiscall,recording,voicemailorvideocall, and it can change. When a recording is attached, the record becomesrecording; when the recording expires, it goes back tocall.Video meetings have no
callsection, 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, somedia_idsstarts empty. Each recording follows once it's stored, as acall_history.updatedwithvideocallinchanged. 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,
datacarries the summary text and ahasTranscriptflag. 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.updatedthat lists them all inchanged. A record removed before its created event went out isn't sent at all. Useevent_idto 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 theX-Olatti-Timestampheader.occurred_atis when Olatti recorded the change, and it stays the same on every retry. For each record (data._id), keep the event with the latestoccurred_atand ignore older ones that turn up afterwards.Voicemails arrive in two steps. The first event arrives before the audio is stored, so its
media_idisnull. An update withchanged: ["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.dataholdscallId,accountId,userId,startedAtand acallsection withdirection,user_number,user_name,companion_numberandcompanion_name.call.ended, a few seconds after the user's last device on the call hangs up.datais 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, sodata.typemay already berecordingorvoicemail, with itsmedia_id. A call whose record is already a recording or voicemail when it's first written gets nocall.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:
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);
});import hashlib, hmac, os, time
from flask import Flask, request, abort
app = Flask(__name__)
SECRET = os.environ["OLATTI_WEBHOOK_SECRET"].encode()
TOLERANCE_MS = 5 * 60 * 1000
@app.post("/olatti-webhook")
def olatti_webhook():
raw_body = request.get_data() # the raw bytes, before any JSON parsing
timestamp = request.headers.get("X-Olatti-Timestamp", "")
signature = request.headers.get("X-Olatti-Signature", "")
expected = "sha256=" + hmac.new(
SECRET, timestamp.encode() + b"." + raw_body, hashlib.sha256
).hexdigest()
fresh = timestamp.isdigit() and abs(time.time() * 1000 - int(timestamp)) <= TOLERANCE_MS
if not hmac.compare_digest(signature, expected) or not fresh:
abort(401)
event = request.get_json()
# Store the event, answer straight away, and do the real work afterwards.
return "", 200Four 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
timingSafeEqualorcompare_digest, never==.Reject old timestamps.
X-Olatti-Timestampis 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.
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.
Click Settings, then under Admin settings click Integrations.
On the API Keys card, click Configure.
Click Create key.
Enter a Key name, such as the name of the integration, and click Create key.
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 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.

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_…Each key can make up to 120 requests a minute. Fetch audio after you've answered the webhook, not while Olatti is waiting.
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.
Update your receiver to accept a signature made with either the old secret or the new one.
In Olatti, open the webhook Settings, click Replace secret, then Generate, Copy secret and Save.
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
Was this helpful?
More in Integrations
Connect Olatti to Claude and ChatGPTIntegrations: what connects to Olatti todayStill need help? Ask the team