List gateways
const url = 'https://api.nsin.ir/domains/example.com/gateways/?icons=url';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.nsin.ir/domains/example.com/gateways/?icons=url' \ --header 'Authorization: Bearer <token>'Every gateway currently offered, each with whether it is switched on for
this domain and, when it is, the record that was created for it —
together with this domain’s gateway plan standing: whether gateways are
included at all, and how much of the rolling 30-day allowances
(requests and egress bytes) has been used. Gateways switched on earlier
whose catalog entry has since been withdrawn are listed too, marked
retired, so they can still be switched off. Requires domain.view.
Each entry carries its icon inline as a base64 data: URI, which is
most of the response’s size. Pass icons=url to get a cacheable
icon_url instead (see GET /gateway-presets/{presetId}/icon).
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.comQuery Parameters
Section titled “Query Parameters ”url returns icon_url instead of the inline icon.
Responses
Section titled “ Responses ”Gateway list and quota standing.
The gateway catalog for one domain, plus that domain’s gateway quota.
Gateway traffic is metered separately from the domain’s own traffic: a
plan allows a fixed number of gateway requests per ROLLING 30 days.
There is no reset date — capacity returns gradually as older requests
age out of the window. While the allowance is spent, only the gateway
hostnames stop serving (they answer 429); the rest of the domain is
unaffected.
object
One entry in the gateway catalog, plus whether it is switched on for the domain you asked about. The origin and upstream Host header behind a gateway are NSIN’s and are not exposed.
object
Pass this as gatewayId to switch the gateway on or off.
Display name.
Prefix of the generated hostname — the record is named <slug>-<5 digits>.
Short explanatory line. May be empty.
The service this gateway forwards to, e.g. api.openai.com. Sent as
the Host header upstream. The origin address behind it is not
exposed.
Icon as a base64 data: URI, ready to use as an <img> source. May
be empty. Empty when the list was asked for with icons=url.
Only with icons=url: the icon’s content-addressed path on the API
origin (/gateway-presets/{id}/icon?v=…), cacheable for a year.
Empty when the gateway has no icon.
Group the gateway is filed under on the Gateways page. Empty means uncategorised.
Whether this gateway is currently on for this domain.
The gateway is on but its hostname is answering 429 right now,
because the domain’s gateway allowance is spent (or its plan no
longer includes gateways).
The gateway is no longer offered but is still on for this domain. It keeps working and can be switched off; it cannot be switched on again.
The record created for this gateway. Absent when enabled is false.
object
Record id.
Name relative to the domain, e.g. chatgpt-84213.
Fully qualified name, e.g. chatgpt-84213.example.com.
Whether the domain’s plan includes gateways. When false, switching a new gateway on is refused; gateways already on stay listed and can still be switched off.
Requests allowed in the rolling 30-day window. Null means unlimited.
Egress allowed in the rolling 30-day window, in GB. Null means unlimited.
Requests served by this domain’s gateways in the window, as of
counted_at. The 429s the quota itself produces are not counted.
Egress bytes served by the gateways in the same window. A meter for the allowance, not a separate charge — the bytes are billed as the domain’s ordinary traffic.
Whether an allowance is currently spent, so the gateways are answering 429.
Which allowance ran out. Absent while neither has.
When the count was last recomputed. Absent before the first count.
This domain’s DNS mode. Gateways need managed: on an external
domain the record would live in a zone NSIN does not serve, so
switching one on is refused whatever the plan says. Gateways already
on stay listed and can still be switched off.
Example
{ "items": [ { "upstream": "api.push.apple.com", "icon_url": "/gateway-presets/12/icon?v=3kx9q1m2r7a" } ], "quota_reason": "requests", "dns_mode": "managed"}Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid 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.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
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"}