Webhooks
Fire an automation from your system, and call your system when something happens in Flito.
Receive: a webhook that runs an automation
Any system that can post JSON can run a Flito automation: a website form, a payment provider, a warehouse system, a script.
Get the URL
- In the app, open Automations and make an automation with the trigger Webhook received.
- In its Webhook panel, choose Generate webhook URL. The URL is shown once: copy it.
- Add the steps, using fields from the posted JSON as
{{trigger.body.*}}. See Automations. - Switch the automation on.
The URL looks like $FLITO_URL/hooks/whk_…. Anyone who has it can run the automation, so keep it on your server where you can; a form on a public page shows it to every visitor.
A new URL does not turn the old one off
Generating another URL adds a second one, and both work. If a URL leaks, pause the automation and make a new one with a new URL.
Call it
curl -s "$FLITO_URL/hooks/whk_…" \
-H "Content-Type: application/json" \
-H "X-Idempotency-Key: order-1042" \
-d '{"name": "Ada Lovelace", "email": "ada@acme.com", "company": "Acme", "message": "Please call me"}'- No API key: the URL itself is the secret.
- Send
X-Idempotency-Keyto make retries safe. A key seen before answers200with"fired": falseand"status": "skipped". - Browsers may call it: it answers cross-site requests from any page.
- A body that is not JSON is read as
{}.
Answers
200{"ok": true, "runId": "…", "status": "…", "fired": true}: the automation ran.200with nothing run: the automation is paused.404{"error": "unknown or disabled webhook"}: the URL is wrong or turned off.400{"error": "…"}: the automation could not start.
Send: calling your system
Flito does not yet send a webhook for every change. Instead, an automation calls your system with an http.request step, so you choose what to send, when, and in what shape:
{
"id": "notify",
"type": "action",
"capabilityId": "http.request",
"input": {
"method": "POST",
"url": "https://api.yourcompany.com/flito/deal-won",
"auth": { "kind": "bearer", "token": "…" },
"body": { "dealId": "{{record.id}}", "name": "{{record.name}}", "amount": "{{record.amount}}" }
}
}methodisGET,POST,PUT,PATCHorDELETE, withheaders,queryandbody.auth.kindisnone,bearer(withtoken),basic(withusernameandpassword) orheader(withheaderNameandtoken).- It waits up to
timeoutMs(10 seconds by default, 30 at most) and reads up tomaxBytesof the answer (1 MB by default, 5 MB at most). - Its output is
{"status", "ok", "headers", "body"}, which later steps use as{{steps.notify.output.body.*}}. - Only public
httpandhttpsaddresses: private and local addresses are refused, and redirects are not followed. - On a dry run or a preview, it is not sent.
To post a message to the team's chat instead, use a chat.notify step.
Example: tell your system when a deal is won
Make an automation on deal with a record_updated trigger, a condition that the stage is your won stage, and the http.request step above. Your endpoint gets one call per won deal.
Was this page useful?