Start a run from a webhook
const url = 'https://api.asklucy.eu/v1/hooks/example/example';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '"example"'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.asklucy.eu/v1/hooks/example/example \ --header 'Content-Type: application/json' \ --data '"example"'For other systems (GitHub, Zapier, Make, n8n, Power Automate, a
script): POST to the trigger’s webhook_url as it is, like a
Slack, Discord or Teams incoming webhook. The URL carries the
token, so it needs no header and no Zitadel token. Treat it as a
password: anyone who has it can start runs. Rotate it if it leaks
(rotateAgentTriggerSecret). The token is never logged.
The body (at most 256 KB) is the run’s payload, read the way it
was meant:
- a body that is JSON is JSON, whatever its content type (
curl -dsays form-urlencoded); - a form (
application/x-www-form-urlencoded, e.g. Slack) is an object of its fields, a list when a field repeats; text/plainand any other UTF-8 text are a string.
Lucy treats the payload as data, never as instructions: the agent’s instructions decide what to do with it.
A retry with the same Idempotency-Key (or GitHub’s
X-GitHub-Delivery) within 24 hours returns the first run instead
of starting another.
Limits, on top of the organization’s: 60 accepted deliveries a minute per trigger, and 20 runs queued per agent.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The trigger’s token (AgentTrigger.webhook_url has it). The URL is the credential.
Header Parameters
Section titled “Header Parameters”Any unique string (a UUID works). Retries with the same key return the first result.
Used as the idempotency key when Idempotency-Key is absent.
Request Body
Section titled “Request Body”Example generated
exampleobject
Example generated
Responses
Section titled “Responses”Accepted (or the run of an earlier delivery with the same key).
object
queued waits for the agent’s run in progress; skipped: a
schedule fired while a run was still going, so this time didn’t
run.
Example
{ "status": "queued"}The request is invalid; errors lists what’s wrong.
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Headers
Section titled “Headers”Unique per request; quote it to support.
No webhook at this URL, or it can’t run. That covers a wrong, missing or rotated-out token, an unknown trigger, a trigger or agent that is disabled or deleted, an owner who has left or may no longer use agents, and an organization with agents off. All of these answer the same.
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}The body is over 256 KB.
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}The body is neither JSON nor UTF-8 text.
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Rate limit (problem type …/errors/rate-limited, retry after
Retry-After) or quota used up (…/errors/quota-exceeded, with
quota saying which limit and when it resets).
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Headers
Section titled “Headers”Unique per request; quote it to support.
Seconds to wait before retrying.