List gateways
const url = 'https://api.nsin.ir/domains/example.com/gateways/';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/ \ --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 request allowance has been used.
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.comResponses
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.
Whether this gateway is currently on for this domain.
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.
Requests served by this domain’s gateways in the window, as of counted_at.
Whether the allowance is currently spent, so the gateways are answering 429.
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" } ], "dns_mode": "managed"}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"}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"}