Change the sending rules
Change one or more rules.
https://app.usenotix.dev/api/v1/sending-rulesNeeds a full access key. Sending access keys cannot call this. Key permissions lists the extra rules some calls have.
Change one or more rules. Send only what changes; everything else stays as it is.
{
"quietHours": { "enabled": true, "from": "21:00", "to": "07:00", "timezone": "Africa/Lagos", "action": "HOLD" },
"frequencyCap": { "enabled": true, "max": 3, "windowDays": 7 }
}
The rules are checked as a whole: quiet hours need a start and an end that differ, at most 12 hours apart, and at least one kind of message, SKIP cannot be used with TRANSACTIONAL, daily caps need at least one cap, and the country allow list needs at least one real two-letter country code (400 BAD_REQUEST otherwise). A change reaches the sending queue within 30 seconds. The answer is the same as reading the rules.
The rules
| Rule | What it does |
|---|---|
quietHours | No marketing between from and to (24-hour HH:MM) in timezone. With action: "HOLD" a message is held and sent when quiet hours end, spread over 30 minutes; with "SKIP" it is not sent. appliesTo picks what it covers: MARKETING_EMAIL, MARKETING_SMS (does nothing yet: Notix sends no marketing SMS today) and TRANSACTIONAL. Transactional email can only be held, never skipped, and a window is at most 12 hours. With useContactTimezone, a contact's own timezone property (an IANA zone such as Africa/Nairobi) is used when it is valid. |
frequencyCap | At most max broadcast and automation emails to one contact in windowDays days. The rest are skipped, never sent later. Covers broadcasts and automations only, and is best effort. |
priorityLanes | Always on: codes, transactional and marketing run on separate queues. |
dailyCaps | Your own limits a day for email, sms and codes (null is no cap). When the email cap is reached, marketing email waits, spread a cap's worth a day (best effort, approximate when sending is heavy). An SMS or a code SMS past its cap is refused with 429. Days are UTC: they reset at 00:00 UTC. |
backupChannel | Saved for your workspace. Nothing is sent by email yet: an SMS sent through the API has no email address to fall back to. |
countryAllowList | SMS, one-time codes included, only to the listed countries (two-letter codes such as NG). Any other SMS, console tests included, is refused with 403, and a queued one is checked again before it is sent. |
One-time codes are never held back by quiet hours or the email caps; a code sent by SMS counts against the codes cap. An email a rule has held for more than 7 days in all fails. Transactional email is held by quiet hours only when appliesTo includes TRANSACTIONAL, and never counted by the caps.
Every message a rule holds, skips or refuses is recorded: the email's events say which rule and when it will go, and held in the answer lists this month's, one line per message, rule and day. For a key limited to one domain, held[].label is empty. Every change is recorded with who made it and the rules before and after, and team admins are emailed when quiet hours widen, skipping turns on or the allow list turns on.
Who can call it
A full access key that is not limited to one domain (rules hold back mail on every domain; 403 DOMAIN_PINNED), made by someone who is a team admin today (403 FORBIDDEN otherwise, and for a key made before Notix recorded who made each key). Read only, send-only and live AI keys answer 403 SCOPE_DENIED. At most 20 changes a minute per team.
Body parameters
At most 64 characters.
One of HOLD, SKIP.
Minimum 1. Maximum 100.
Minimum 1. Maximum 90.
Minimum 1. Maximum 10000000. Can be null.
Minimum 1. Maximum 10000000. Can be null.
Minimum 1. Maximum 10000000. Can be null.
Headers
Bearer followed by your API key.
Errors
The body is not valid, or the rules would not make sense together.
`SCOPE_DENIED`: not a full access key. `DOMAIN_PINNED`: the key is limited to one domain. `FORBIDDEN`: the key was made by a team member without admin rights, or before Notix recorded who made each key.
More than 20 changes for this team in a minute.
Every error has the same shape. See all error codes.
curl -X PATCH "https://app.usenotix.dev/api/v1/sending-rules" \
-H "Authorization: Bearer $NOTIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"quietHours": {
"enabled": true,
"from": "Acme <receipts@acme.com>",
"to": "customer@example.com",
"timezone": "string",
"useContactTimezone": true,
"appliesTo": [
"MARKETING_EMAIL"
],
"action": "HOLD"
},
"frequencyCap": {
"enabled": true,
"max": 1,
"windowDays": 1
},
"dailyCaps": {
"enabled": true,
"email": 1,
"sms": 1,
"codes": 1
},
"backupChannel": {
"enabled": true
},
"countryAllowList": {
"enabled": true,
"countries": [
"string"
]
}
}'
{
"quietHours": {
"enabled": true,
"from": "21:00",
"to": "07:00",
"timezone": "Africa/Lagos",
"useContactTimezone": true,
"appliesTo": [
"MARKETING_EMAIL"
],
"action": "HOLD"
},
"frequencyCap": {
"enabled": true,
"max": 1,
"windowDays": 1
},
"priorityLanes": {
"enabled": true
},
"dailyCaps": {
"enabled": true,
"email": 1,
"sms": 1,
"codes": 1
},
"backupChannel": {
"enabled": true
},
"countryAllowList": {
"enabled": true,
"countries": [
"string"
]
},
"updatedAt": "string",
"rulesOn": 1,
"rulesTotal": 1,
"month": {
"heldBack": 1,
"quietHours": 1,
"frequencyCap": 1,
"dailyCap": 1,
"countryAllowList": 1
},
"today": {
"email": 1,
"sms": 1,
"codes": 1
},
"held": [
{
"firstAt": "string",
"label": "string",
"channel": "EMAIL",
"rule": "QUIET_HOURS",
"outcome": "HELD",
"count": 1,
"releaseAt": "string"
}
]
}