Skip to content

Unlock the managed records

POST
/domains/{domain}/email-routing/unlock
curl --request POST \
--url https://api.nsin.ir/domains/example.com/email-routing/unlock \
--header 'Authorization: Bearer <token>'

Makes the MX/SPF/DKIM rows editable through the record endpoints so you can migrate away at your own pace. Routing keeps working while the records still exist; status becomes unlocked. Requires domain.settings.

domain
required
string

The domain name (for example example.com) — not a numeric id.

Example
example.com

Records unlocked; the status.

Media type application/json
object
enabled
boolean
status
string
Allowed values: unconfigured ready misconfigured unlocked suspended
hosts_ready

At least one mail host has checked in recently. Enable is refused while false.

boolean
locked

The managed records are not editable.

boolean
subaddressing
boolean
suspended_reason
string
catch_all
object
enabled
boolean
action
string
Allowed values: forward drop
destination_id
integer
nullable
destination_email
string
nullable
destination_verified
boolean
dns
object
checked_at
string format: date-time
nullable
ok
boolean
records
Array<object>
object
type
string
Allowed values: MX TXT
name

Relative to the domain; @ is the apex.

string
content
string
priority
integer
ttl
integer
state

extra is a foreign MX or a second SPF seen publicly.

string
Allowed values: ok missing extra unchecked
record_id

The managed record’s id, when the row is ours.

integer
problems
Array<string>
conflicts

Only while unconfigured — what enable would have to remove or merge.

object
mx
Array<object>
object
id
integer
name
string
content
string
priority
integer
spf
object
record_id
integer
content
string
merged
string
spf_multiple
boolean
previous_mx_available

Enable removed MX records that disable can restore.

boolean
counts_24h
object
received

Every message except discarded bounces.

integer
forwarded
integer
dropped
integer
rejected
integer
deferred
integer
limits
object
max_rules
integer
nullable
rules_used
integer
max_forwards_per_day
integer
nullable
forwards_today
integer
dkim

Always present. Before Email Routing is enabled the selector and name are already known (they come from platform settings) and txt is empty, because the key is generated at enable time.

object
selector
string
name

The TXT name relative to the domain.

string
txt
string
platform
object
mx_hosts
Array<object>
object
host
string
priority
integer
spf_include
string
forward_domain
string
Example
{
"status": "unconfigured",
"catch_all": {
"action": "forward"
},
"dns": {
"records": [
{
"type": "MX",
"state": "ok"
}
]
}
}

Missing, malformed, revoked or expired API key — or the owning account is inactive.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example invalidKey
{
"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.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

Email routing is not enabled on this domain (conflict: not_enabled).

Media type application/json
object
error
required

Human-readable description of what went wrong.

string
conflict

What conflicts (mx, spf, spf_multiple, external_dns, domain_status, not_enabled, local_part, destination).

string
records

For mx / spf_multiple — the rows in the way.

Array<object>
object
id
integer
name
string
content
string
priority
integer
record_id

For spf — the existing SPF row.

integer
content

For spf — its current value.

string
merged

For spf — what it becomes with our include merged in.

string
destination

For destination — the existing row.

object
id
integer
email
string
verified
boolean
verified_at
string format: date-time
nullable
created_at
string format: date-time
last_sent_at

When the last verification mail went out.

string format: date-time
nullable
resend_cooldown_seconds

Seconds until another verification mail may be sent; 0 when allowed now.

integer
in_use

Rules and catch-alls pointing at it.

integer
last_failure

The receiving server’s last refusal, when forwards to it are bouncing.

string
last_failure_at
string format: date-time
nullable
Example
{
"error": "read-only API key"
}

The key exceeded its request budget (300 requests per minute by default).

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example limited
{
"error": "rate limit exceeded"
}