Skip to main content

Sequence Trigger by ID API

Update, delete, and simulate individual sequence triggers.

PUT /sequences/{id}

Update an existing sequence trigger.

Request

ParameterTypeRequiredDescription
idstringYesSequence trigger identifier (path parameter)

Request Body

All fields are optional. Only provided fields will be updated.

FieldTypeDescription
namestringSequence trigger name
event_typesarrayOrdered list of event types
window_secondsintegerTime window in seconds
window_unitstringHuman-readable unit label
orderedbooleanWhether events must occur in order
webhook_urlstringWebhook destination URL
emailsarrayEmail notification recipients
email_subjectstringSubject line for email notifications
email_preheaderstringPreheader text for email notifications
email_messagestringCustom message body for email notifications
activebooleanWhether trigger is active

Response

200 OK

{
"id": "seq-123",
"name": "Updated Sequence",
"event_types": ["pricing_page_view", "demo_request"],
"window_seconds": 86400,
"ordered": false,
"active": true,
"updated_at": "2025-01-15T12:00:00Z"
}

Example

curl -X PUT "https://api.leadvibe.com/sequences/seq-123" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"window_seconds": 86400,
"ordered": false
}'

Common Errors

StatusMeaningSolution
400Bad RequestInvalid field values
401UnauthorizedCheck authentication token
404Not FoundSequence trigger does not exist or not accessible

DELETE /sequences/{id}

Delete a sequence trigger. This action cannot be undone.

Request

ParameterTypeRequiredDescription
idstringYesSequence trigger identifier (path parameter)

Response

204 No Content

Successfully deleted.

Example

curl -X DELETE "https://api.leadvibe.com/sequences/seq-123" \
-H "Authorization: Bearer <token>"

Common Errors

StatusMeaningSolution
401UnauthorizedCheck authentication token
404Not FoundSequence trigger does not exist or not accessible

POST /sequences/{id}/simulate

Test a sequence trigger against a specific lead or against historical data. Use this to verify that a sequence trigger's event steps, time window, and order requirements are configured correctly before enabling it.

Request

ParameterTypeRequiredDescription
idstringYesSequence trigger identifier (path parameter)
lead_idstringNoSpecific lead ID to test against. When omitted, scans historical data for all matching leads.
daysintegerNoNumber of days to look back (default: 30, range: 1-365)

Request Body

{
"lead_id": "abc-123",
"days": 30
}

Response

200 OK

{
"would_fire": true,
"matched_leads": ["abc-123"],
"total_matches": 1,
"message": "Trigger would fire for this lead"
}

Response Fields

FieldTypeDescription
would_firebooleanWhether the sequence trigger would fire
matched_leadsarrayLead IDs that completed the sequence (up to 100)
total_matchesintegerTotal number of matching leads
messagestringHuman-readable summary of the simulation result

Examples

Test a Specific Lead:

curl -X POST "https://api.leadvibe.com/sequences/seq-123/simulate" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"lead_id": "abc-123", "days": 30}'

Scan Historical Data:

curl -X POST "https://api.leadvibe.com/sequences/seq-123/simulate" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"days": 60}'

Common Errors

StatusMeaningSolution
400Bad RequestCheck that the JSON body is well-formed
401UnauthorizedCheck authentication token
404Not FoundSequence trigger or lead does not exist
500Server ErrorRetry later or contact support

POST /sequences/{id}/pause

Pause a sequence trigger. A paused trigger remains configured but does not fire.

Response

200 OK


POST /sequences/{id}/resume

Resume a paused sequence trigger.

Response

200 OK


POST /sequences/{id}/copy

Create a copy of an existing sequence trigger. Useful for creating variations for testing.

Response

201 Created

Returns the newly created sequence trigger.


Notes

  • Consider pausing a trigger instead of deleting it if you might need it later
  • Simulation does not fire the actual trigger or send any notifications
  • Historical scans are limited to 100 matched leads in the response