Firing an event is account-scoped: it runs for one linked account. Authenticate with your API key and the
linked_account_id, against the base URL https://app.refold.ai.How it works
An event has a name and a sample payload. The sample payload defines the data fields a workflow can reference as variables. When you fire the event with real data, those fields fill the variables inside every attached workflow. The lifecycle is:- Define the event in the Console, with a sample payload that mirrors what you will send.
- Attach workflows that should run when the event fires.
- Fire the event from your backend with a real payload for a specific linked account.
Define an event
You create events in the Console before you can fire them.Open the events page
In the Refold Console, go to Settings > Developer > Events.
Workflows reference the event’s payload fields as trigger variables. Keep the sample payload’s field names stable, renaming a field can break workflows that reference it.
Fire an event
Fire the event from your backend for a specific linked account. The app slug goes in the URL path, and the body carries the event name and your payload.cURL
Output
event:
Node.js
The
event name in the body must match the event name in the Console exactly, including case. A mismatch returns 404 INVALID_EVENT with “Trigger not found”.Events vs webhooks
Both involve event payloads, but they move in opposite directions. Don’t confuse them.| Events | Webhooks | |
|---|---|---|
| Direction | Your backend to Refold | Refold to your backend |
| Purpose | Start a workflow | React to something that happened |
| You provide | The payload to run on | An endpoint to receive deliveries |
Next steps
Build a workflow
Attach workflows to the events you fire.
Trigger event API
Full request and response reference.
Receive webhooks
Get notified when those workflows complete or error.
Node.js SDK
The
event method and the rest of the server API.