Skip to main content

Milestone Trigger by ID API

Update, delete, and simulate individual milestone triggers.

PUT /triggers/{id}

Update an existing milestone trigger.

Request

ParameterTypeRequiredDescription
idstringYesTrigger identifier (path parameter)

Request Body

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

FieldTypeDescription
namestringTrigger name
event_typestringEvent type to monitor
score_thresholdintegerLead score required to fire
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": "trigger-123",
"name": "Updated Alert",
"event_type": "demo_request",
"score_threshold": 80,
"active": true,
"updated_at": "2025-01-15T12:00:00Z"
}

Example

curl -X PUT "https://api.leadvibe.com/triggers/trigger-123" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"score_threshold": 80,
"active": true
}'

Common Errors

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

DELETE /triggers/{id}

Delete a milestone trigger. This action cannot be undone.

Request

ParameterTypeRequiredDescription
idstringYesTrigger identifier (path parameter)

Response

204 No Content

Successfully deleted.

Example

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

Common Errors

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

POST /triggers/{id}/simulate

Test a milestone trigger against a specific lead or against historical data. Use this to verify that a trigger's threshold and filters are configured correctly before enabling it in production.

Request

ParameterTypeRequiredDescription
idstringYesTrigger 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 trigger would fire
matched_leadsarrayLead IDs that match the trigger conditions (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/triggers/trigger-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/triggers/trigger-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 FoundTrigger or lead does not exist
500Server ErrorRetry later or contact support

POST /triggers/{id}/pause

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

Response

200 OK


POST /triggers/{id}/resume

Resume a paused milestone trigger.

Response

200 OK


POST /triggers/{id}/copy

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

Response

201 Created

Returns the newly created 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