Set up a webhook
Open an assistant. In General, under Abilities, open Webhooks and select Add webhook.- When it runs: At the start, During the conversation or At the end. Changing it clears the settings the new mode does not use, and drops the default body of an at-the-end webhook if you have not edited it. A variable your own text uses that the new mode cannot offer stays where it is and is flagged in the editor and when you save, until you remove it.
- Schedule: when the webhook may run (see Opening hours).
- Name: what the assistant sees as the function it can call.
- When should the assistant use it? (during only): tell the assistant which customer question triggers the request and what it must ask first.
- Method and URL: the URL starts with
https://, for examplehttps://api.example.com/orders/{{orderId}}. - Authentication: None, API key, Bearer token, Username and password or Custom header. Use it for the main credential. To read data from Supabase, see Connect Supabase; for n8n, see n8n; for Make, Zapier, Lovable or any other URL, see Connect any service.
- Headers: any other headers your API needs. Each header has a lock: a locked header is secret. A plain header is stored and shown as typed. A secret header is saved encrypted and never shown again: the console shows it as saved, and typing replaces it. It is sent exactly as typed, so variables are not filled in and
{{is refused. A header whose name looks like a credential, such asAuthorization,Cookie,X-API-Keyor any name with a word like key, token, secret, auth, password or signature (for exampleX-Webhook-Key), must be secret, so the console locks it. Names likeIdempotency-Keyare not affected. A secret header cannot repeat the name of a plain header or of the header sent by Authentication. Renaming a saved secret header, or unlocking it, means typing the value again. If your server echoes a secret header value of 8 characters or more in its response, Klatt replaces it with[redacted]before the assistant or Test request sees it. - Body: for methods other than GET, a JSON object.
- Maximum wait: how long Klatt waits for your server. Up to 30 seconds, and up to 5 seconds at the start.
At the start
Use it to give the assistant facts about the customer before it speaks, for example data from your CRM.- On voice, the request starts when the call starts and never delays the greeting or the answer to the call. The assistant’s first reply waits for it, for up to 5 seconds. On WhatsApp it runs before the first reply of a new conversation, once per conversation.
- Several webhooks at the start run at the same time under that single 5-second limit.
- The answer is added to the assistant’s instructions under the webhook’s name, as untrusted data cut to about 2,000 tokens. It is never read as instructions.
- If your server fails, answers with an error or is too slow, the conversation goes on without that data and the assistant is told it is not available.
- It has no data the assistant asks for, no caller verification and no write policy: it can only use conversation values and fixed data.
- The caller’s number can be spoofed. Do not load personal data keyed only by
personNumber.
During the conversation
The assistant decides when to call your API and fills in the Data the assistant asks for.- Repeat identical results (reads only): when the assistant asks for the same thing again, Klatt reuses the earlier successful answer instead of calling again. On voice this holds for the whole call; on WhatsApp, while answering one customer message. Errors and requests that change data are never reused. Turn it off to always call.
- What it says while it waits (voice, reads only): a fixed sentence the assistant says while the request runs. Leave it empty so the assistant says it in its own words.
- Test values for the data the assistant asks for are only used by Test request.
At the end
Klatt sends the request after the conversation, with its summary, so your system can record or follow up on it.- When it is sent: as soon as the conversation’s analysis has finished, or 10 minutes after it ended if the analysis is still not ready (then
summaryis empty). Requests can arrive in a different order from the one in which the conversations ended, so order them bystartTimestamp(or your own timestamps) in your system. It applies to real calls and to WhatsApp conversations once they close, which happens 24 hours after the customer’s last message. Test calls from the console never send it, and a webhook only sends for conversations that ended after you created it. - Only if… (optional): a condition in plain language, for example “the customer wants to rent a unit”. Klatt checks it against the summary and transcript. When it is not met the request is not sent. If the transcript exists but cannot be read yet, Klatt tries again every few minutes for up to 23 hours after the conversation ended. If it still cannot be checked, the request is not sent. Leave it empty to always send.
- Method and body: a new webhook starts as a
POSTwith the body below. Edit it freely. - Delivery: at least once. Klatt sends an
Idempotency-Keyheader that is the same on every attempt of the same delivery. If your server does not answer, times out, answers 429 or a 5xx error, Klatt retries after 1, 5 and 15 minutes, then every hour, for up to 24 hours after the conversation ended. Any other 4xx error is not retried. - Test request uses an example conversation, so you can see what your system receives. The values are shown in the sheet and you can change them.
- Signing secret (optional, in Advanced): Klatt signs each request so your system can check that it came from Klatt and was not changed. See Signature.
{{name}} is replaced when it is sent. A value that is exactly one variable keeps its type, so durationSeconds arrives as a number; a value that is missing arrives as null. The transcript is not in the default body: add it only if your system needs it. formattedTranscript is cut to about 60,000 characters (keeping the start and the end); plainTranscript is sent whole. If the transcript exists but cannot be read yet, Klatt waits and retries instead of sending the request without it. If there is none (the call was not recorded, or the chat has no messages Klatt could save), the request is sent with an empty transcript.
Captured data
If the assistant captures data, the request can carry what Klatt captured from the conversation, such as an amount or a date. In Abilities, open Capture data and add up to 20 fields. Each has a name, a type and a description of what to look for.{{outcome.promised_amount}}is one field;promised_amountis its variable, shown under the field’s name. A value that is exactly one variable keeps its type in the JSON body: a number arrives as1200, a yes or no astrueorfalse, and a date as"2026-11-06".{{outcome}}is an object with all the fields.- A field Klatt did not find in the conversation arrives as
null. Klatt leaves a field empty rather than guess, so your system must acceptnullfor every field. - You can use them in the URL and in the body, not in headers. Saving a webhook with a variable that is not one of the assistant’s fields fails.
- If the analysis did not finish within 10 minutes or failed,
{{outcome}}is{}and every{{outcome.<key>}}isnull. In the URL, a missing value means the request is not sent (see Variables). - The values are fixed when the request is queued, so a retry sends the same values.
Receiving the request
- Check that the request comes from Klatt. Verify its signature, or add a secret in Authentication (for example a bearer token or an API key), and reject requests that fail the check. A signature also proves that the body was not changed and that the request is not an old one sent again.
- Treat
Idempotency-Keyas a deduplication key: if you receive the same key twice, process it once. - Requests carry
User-Agent: Klatt-Webhooks/1.0 (+https://klatt.ai)unless you set your ownUser-Agentheader. It identifies the sender but proves nothing: anyone can send it, so keep checking the secret. - Reply with a
2xxstatus as soon as you have the request, and do the work afterwards. Klatt only keeps the status code, never your response body.
Build a receiver for end-of-conversation webhooks
Signature
A webhook at the end can be signed with the Standard Webhooks format. Webhooks at the start and during the conversation are not signed.- In Advanced, under Signing secret, select Generate secret.
- Copy the secret. It starts with
whsec_and is shown only once: you cannot save until you copy it. Store it on your server, for example asKLATT_SIGNING_SECRET. - Save the webhook.
Every attempt, retries included, is signed again with a new timestamp.
To verify a request, use a Standard Webhooks library. There are libraries for JavaScript, Python, Go, Java, Ruby, Rust, C#, PHP and Elixir. Pass the body exactly as received, before any JSON parsing:
- Take the body exactly as received. Parsing it and serializing it again changes the bytes and breaks the signature.
- Build the text
webhook-id, a dot,webhook-timestamp, a dot, then the body. - Remove
whsec_from the secret and decode the rest from base64. That is the key. - Compute an HMAC-SHA256 of that text with the key and encode it in base64.
- Compare it with each
v1,value inwebhook-signature(values are separated by spaces) using a constant-time comparison. - Reject the request if
webhook-timestampis more than 5 minutes away from your clock. Keep your server’s clock synchronized. - Process each
webhook-idonce: a valid request can arrive more than once.
webhook-id starts with test_ and it carries X-Klatt-Test: 1. Anyone who can edit the webhook in your workspace can send a test, so ignore test_ ids in production.
Personal data
The summary, the caller’s number, the contact data and the transcript are personal data. Sending them to your system makes your system a recipient under your data processing agreement with Klatt. Transcripts and the summary are only sent if your body includesplainTranscript, formattedTranscript or summary. Contact data is only sent if your URL, headers or body include a contact. variable.
Variables
Write{{name}} in the URL, headers and body, or choose Add variable. Variables do not work in secret headers. The menu only offers what the mode can use.
- Data the assistant asks for (during only): values the assistant collects from the customer. Give each a name, a type, a description and a test value.
- Fixed data: values always sent without the assistant asking, such as your company id. Use them for a secret your system checks.
- Conversation values: filled in by Klatt, in every mode.
- Contact data: the name, company and notes of the person in your contact list, and the smart fields of the assistant’s contact list. Klatt finds the contact by phone number. See Contact data.
At the end, these are added:
Values placed in the URL path or query are encoded for you. The server name and port cannot be variables. If a value is missing in the URL or in a header, Klatt does not send the request; in the JSON body a missing value is sent as
null (or as empty text inside a longer string).
Contact data
If the assistant has a contact list, you can send what it knows about the contact. Choose Add variable and look under Contact, or write the variable yourself. It works in every mode.
Klatt only offers the fields the assistant may use, chosen in the assistant’s Connect contacts ability. An assistant without a contact list offers none.
- On incoming calls the variables are always empty, because a caller’s number can be spoofed. Use
personNumberfor what you can verify yourself. - They are also empty when the number is not in the list, when the field has no value, and in the console’s test call and test chat, which have no number. A landline only finds its contact when Also match by landline number is on in Connect contacts.
- An empty contact variable follows the same rule as any missing value: a URL or header stops the request, and the JSON body gets
null. - A smart field keeps its type when the variable is the whole value in the body: a number stays a number, and true or false stays true or false.
- Test request sends an example value for each contact variable, shown next to it. You can change it like any other test value.
- Contact data is personal data. See Personal data.
Opening hours
Schedule decides when a webhook may run:- Always
- Only during opening hours
- Only outside opening hours
Test the request
Select Test request to run it once with your test values. Testing sends the request for real to your system, so a POST, PUT, PATCH or DELETE changes data there. The request carries the headerX-Klatt-Test: 1, and a webhook at the end with a signing secret is signed.
The result opens above the buttons with a sentence and the time taken, for example “Works: found 3 results” when the answer is a list. Press Show response to read what the server sent, and Copy to copy it. Close the result with the X. If something fails, the message comes with what to do and a button that takes you to the field, such as Go to Authentication when the server rejects the credentials:
See what was sent
In Conversations, the details of a call or a WhatsApp conversation show one line per webhook at the end, for exampleWebhook "Name": delivered (200) · 2 attempts. A line can also say that it was not delivered and why, that it is waiting to be delivered, or that it was skipped because the Only if… condition was not met or could not be checked, or because it was outside its schedule. Nothing is shown when the assistant has no webhooks at the end. The line never includes your URL or the data sent.
Limits
- Only public HTTPS addresses on port 443. Private or local addresses and redirects are not followed.
- The maximum wait is 30 seconds, and 5 seconds at the start.
- Up to 3 webhooks at the start and 5 at the end per assistant.
- Klatt downloads up to 512 KB of a response. During the conversation the assistant reads about the first 16,000 characters; at the start, about 2,000 tokens.
- At the end, delivery is retried for up to 24 hours after the conversation ended.
Safety
- The response of your API is treated as data, never as instructions for the assistant.
- On voice, a GET during the conversation runs without caller verification. Anyone who calls can get what the API returns, so do not expose personal data this way unless you add caller verification in Advanced.
- On voice, a request that changes data (POST, PUT, PATCH, DELETE) during the conversation needs caller verification and the customer’s spoken confirmation.
- On WhatsApp, anyone who writes to the number can get what a GET returns, so do not use it for personal data. For a request that changes data during the conversation, the assistant asks the customer to confirm, and sends it once after the customer agrees in their next message.
- If Klatt cannot tell whether a request worked, the assistant says the result is unknown instead of saying it is done.