Skip to content

POST /v1/sms/pre-send

The pre-send endpoint is the core compliance gate. It runs 6 checks in sequence before returning an allow/block decision — all in under 200ms.

1. Quota check → Monthly limit reached?
2. Quiet hours → Before 8 AM or after 9 PM local time?
3. Frequency caps → Over 3 messages/day to this number?
4. Revocation check → Consumer sent STOP?
5. Double opt-in → Awaiting confirmation?
6. Consent lookup → Valid consent on file?
POST https://sms.econsent.org/v1/sms/pre-send
Authorization: Bearer ec_sms_YOUR_KEY
Content-Type: application/json
{
"phone": "+15551234567",
"sending_entity": "Acme Insurance LLC",
"sending_number": "+18005550100",
"message_type": "marketing"
}
FieldTypeRequiredDescription
phonestringYesRecipient phone (10-11 digits)
sending_entitystringYesYour business name
sending_numberstringNoYour sending number
message_typestringYesmarketing, transactional, mixed, or informational
{
"allowed": true,
"decision_id": "dec_sms_abc123",
"consent": {
"consent_id": "cst_sms_xyz789",
"captured_at": "2026-04-15T14:30:00Z",
"type": "prior_express_written",
"scope": ["marketing"],
"evidence_url": "https://verify.econsent.org/c/cst_sms_xyz789"
},
"compliance_notes": []
}
{
"allowed": false,
"reason": "quiet_hours",
"decision_id": "dec_sms_abc124",
"recipient_timezone": "America/New_York",
"recipient_local_time": "21:45",
"quiet_hours": { "start": "21:00", "end": "08:00" },
"next_allowed_at": "2026-04-18T08:00:00-04:00"
}
ReasonDescription
quiet_hoursMarketing message outside 8 AM - 9 PM local time
frequency_capOver daily limit for this phone number
consumer_revokedConsumer sent STOP keyword
pending_double_optinConsent awaiting confirmation
no_consent_on_fileNo valid consent found
quota_exceededMonthly API quota reached