Webhook
Send answers to a Smart Form from any system that can make a web request.
A webhook source gives your form an address. Anything sent to it with the right secret becomes an answer.
Set it up
- Open the form, go to Sources, and pick Webhook (or Other apps). Press Set up.
- Copy the address under Send data to. Press Show beside Secret and copy the secret.
- Put both in the system that will send the data.
- Press Listen for test data, then send one test from that system.
- Match the names that came in to your questions (Let Sarä suggest helps), choose how the same person is spotted, and press Save matching.
From then on, each delivery becomes an answer.
Sending
Send a POST request to the source's address:
https:///api/method/hros.hros.api.smart_form_sources.receive?key=<source>
The secret
Send the secret in one of these ways:
| Way | Example |
|---|---|
| Header (best) | X-Sara-Secret: |
| Bearer header | Authorization: Bearer |
| On the address, for apps that cannot set headers | …receive?key=<source>&secret= |
| Signed body | X-Sara-Signature: sha256= (X-Hub-Signature-256 works too) |
A delivery without the right secret is refused with 401 and logged as Rejected.
The body
- JSON (
Content-Type: application/json) or form data (key=value&key2=value2). - Names can be anything — you match them to your questions once.
- Nested JSON is read with dots:
{"contact": {"email": "a@b.co"}}arrives ascontact.email. - A list of plain values is joined:
["Excel", "CRM"]becomesExcel, CRM. - A list of objects is numbered:
items.0.name,items.1.name… - If the body is a list, its first object is used.
- Up to 256 KB per delivery.
Example
curl -X POST 'https:///api/method/hros.hros.api.smart_form_sources.receive?key=<source>' \
-H 'Content-Type: application/json' \
-H 'X-Sara-Secret: ' \
-d '{"name": "Aisyah", "email": "aisyah@example.com", "team": "Finance", "start": "2026-12-01"}'
How values are read
| Question type | What to send |
|---|---|
| Dropdown, Radio | One of the question's options, written the same way |
| Multi select, Checklist | A JSON list (["A", "B"]) or the options separated by commas |
| Checkbox | true, yes, 1 or on for ticked; anything else is not ticked |
| Date | A date, e.g. 2026-12-01 |
| Everything else | Text as it is |
Replies
| Code | Message | Meaning |
|---|---|---|
202 | Received. | Taken; the answer is made within a few seconds |
200 | Test data received. | Kept as the test data (listening, or nothing matched yet) |
400 | Send JSON or form data. | The body could not be read |
401 | Unauthorized. | Wrong or missing secret, or an unknown address |
403 | This source is switched off. | Switch it on in Sources |
413 | Body too large. | Over 256 KB |
429 | Too many requests. | More than 120 deliveries a minute to one source |
Keeping it safe
- Keep the secret private. Anyone with it can send answers to the form.
- If it gets out, press New secret. The old one stops working at once; put the new one in your system.
- Switch the source off to stop it taking deliveries, without losing its matching.