Skip to content

Area: Developers

POST

Run a webhook-triggered campaign

Path
/campaigns/{id}/runs
Auth
Secret key · server only
POST
/campaigns/{id}/runs
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 ", ".

id
required
integer
>= 1

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

123
Media typeapplication/json
object
trigger
required

Data passed to the run. {} is accepted.

object
custom

Custom fields for the run (same shape as custom on products, profiles and events). Used in messages as {{triggerEvent.custom.<type>.<key>}}.

object
string
Array<object>
object
key
required
string
values
required
Array<string>
numeric
Array<object>
object
key
required
string
values
required
Array<number>
date
Array<object>
object
key
required
string
values
required
Array<string>

Examples

No custom fields (the body shown in the admin webhook instructions)

{
"trigger": {
"custom": {}
}
}

Accepted for asynchronous processing.

Media typeapplication/json
object
0

Example

{}

Authentication error, validation error, or the campaign is not webhook-triggered.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Examples

{
"message": "Authorization header is missing."
}

The domain is disabled.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

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).

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Example

{
"message": "No Triggered campaign found for id: 999"
}

Request body larger than 800 KB.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Example

{
"message": "request entity too large"
}

Unexpected server error.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Example

{
"message": "An internal error occurred."
}