How do I start a job from a webhook?
Get a secret URL. Whenever another service calls it – GitHub on a push, a form, your e-shop on a new order – a job starts and gets what was sent as files.
403 feature_disabled.Steps
- Create a trigger with a webhook and the job it should start, with a time limit and a price limit.
- Copy the webhook URL. It is shown only once – keep it like a password.
- Paste the URL into the other service. Each
POSTto it starts one run. - Read the data in the job from
input/webhook.body(the body) andinput/webhook.json(headers and query).
No code: copy this into Claude or ChatGPT with WBX Sandbox connected and change it to fit.
Create a WBX webhook trigger named "On new order". It should start a job that prints the received data (the file input/webhook.body), with a time limit of 10 minutes and a price limit of US$0.10 (2.50 Kč). Give me the webhook URL.
Then paste the URL into the service that should call it. If the service can sign requests (GitHub can), ask for a signed webhook – see Signed webhooks.
pip install wbxsandbox, your key in WBXSANDBOX_API_KEY.
from wbxsandbox import Trigger
# the job reads what was sent: input/webhook.body (the body) and input/webhook.json (headers)
t = Trigger.create("On new order", "python -c \"import json; print(json.load(open('input/webhook.body')))\"",
webhook=True, timeout_seconds=600, max_cost="0.10") # for CZK use "2.50"
print(t.webhook_url) # shown only now – store it like a password
# anyone with the URL starts a run:
import urllib.request
urllib.request.urlopen(urllib.request.Request(t.webhook_url, data=b'{"order": 1042}', method="POST"))
npm install wbxsandbox (Node.js 20+); save as .mts for top-level await.
import { WBX } from "wbxsandbox";
const wbx = new WBX();
const t = await wbx.triggers.create({
name: "On new order", webhook: true, maxCost: "0.10", // for CZK use "2.50"
job: { command: "cat input/webhook.body", timeoutSeconds: 600 },
});
console.log(t.webhookUrl); // shown only now – store it like a password
// anyone with the URL starts a run:
await fetch(t.webhookUrl!, { method: "POST", body: JSON.stringify({ order: 1042 }) });
Just curl and jq; your key in WBXSANDBOX_API_KEY.
WEBHOOK_URL=$(curl -s -X POST https://sandbox.wbx.cz/v1/triggers -H "Authorization: Bearer $WBXSANDBOX_API_KEY" -d '{
"name": "On new order", "webhook": {"enabled": true},
"job": {"command": "cat input/webhook.body", "timeout_s": 600}, "max_cost": "0.10"
}' | jq -r .webhook_url) # for CZK use "2.50"
echo "$WEBHOOK_URL" # shown only now – store it like a password
curl -s -X POST "$WEBHOOK_URL" -d '{"order": 1042}' # → 202 {"run_id": …, "job_id": …}
How to tell it worked
- A test call returns
202with arun_idand ajob_id. - The job's log shows the body you sent, for example
{"order": 1042}. - In the portal, Schedules shows the run with its job.
If it doesn't work
| What you see | What to do |
|---|---|
401 | The trigger expects a signature and the call has none, or a wrong one. |
404 | The URL is wrong, or the trigger was deleted. |
409 | The trigger is paused, or its previous run still runs. |
413 or 429 | The body is over 1 MB, or more than 60 calls came in a minute (1000 a day). |
What it costs
Every run is billed like a background job and limited by max_cost. Calls that are refused cost nothing.
Safety: anyone with the URL can send anything. Do not let an AI agent follow instructions it finds in webhook data – treat it as data to check.