Create an auto-send trigger rule on an expiry
post
https://api.expiryedge.com/v1/createCollectionTriggerRuleeditor or admin60/minAny method
Request
curl -X POST 'https://api.expiryedge.com/v1/createCollectionTriggerRule' \
-H "Authorization: Bearer $EXPIRYEDGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"expiryId": "exp_4Tq9sLm2",
"templateId": "tpl_W9onboard",
"triggerType": "before_expiry",
"triggerDays": 30,
"triggerTime": "09:00",
"contactIds": [
"c_8Hk2pQ"
],
"expiresInDays": 21,
"dueInDays": 14,
"carryToRenewal": true
}'Response
{
"message": "Trigger created",
"trigger": {
"id": "trg_2Vb8",
"organization_id": "org_northwind",
"expiry_id": "exp_4Tq9sLm2",
"expiry_name": "Northwind Dental - State Dental License",
"template_id": "tpl_W9onboard",
"template_name": "New client onboarding - Northwind Dental",
"trigger_type": "before_expiry",
"trigger_days": 30,
"trigger_time": "09:00",
"trigger_date": "2026-09-15T13:00:00.000Z",
"contact_ids": [
"c_8Hk2pQ"
],
"group_id": null,
"group_name": null,
"expires_in_days": 21,
"due_in_days": 14,
"status": "pending",
"created_request_ids": [],
"run_count": 0,
"last_triggered_at": null,
"triggered_by": null,
"error_message": null,
"carry_to_renewal": true,
"created_by": "u_71bXq",
"created_by_name": "Priya Shah",
"created_at": "2026-09-27T14:05:00.000Z",
"updated_at": "2026-09-27T14:05:00.000Z"
}
}Automatically sends a template to contacts relative to an expiry (before/on/after its date, on a date, when marked done, on renewal, or manual only). manual rules start paused, all others pending. The plan limit is checked when the rule fires. The handler does not check the HTTP method.
expiryIdstringrequiredtemplateIdstringrequiredA non-archived template.triggerTypestringrequiredAllowedbefore_expiryon_expiryafter_expiryon_dateon_doneon_renewalmanualtriggerDaysintegerRequired forbefore_expiry/after_expiry.min: 0 · max: 3650triggerTimestringHH:MM in the organization timezone (date-based types).Default09:00triggerDatestringRequired foron_date; the exact fire time.format: date-timecontactIdsarray of stringgroupIdstringexpiresInDaysintegerCreated requests' links expire this many days after sending.dueInDaysintegerCreated requests' due date, days after sending.carryToRenewalbooleanCopy this rule to the next occurrence when the expiry renews.Defaultfalse
201
Rule created.
messagestringrequiredtriggerobjectrequiredAn auto-send rule attached to an expiry.
400 | The request is missing required fields or contains invalid values. |
401 | Missing, expired or invalid bearer token. |
403 | Authenticated, but your role or organization does not allow this action. |
404 | The record does not exist or is not in your organization. |
429 | Too many requests for this endpoint from your IP. Wait Retry-After seconds. |
