Create tasks via webhook
Every automation has a webhook URL. A POST to it creates a board task, and optionally starts it, using the repository, branch, harness, owner and run mode configured on the automation. This page is the full contract for callers.
The request body only carries what to do: a description and optional files. Where and how — repo, branch, harness, machine, owner, on-receive behaviour and run mode — always come from the automation's settings and can't be overridden per request.
Endpoint
POST /webhooks/automations/{webhook_token}
Content-Type: multipart/form-dataCopy the full URL from the automation's Webhook panel (Endpoint → Copy URL) rather than building it yourself. The token in the path identifies the automation, so keep the URL private.
Headers
| Header | Required | Description |
|---|---|---|
Content-Type | Yes | Must be multipart/form-data. Anything else is rejected with 415. |
X-Webhook-Secret | When enabled | The automation's webhook secret. Required whenever Webhook secret is on, otherwise 401. |
Idempotency-Key | No | A unique string per event. Retries with the same key return the original task instead of creating a new one. |
Form fields
| Field | Type | Description |
|---|---|---|
description | text, required | What the agent should do. Becomes the task's intent and title. Send it once — repeating the field is rejected. |
| (any name) | file, optional | Up to 5 file parts, 5 MB each. Any part with a filename is treated as a file. file is a good field name, repeated for more files. |
No other text fields are accepted: an unexpected field is rejected with 400.
If the automation has Instructions, they are prepended to description to form the task's intent.
Accepted file types
png, jpeg, webp, txt, md, csv, tsv, json, yaml and log. The content is checked against the declared type. A file that's the wrong type or doesn't match its content rejects the whole delivery, and no task is created.
Idempotency and retries
Webhook senders often retry. CodeBeast deduplicates deliveries per automation:
- With
Idempotency-Key— a repeat of the same key returns200withoutcome: "deduped"and the originaltaskId. - Without it — CodeBeast hashes
descriptiontogether with each file's name, type and bytes. An identical retry is still caught, even if the multipart boundary changes.
Only deliveries that created a task are deduplicated. A request that was rejected or rate-limited can be retried with the same key.
Use your source system's event ID — an alert ID, a form submission ID — as the Idempotency-Key. Two distinct events with the same text then still create two tasks.
Responses
Every response is JSON with ok and outcome. Successful deliveries include the task.
{
"ok": true,
"outcome": "task_started",
"deliveryId": "d1f3…",
"taskId": "8b2c…",
"taskUrl": "https://app.codebeast.ai/o/…/board/…"
}Errors include an error message:
{
"ok": false,
"outcome": "rejected",
"error": "invalid webhook secret"
}deliveryId matches the Delivery ID in the automation's Activity log.
Outcomes and status codes
outcome | HTTP | Meaning |
|---|---|---|
task_started | 200 | Task created and started (On receive: Create and start task). |
task_created | 200 | Task created in ToDo (On receive: Create task in ToDo). Also returned if the task was created but a file couldn't be attached or the start failed — see error. |
deduped | 200 | Same idempotency key or body as an earlier successful delivery. The original taskId is returned. |
rate_limited | 429 | Over the per-automation request limit or the automation's own Rate limit. See Limits. |
credit_limited | 402 | The automation's daily Credit limit is reached. No task is created. |
task_created | 402 | The task was created but couldn't start because the organisation is out of credits or the automation's credit limit was hit. It waits in ToDo — see error. |
rejected | 400 401 403 404 413 415 | The request was refused. See the table below. |
failed | 500 | Server error while creating or starting the task. Safe to retry with the same Idempotency-Key. |
Rejections
| HTTP | error | Fix |
|---|---|---|
400 | description is required | Send a non-empty description field. |
400 | description must be a single field | Send description once. |
400 | unexpected field: <name> | Remove extra text fields. Only description and file parts are allowed. |
400 | too many files (max 5) | Send 5 files or fewer. |
400 | empty file: <name> | Don't send zero-byte files. |
400 | unsupported file type for <name> | Use an accepted file type. |
400 | attachment failed: file content does not match type <mime> | Send the correct type= for the file. |
400 | invalid multipart body / multipart boundary missing | Send a well-formed multipart/form-data body. Let your HTTP client build it. |
400 | automation repository is no longer connected | An admin needs to reconnect the repository or update the automation. |
401 | invalid webhook secret | Send the current secret in X-Webhook-Secret. It changes when someone clicks Regenerate. |
403 | automation is paused | An admin needs to click Activate on the automation. |
404 | automation not found | The URL is wrong, or the automation was deleted. |
413 | file too large: <name> | Keep each file at or under 5 MB. |
415 | Content-Type must be multipart/form-data | Send form data, not JSON. |
Limits
- 20 requests per minute per automation, counting every outcome. Over that you get
429withRetry-After: 60and "Too many requests. Try again in a minute." - The automation's own Rate limit, if set — a maximum number of tasks per hour, day or week. Over it you get
429with "This automation's delivery limit was reached. Try again later." - The automation's daily Credit limit, if set, resets at 00:00 UTC.
- Up to 5 files, 5 MB each.
- Normal organisation limits still apply: credits, and up to 5 running tasks per organisation.
Examples
Description only:
curl -X POST "$WEBHOOK_URL" \
-H "X-Webhook-Secret: $WEBHOOK_SECRET" \
-H "Idempotency-Key: alert-48213" \
-F "description=Checkout returns 500 when the cart has a discount code. Find the cause and open a pull request with a fix."With a screenshot and a log file:
curl -X POST "$WEBHOOK_URL" \
-H "X-Webhook-Secret: $WEBHOOK_SECRET" \
-H "Idempotency-Key: ticket-9917" \
-F "description=Review the attached screenshot and log, and open a pull request that fixes the broken layout." \
-F "file=@layout.png;type=image/png" \
-F "file=@console.log;type=text/plain"From Node.js:
const form = new FormData();
form.append("description", "Bump the minimum Node version to 22 and fix any type errors.");
form.append("file", new Blob([logText], { type: "text/plain" }), "ci.log");
const res = await fetch(process.env.WEBHOOK_URL, {
method: "POST",
headers: {
"X-Webhook-Secret": process.env.WEBHOOK_SECRET,
"Idempotency-Key": event.id,
},
body: form, // fetch sets the multipart Content-Type and boundary
});
const out = await res.json();
if (!out.ok) throw new Error(`${res.status} ${out.outcome}: ${out.error}`);
console.log("Task:", out.taskUrl);To check your setup without creating a task, use Test webhook → Dry run on the automation's page. See Automations.
Troubleshooting
| Symptom | Likely cause |
|---|---|
415 from a JSON client | The webhook only accepts multipart/form-data. Send description as a form field. |
Every call returns deduped | You're reusing the same Idempotency-Key, or sending identical bodies without one. Use a unique key per event. |
task_created when you expected task_started | On receive is set to Create task in ToDo, or the start was refused (out of credits, or the running-task limit was reached). Check error. |
401 after it used to work | Someone regenerated the secret. Copy the new one from the Webhook panel. |
| Task created but it's waiting on you | The automation's Run mode is Normal, so it pauses for clarifying questions and PRD approval. Switch to Auto to skip them. |