Run a webhook-triggered campaign
- Path
/campaigns/{id}/runs- Auth
- Secret key · server only
const url = 'https://releva.ai/api/v0/campaigns/123/runs';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"trigger":{"custom":{}}}'};
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://releva.ai/api/v0/campaigns/123/runs \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "trigger": { "custom": {} } }'Starts one run of a triggered campaign or workflow whose trigger is Webhook. Releva evaluates the campaign’s target segment and lets every eligible profile enter it: profiles that never entered, or whose re-entry cooldown has passed. One call runs the campaign for the whole segment, not for one profile.
Processing is asynchronous. A 202 means the run was queued; it does not check that the campaign is
switched on. A run for a switched-off campaign, or for a paused domain, is dropped without an error.
Custom fields sent in trigger.custom are available in the campaign’s messages as
{{triggerEvent.custom.<string|numeric|date>.<key>}}; several values for one key are joined with ", ".
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Campaign or workflow id, as in the admin URL .../workflows/<id>/details. Must be a triggered campaign
of the domain that owns the secret key. A non-numeric value answers 500.
Example
123Request Bodyrequired
Section titled “Request Bodyrequired”object
Data passed to the run. {} is accepted.
object
Custom fields for the run (same shape as custom on products, profiles and events).
Used in messages as {{triggerEvent.custom.<type>.<key>}}.
object
object
object
object
Examples
No custom fields (the body shown in the admin webhook instructions)
{ "trigger": { "custom": {} }}Custom fields for merge tags
{ "trigger": { "custom": { "string": [ { "key": "restockedSku", "values": [ "DEMO-1001-M" ] } ], "numeric": [ { "key": "restockedQuantity", "values": [ 25 ] } ], "date": [ { "key": "restockedAt", "values": [ "2026-10-21T09:00:00Z" ] } ] } }}Responses
Section titled “Responses”Accepted for asynchronous processing.
object
Example
{}Authentication error, validation error, or the campaign is not webhook-triggered.
object
Human-readable error. Several validation errors are joined with a space.
Examples
{ "message": "Authorization header is missing."}{ "message": "Authorization header is malformed. It should look like `Bearer <string>`."}{ "message": "Authorization header contains an invalid Bearer token."}{ "message": "Domain with the provided secret key cannot be found."}{ "message": "The 'trigger' field is required."}{ "message": "The 'trigger' must be an Object."}{ "message": "The object 'trigger' contains forbidden keys: 'products'."}{ "message": "The object 'trigger.custom' contains forbidden keys: 'text'."}{ "message": "The 'trigger.custom.string[0].values[0]' field must be a string."}{ "message": "trigger.custom.date[0].values[0] must be a valid ISO-8601 date such as 2020-01-01 with optional time in hours, minutes, seconds and timezone offset with optional milliseconds such as 2020-01-01T23:59:59.999Z or 2020-01-01T23:59:59.999-0500 or 2020-01-01T23:59:59-0500. Got 21/10/2026 instead."}{ "message": "The '' field is required."}{ "message": "This campaign is configured to use event trigger and cannot be triggered via webhook!"}{ "message": "We do not support non-HTTPS requests."}The domain is disabled.
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "Domain is disabled. Please reach out to support@releva.ai to enable it."}No triggered campaign with this id in the domain (unknown id, one-off or continuous campaign, or another domain’s campaign).
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "No Triggered campaign found for id: 999"}Request body larger than 800 KB.
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "request entity too large"}Unexpected server error.
object
Human-readable error. Several validation errors are joined with a space.
Example
{ "message": "An internal error occurred."}