Webhooks: setup and what Browsermatic sends
For the person setting up the app, and whoever builds the receiving end: an n8n workflow, a Zapier Zap, a Make scenario, or your own server.
Set it up in the app
- Ask whoever manages the receiving workflow for its production webhook address. Decide whether it needs the file or only the document's details. Documents and their names can contain customers' personal details; choose the destination with that in mind.
- Open Settings › Webhooks › Add webhook. Enter a name and the address. Leave Send the document itself on only when the receiver needs the file.
- If the receiver checks a secret header, open Advanced and enter the matching Header name and Header value. The receiver must refuse a missing or wrong value.
- Use Send a test and check the receiving workflow. This sends a made-up test document when file sending is on. It is a single request, outside History and automatic retries.
- Choose the destination in the document rule's Advanced › Also do. It works with a print rule or a save-only rule. Adding a webhook alone does not attach it to a rule.
- Catch a real document from your website and check its separate webhook card in History. Printing and sending run separately, so a server problem doesn't hold up a label.
The app sends a caught document, not a notice that it printed. A successful response says only that the receiving endpoint accepted it; check the email, file or other work at that end. One rule chooses one webhook.
The request
One POST per caught document, as multipart/form-data with a Content-Length (never chunked).
| Header | Value |
|---|---|
X-Browsermatic-Event | document.captured, or test for Send a test |
X-Browsermatic-Delivery | An id for this delivery. The same on every retry of it |
User-Agent | Browsermatic/<version> |
| Your own header | Only if one is set on the webhook, for example X-Api-Key: … |
Form fields. Every value is text.
| Field | Example | Notes |
|---|---|---|
event | document.captured | |
id | 8a3b599a-36e2-460e-a8a3-7a7b7b6e92d5 | The delivery id again |
time | 2026-11-15T03:30:47.120Z | When the document was caught, UTC |
name | box-labels-12345.pdf | The file name the site gave it |
site | https://shop.example.com | The site it came from. Never the full page address |
type | application/pdf | |
size | 20480 | Bytes |
pages | 2 | 0 when not known |
width_mm, height_mm | 100, 150 | First page; 0 when not known |
sha256 | 62cca6… | Of the file. Absent when not known |
rule | Filename contains “box-contents” | The rule that matched. Absent in a test |
action | print or save | What the rule does with the document besides sending it |
printer | Packing bench printer | Only when the rule prints |
device | Packing bench tablet | "Name of this device" in Settings › Webhooks, else the model |
app_version | 0.9.0 | |
data | {"event":"document.captured",…} | All of the above again as one JSON object, with the numbers as numbers |
file | the document | A file part, with the document's name and type. Absent when the webhook has "Send the document itself" off |
The request is sent when the rule matches, at the same moment the label goes to the printer. It does not say whether the label printed.
What to answer
Any 2xx means delivered. The app keeps the first 500 characters of the answer and shows them in History. It waits 60 seconds for an answer.
| Answer | What the app does |
|---|---|
2xx | Delivered |
No connection, timeout, 408, 429, 5xx | Tries again after 30 seconds, 2 minutes, 10 minutes, then hourly, for 24 hours |
Any other 4xx | Stops at once and shows the status in History |
3xx | Not followed. Stops, and says the address has moved |
A delivery can arrive twice: if the connection drops after your server has the document, the app cannot know, and sends it again. Use the delivery id to drop repeats. "Send again" in History is a new delivery with a new id.
Where the app will send
https:// to anywhere. Plain http:// only to an address on the local network (for example http://192.168.1.20:5678/…), for a server running in the building. A certificate that doesn't check out fails the delivery.
n8n
- Add a Webhook node. HTTP Method
POST. Leave "Field Name for Binary Data" unset. - Copy its Production URL into the app, and publish (activate) the workflow. The Test URL only works for one call after pressing "Listen for test event".
- The fields arrive as
{{ $json.body.name }},{{ $json.body.site }}and so on. The document is the binary propertyfile. The headers are in$json.headers, in lower case. - To require a secret: Authentication › Header Auth, with a header name and value of your choosing, and the same two in the app under the webhook's Advanced. n8n answers
403when they do not match. - To drop repeats: a Remove Duplicates node straight after the Webhook node, "Remove Items Processed in Previous Executions", on
{{ $json.headers['x-browsermatic-delivery'] }}.
We have a starter n8n workflow (email-a-document.json — email support@browsermatic.app for a copy): import it, give the Send Email node an SMTP account and real addresses, and each document arrives as an email attachment. It names the binary attachment property file. Check that option against the version you run. The starter is inactive, uses authentication: none, and has no repeat filter. Before publishing, configure Header Auth, add a durable repeat check using the delivery id, and set real SMTP credentials and addresses. It is a starting point to adapt, not a finished workflow.
What the app shows for n8n's usual answers: 404 means the workflow is not published or the address is the test one; 403 means the header does not match; on n8n Cloud a workflow that answers "when last node finishes" and takes over 100 seconds fails with 524, so answer immediately.
Limits at the receiving end
The request includes fields and multipart overhead as well as the file. Test the largest actual document you expect to send. The app's 50 MB document limit is not a service limit.
| Receiver | Published limit or setting | What to check |
|---|---|---|
| n8n | The general webhook limit is 16 MiB by default. Self-hosted form-data files have a separate default of 200 MiB, set by N8N_FORMDATA_FILE_SIZE_MAX | Hosting plan, installed version, proxy limits and your actual multipart upload. Limits vary between n8n Cloud and self-hosted setups, so test with a real file |
| Zapier Catch Hook | 10 MB for the whole request; Catch Raw Hook is 2 MB | Prefer details only until file handling is verified on a live Zap |
| Make Custom webhook | 5 MB (5,242,880 bytes), including the whole request | Prefer details only; multipart files need a matching file collection in the data structure |
| Your own server | Whatever the server, proxy and storage allow | Parse multipart form-data, enforce authentication and limits, and return promptly |
Sources: n8n endpoint settings, Zapier webhook triggers, Make Webhooks.
Secrets, repeats and where documents go
The optional header is a shared secret, not a signature of the request. HTTPS protects the connection; local HTTP does not encrypt the secret or file. The value stays in the app's own storage and is copied in a setup code. Treat that code as a secret too. Imported webhooks stay off until the person enables them.
Anyone who learns an unprotected webhook address can send it made-up requests. Require a secret at the receiver, replace an address or secret that leaks, and keep both out of support reports and screenshots.
Use X-Browsermatic-Delivery to record and reject repeats before sending an email or doing other work.
Browsermatic sends directly to the address you choose, not through a Browsermatic server. You decide where your customers' details go.
Test it
Use sample documents and your own receiving workflow.
- Send a test: confirm the endpoint accepts it, the fields arrive, and the file arrives only when Send the document itself is on. Test details-only mode too.
- A real document: choose the webhook on a rule, catch a document from the intended site, and check its name, origin, file, pages and final email or stored copy at the receiving end. Confirm the independent print outcome in History.
- A wrong secret: change the app's header to a wrong value, then omit it. Both requests must be refused by the receiver, with no email or other downstream work. Restore it and test again.
- Server off: stop your test receiver, catch another document and confirm printing continues while the webhook card waits and gives a retry time. Restore the server and confirm delivery.
- A repeat: simulate a lost response after acceptance. The retry has the same delivery id; the receiving workflow must not email or file it twice. Send again deliberately has a new id.
- Largest expected file: verify the whole request fits the service and proxy limits.
- Failure handling: check a refused request and a moved address are visible in History. Do not put passwords or document contents in the receiver's error response: its first 500 characters can appear in History.
If something goes wrong later
The messages below are from the app. Names and hosts vary with your setup.
| What the app says or what happens | Likely cause | Do this |
|---|---|---|
| No webhook card for the document | No webhook on the matching rule, destination off, or an Ignore rule | Check Settings › Webhooks and the rule's Advanced › Also do. Imported webhooks start off |
| "Waiting to send" with a retry time | No connection, timeout, 408, 429 or 5xx | Read the reason in History. Check the receiver, network and service limits. Automatic deliveries retry for up to 24 hours; Send a test does not |
"the server refused the request (401)" or (403) | Authentication did not pass | Check the receiver's authentication and the app's header name and value, then Send a test and Send again |
| "the server does not know this address (404)" | Wrong address or workflow off | Check the production address and publish the workflow. An n8n Test URL is temporary |
| "the server said the document is too large (413)" | Receiver or proxy limit | Reduce the file, change the receiver's limit, or send details only; then Send again |
| "the address has moved" | A 3xx redirect | Enter the final address. The app does not follow redirects |
| A connection or certificate error | Wrong host, receiver offline, or certificate not trusted | Correct the address, network or server certificate. There is no certificate-error bypass |
| "is no longer kept on the phone" | The retained file was deleted | The app cannot resend that file. Check Downloads or obtain it from the site again |
| History says sent, but no email or stored file | Receiver accepted the request but its later work failed | Check the receiving service's execution log. A 2xx confirms acceptance, not the later work |
| The recipient got two copies | Retry or a manual Send again ran the workflow again | Deduplicate by delivery id. Send again uses a new id and never prints again |