SendBeam

Code workflows: Trigger.dev, Windmill and Kestra

Copy-pasteable, typed blueprints for running SendBeam from code-first workflow platforms: a Trigger.dev task, Windmill scripts in TypeScript and Python, and a Kestra YAML flow.

View as Markdown

If you would rather write a background job than map nodes in a visual tool, SendBeam is a JSON API behind one header, and these three blueprints are the whole integration: a typed task, a script, a flow. Each adds a contact, optionally puts them on a list, sends a site email, and can be started by SendBeam's own webhooks.

The three blueprints

  • Trigger.dev — a v3 task() in TypeScript with a typed payload and retries, plus a Next.js route that verifies SendBeam's signature and triggers a task for each event.
  • Windmill — the same job as a TypeScript script and as a Python script, with the key held as a Windmill resource, and signature verification for Windmill's script webhooks.
  • Kestra — a declarative YAML flow of HTTP tasks with the key as a Kestra secret, and a webhook-triggered flow that routes on the event type.

What every blueprint does the same way

  • The key lives in the platform's secret store, one per environment, never in source. A staging run must not write to your production list.
  • 409 is success. POST /api/v1/contacts and adding to a list answer 409 when the person is already there, so a retried run never fails on its own earlier work.
  • Retries are the platform's job. A 5xx or a 429 from SendBeam is left to the task runner's retry policy rather than caught and swallowed.
  • Inbound events are verified. X-SendBeam-Signature is t=<unix seconds>,v1=<hex HMAC-SHA256 of "t.body">; check it against the raw bytes, refuse anything older than five minutes, and use X-SendBeam-Delivery as the idempotency key.
  • Marketing consent is yours to hold. Add someone to a marketing list only if they agreed; site email through /api/v1/transactional needs no consent.

Which calls to use

ToCallPermission
Add or update a personPOST /api/v1/contactscontacts:write
Put them on a listPOST /api/v1/lists/{id}/contactslists:write
Send a receipt, a reset, a reminderPOST /api/v1/transactionaltransactional:send
Report an order, a cart or a refundPOST /api/v1/ecommerce/eventsecommerce:write
Be told when something happensSettings → Webhooks—

The full reference, with every field and response, is under API reference; the event payloads and the signature are under Webhooks.