Update an email address
const url = 'https://api.nsin.ir/domains/example.com/email-routing/rules/1';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"local_part":"example","action":"forward","destination_id":1,"name":"example","enabled":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.nsin.ir/domains/example.com/email-routing/rules/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "local_part": "example", "action": "forward", "destination_id": 1, "name": "example", "enabled": true }'Omitted fields are untouched. Same rules as create. Requires records.edit.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The domain name (for example example.com) — not a numeric id.
Example
example.comNumeric id of the email address rule, from the rule list.
Request Body required
Section titled “Request Body required ”object
Required for forward; from the domain owner’s account.
Update only; create always starts enabled.
Responses
Section titled “ Responses ”The updated rule.
object
The full address, local_part@domain.
Your switch.
Whether the address is live right now — enabled, routing on for the
domain, and (for forward) the destination verified.
Optional label.
Example
{ "action": "forward"}Invalid local part, action or destination (field names it).
object
Human-readable description of what went wrong.
Machine-readable reason (hosts_not_ready, kek_unset, loop, no_mx, unverified).
The offending body field, when one applies.
Example
{ "error": "read-only API key"}Missing, malformed, revoked or expired API key — or the owning account is inactive.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid API key"}The key is read-only, your role on the domain lacks the required permission, or the domain’s plan does not include the feature.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}No such domain, or no such rule on it.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}An address with this local part already exists (conflict: local_part).
object
Human-readable description of what went wrong.
What conflicts (mx, spf, spf_multiple, external_dns, domain_status, not_enabled, local_part, destination).
For mx / spf_multiple — the rows in the way.
object
For spf — the existing SPF row.
For spf — its current value.
For spf — what it becomes with our include merged in.
For destination — the existing row.
object
When the last verification mail went out.
Seconds until another verification mail may be sent; 0 when allowed now.
Rules and catch-alls pointing at it.
The receiving server’s last refusal, when forwards to it are bouncing.
Example
{ "error": "read-only API key"}The key exceeded its request budget (300 requests per minute by default).
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "rate limit exceeded"}