Milestone Trigger by ID API
Update, delete, and simulate individual milestone triggers.
PUT /triggers/{id}
Update an existing milestone trigger.
Request
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Trigger identifier (path parameter) |
Request Body
All fields are optional. Only provided fields will be updated.
| Field | Type | Description |
|---|---|---|
name | string | Trigger name |
event_type | string | Event type to monitor |
score_threshold | integer | Lead score required to fire |
webhook_url | string | Webhook destination URL |
emails | array | Email notification recipients |
email_subject | string | Subject line for email notifications |
email_preheader | string | Preheader text for email notifications |
email_message | string | Custom message body for email notifications |
active | boolean | Whether 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
| Status | Meaning | Solution |
|---|---|---|
| 400 | Bad Request | Invalid field values |
| 401 | Unauthorized | Check authentication token |
| 404 | Not Found | Trigger does not exist or not accessible |
DELETE /triggers/{id}
Delete a milestone trigger. This action cannot be undone.
Request
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Trigger 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
| Status | Meaning | Solution |
|---|---|---|
| 401 | Unauthorized | Check authentication token |
| 404 | Not Found | Trigger 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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Trigger identifier (path parameter) |
lead_id | string | No | Specific lead ID to test against. When omitted, scans historical data for all matching leads. |
days | integer | No | Number 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
| Field | Type | Description |
|---|---|---|
would_fire | boolean | Whether the trigger would fire |
matched_leads | array | Lead IDs that match the trigger conditions (up to 100) |
total_matches | integer | Total number of matching leads |
message | string | Human-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
| Status | Meaning | Solution |
|---|---|---|
| 400 | Bad Request | Check that the JSON body is well-formed |
| 401 | Unauthorized | Check authentication token |
| 404 | Not Found | Trigger or lead does not exist |
| 500 | Server Error | Retry 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
Related Endpoints
- Milestone Triggers - List and create triggers
- Sequence Triggers - Simulate sequence triggers
- Search Leads - Find leads to test against