Change a forwarding rule
Change any field of a rule.
https://app.usenotix.dev/api/v1/forwarding-rules/{id}Needs a full access key. Sending access keys cannot call this. Key permissions lists the extra rules some calls have.
Change any field of a rule. Only the fields you send change, and the whole rule is checked again as it would be saved. Send "paused": false to resume a rule Notix paused, after you have looked at its log.
Who can call it
A full access key made by a team admin, as on the dashboard. Every refusal is 403:
| Code | Why |
|---|---|
SCOPE_DENIED | The key is not a full access key (send-only, read only or live AI). |
FORBIDDEN | The key was made by a team member without admin rights, or before Notix recorded who made each key. Create a new key as a team admin. |
DOMAIN_PINNED | The key is limited to one domain and the rule is on another, or the rule sends to a webhook. |
Path parameters
Body parameters
A label for the rule.
At most 80 characters.
The receiving addresses the rule forwards: one address (billing@reply.acmepay.com), every address on a domain (*@reply.acmepay.com, needs confirmCatchAll), or addresses that start with a prefix (orders-*@reply.acmepay.com). The domain must be one your team receives email on.
At least 3 characters. At most 320 characters.
Up to 10 forwarding address ids from POST /v1/forwarding-destinations. Only confirmed addresses receive forwards.
Also send each matching message to this webhook of yours as an email.received event, whatever events it subscribes to. Not for a key limited to one domain.
At most 64 characters. Can be null.
The address forwards are sent from, on one of your verified sending domains. Leave it out to send from the receiving address, which then has to be on a verified sending domain too. Forwards are never sent as the original sender, who is set as Reply-To.
At most 254 characters. Can be null.
Text put in front of each forwarded subject. Off by default.
At most 40 characters. Can be null.
Allow forwarding addresses on a domain your team also receives on. Off by default, because that can start a loop.
true (the default): forward each message exactly as it arrived. false: send it like an email client's forward, with note on top, then a Forwarded message block (From, Date, Subject, To, Cc) above the original, and Fwd: on the subject. Attachments go either way.
Plain text shown above the Forwarded message block when passthrough is false. At most 2,000 characters; ignored when passthrough is true.
At most 2,000 characters. Can be null.
Whether the rule forwards. A rule that is off is skipped.
Lower numbers are tried first. The first matching rule that is on forwards the message. Default 100.
Minimum 0. Maximum 10000.
Required as true for a pattern like *@reply.acmepay.com, which forwards every email the domain receives.
false resumes a rule Notix paused; true pauses it by hand.
Headers
Bearer followed by your API key.
Errors
No field given, a field the route does not know, or the changed rule is refused.
`SCOPE_DENIED`: not a full access key. `FORBIDDEN`: the key was made by a team member without admin rights, or before Notix recorded who made each key. `DOMAIN_PINNED`: the pattern or the webhook is outside the key's one domain.
No rule with this id for the calling team, or outside a pinned key's domain.
Another rule of the team already has this pattern.
The team changed rules 30 times in the last minute.
Notix cannot count the team's calls just now; try again shortly.
Every error has the same shape. See all error codes.
curl -X PATCH "https://app.usenotix.dev/api/v1/forwarding-rules/<id>" \
-H "Authorization: Bearer $NOTIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Billing to finance",
"pattern": "billing@reply.acmepay.com",
"destinationIds": [
"clx9f2k3l0002qz8a7b6c5d4e"
],
"webhookId": null,
"fromAddress": "support@acmepay.com",
"subjectPrefix": "[Acme]",
"allowChaining": true,
"passthrough": false,
"note": "For the accounts team. Please check the total.",
"active": true,
"priority": 10,
"confirmCatchAll": true,
"paused": true
}'
import { Notix } from "notix-js";
const notix = new Notix(process.env.NOTIX_API_KEY);
// Resume a rule Notix paused, after reading its log.
const { data, error } = await notix.forwarding.updateRule("clx9f2k3l0001qz8a7b6c5d4e", { paused: false });
{
"id": "cm1x8f3k20001qz7v5b9d2e4a",
"name": "Acme",
"pattern": "billing@reply.acmepay.com",
"patternType": "EXACT",
"receivingDomain": "reply.acmepay.com",
"destinations": [
{
"id": "cm1x8f3k20001qz7v5b9d2e4a",
"email": "customer@example.com",
"status": "PENDING"
}
],
"webhookId": "cm1x8f3k20001qz7v5b9d2e4a",
"fromAddress": "string",
"subjectPrefix": "Your receipt for order 4471",
"allowChaining": true,
"passthrough": true,
"note": "string",
"active": true,
"priority": 1,
"paused": true,
"pausedAt": "string",
"pauseReason": "string",
"createdAt": "string",
"updatedAt": "string"
}