Laziness
All docs
Flows

Webhooks

Start a flow from another app by sending a request to a secret link.

A webhook trigger gives a flow a secret link. Any app or script that sends a request to that link starts a run, with the request's body as the run's request. Use it to start a flow from a form, a store, a CRM, or your own code.

  1. Add a trigger to the flow, or select one, and set it to Webhook.
  2. In the trigger's settings, make the link.
  3. Copy it now. It is shown only once.
  4. Save the flow.

Making a new link replaces the old one, which stops working. Changing the trigger to another kind, and saving, removes its link.

Note: Treat the link like a password. Anyone who has it can start the flow. If it leaks, make a new one.

Call it

Send a POST request with a JSON or text body:

curl -X POST "https://app.laziness.ai/api/hooks/YOUR-SECRET" \
  -H "Content-Type: application/json" \
  -d '{"name": "Ada", "email": "ada@example.com", "message": "Interested in Pro"}'

The run's steps read the body as the request: JSON is laid out for them, text is passed as it is.

Answers

StatusMeaning
202The run started. The answer carries the run's id.
404The link is unknown, or its trigger is no longer a webhook.
413The request is too long.
429Too many calls to this link, from this address, or too many of your runs going. Try again later.

A webhook runs the flow whether or not its schedule is switched on. It runs as you, so it counts toward your plan like any run.

Safety

A request from outside is not you. So:

  • Every action asks. A webhook run, and any work it hands off, waits for your approval before each action, even when you chose full access.
  • The request is data. Steps read it under a heading that marks it as outside data, never as instructions.
  • Fewer pictures and videos. A webhook run is held to a smaller number of pictures, and makes videos only if the step allows it.

Answer its approvals in the run view, on the bell, or from a chat app. See Approvals in flows.

Example: a contact form

  1. Trigger: Webhook.
  2. Agent: "Read the message. Write a short, friendly reply that answers what they asked."
  3. Review: "The reply is polite, under 120 words, and answers the question."
  4. Agent with your email account's tools: "Send the reply to the sender's address."

The last step's send waits for your yes. You read the reply, approve it, and it goes out.

Limits

Each link and each address may call only so often a minute, and a body has a maximum size. Both are there to keep a leaked link from running up your plan.