interventions

Embed
Preview of the card
<a href="https://lucida.15-204-158-166.sslip.io/docs/ref-interventions"><img src="https://lucida.15-204-158-166.sslip.io/docs/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/da916cd3-c0fc-4b63-b971-b3c13623daf3/pages/024de7d9-edb7-4e9c-a7bd-9a056e4edffd/social-card.svg?v=3e7ae33eec8b" alt="interventions" width="600" height="315"></a>
GEThttps://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/interventions

Parameters

project_idstringpathrequired
limitintegerquery
cursorstringquery

Code samples

cURL
curl -X GET "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/interventions"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Page of InterventionRow, newest first
404
POSThttps://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/interventions

Parameters

project_idstringpathrequired

Request body

application/json
action_idstring
Fire on events matching this action instead of (or as well as) steps.
cap_per_userinteger
Fires per distinct id per window, 1 to 1000 (default 1).
cap_window_secsinteger
The cap window, 60 seconds to 30 days (default 1 day).
cooldown_secsinteger
Minimum gap between two fires for one person, 0 to 30 days (default 0).
deliver_sdkboolean
deliver_webhookboolean
descriptionstring
enabledboolean
namestringrequired
payloadobject
JSON object handed to the SDK callback and the webhook (at most 8 KB). Event data is never copied in.
stepsobject[]
ActionStep array, like an action's steps (event, url, selector, event and person property filters); any step matches. Up to 20. Leave empty when action_id triggers.
ttl_secsinteger
How long a fire stays deliverable to an SDK that connects after it, 10 seconds to 1 day (default 300).
{
  "action_id": "string",
  "cap_per_user": 0,
  "cap_window_secs": 0,
  "cooldown_secs": 0,
  "deliver_sdk": true,
  "deliver_webhook": true,
  "description": "string",
  "enabled": true,
  "name": "string",
  "payload": {},
  "steps": [
    {}
  ],
  "ttl_secs": 0
}

Code samples

cURL
curl -X POST "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/interventions" \
  -H "Content-Type: application/json" \
  -d '{"action_id":"string","cap_per_user":0,"cap_window_secs":0,"cooldown_secs":0,"deliver_sdk":true,"deliver_webhook":true,"description":"string","enabled":true,"name":"string","payload":{},"steps":[{}],"ttl_secs":0}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201
Example
{
  "action_id": "string",
  "cap_per_user": 0,
  "cap_window_secs": 0,
  "cooldown_secs": 0,
  "created_at": "2024-01-01T00:00:00Z",
  "created_by": "string",
  "deliver_sdk": true,
  "deliver_webhook": true,
  "description": "string",
  "enabled": true,
  "fires_24h": 0,
  "id": "string",
  "name": "string",
  "payload": {},
  "steps": [
    {}
  ],
  "ttl_secs": 0,
  "updated_at": "2024-01-01T00:00:00Z"
}
Schema
action_idstring
cap_per_userintegerrequired
cap_window_secsintegerrequired
cooldown_secsintegerrequired
created_atstringrequired
created_bystring
deliver_sdkbooleanrequired
deliver_webhookbooleanrequired
descriptionstringrequired
enabledbooleanrequired
fires_24hintegerrequired
Fires in the last 24 hours.
idstringrequired
namestringrequired
payloadobjectrequired
Handed to the SDK callback and the webhook as is.
stepsobject[]required
actions.steps ActionStep array (any step matches); empty when action_id triggers.
ttl_secsintegerrequired
updated_atstringrequired
400
403
404
409
GEThttps://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/interventions/fires

Recent fires (35 days are kept), newest first; the cursor is the last fire's sequence number.

Parameters

project_idstringpathrequired
intervention_idstringquery
distinct_idstringquery
limitintegerquery
cursorstringquery

Code samples

cURL
curl -X GET "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/interventions/fires"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Page of FireRow
404
GEThttps://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/interventions/{id}

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

cURL
curl -X GET "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/interventions/{id}"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

404
PUThttps://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/interventions/{id}

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json
action_idstring
Fire on events matching this action instead of (or as well as) steps.
cap_per_userinteger
Fires per distinct id per window, 1 to 1000 (default 1).
cap_window_secsinteger
The cap window, 60 seconds to 30 days (default 1 day).
cooldown_secsinteger
Minimum gap between two fires for one person, 0 to 30 days (default 0).
deliver_sdkboolean
deliver_webhookboolean
descriptionstring
enabledboolean
namestringrequired
payloadobject
JSON object handed to the SDK callback and the webhook (at most 8 KB). Event data is never copied in.
stepsobject[]
ActionStep array, like an action's steps (event, url, selector, event and person property filters); any step matches. Up to 20. Leave empty when action_id triggers.
ttl_secsinteger
How long a fire stays deliverable to an SDK that connects after it, 10 seconds to 1 day (default 300).
{
  "action_id": "string",
  "cap_per_user": 0,
  "cap_window_secs": 0,
  "cooldown_secs": 0,
  "deliver_sdk": true,
  "deliver_webhook": true,
  "description": "string",
  "enabled": true,
  "name": "string",
  "payload": {},
  "steps": [
    {}
  ],
  "ttl_secs": 0
}

Code samples

cURL
curl -X PUT "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/interventions/{id}" \
  -H "Content-Type: application/json" \
  -d '{"action_id":"string","cap_per_user":0,"cap_window_secs":0,"cooldown_secs":0,"deliver_sdk":true,"deliver_webhook":true,"description":"string","enabled":true,"name":"string","payload":{},"steps":[{}],"ttl_secs":0}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

400
403
404
409
DELETEhttps://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/interventions/{id}

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

cURL
curl -X DELETE "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/interventions/{id}"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

204
403
404
POSThttps://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/interventions/{id}/test

Fire the intervention for one person now, skipping its trigger and caps (QA). It is delivered like a real fire: to the person's connected SDK and, when on, the webhook.

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json
distinct_idstringrequired
The person the test fire goes to (their connected SDK shows it).
{
  "distinct_id": "string"
}

Code samples

cURL
curl -X POST "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/interventions/{id}/test" \
  -H "Content-Type: application/json" \
  -d '{"distinct_id":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201
Example
{
  "deliver_sdk": true,
  "distinct_id": "string",
  "event": "string",
  "event_uuid": "string",
  "expires_at": "2024-01-01T00:00:00Z",
  "fired_at": "2024-01-01T00:00:00Z",
  "id": "string",
  "intervention_id": "string",
  "seq": 0,
  "webhook_state": "string"
}
Schema
deliver_sdkbooleanrequired
distinct_idstringrequired
eventstringrequired
event_uuidstringrequired
expires_atstringrequired
fired_atstringrequired
idstringrequired
intervention_idstringrequired
seqintegerrequired
webhook_statestringrequired
none, pending (webhook not queued yet) or queued.
400
403
404
Updated