Choose which certificate the edge serves
const url = 'https://api.nsin.ir/domains/example.com/ssl/certificates/1/select';const options = {method: 'POST', 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 POST \ --url https://api.nsin.ir/domains/example.com/ssl/certificates/1/select \ --header 'Authorization: Bearer <token>'Makes this certificate the one served, for every hostname of the domain it covers. Hostnames it does not cover keep whatever they were serving. Edge nodes are told to drop the affected hostnames immediately, so the change is live within seconds.
Selecting the certificate NSIN manages (managed: true) returns the
hostname to automatic: each renewal is served as soon as it is issued.
Selecting an uploaded one pins it — renewals keep running underneath and
stay available to switch back to, but they are not served while the pin
is in place. Requires ssl.manage.
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.comThe id of a certificate from GET /domains/{domain}/ssl/certificates.
Responses
Section titled “ Responses ”Selected. hostnames lists the names that changed over.
object
Example generated
{ "message": "example", "hostnames": [ "example" ]}The certificate cannot serve: expired, no stored private key, not trusted, or it covers none of this domain’s hostnames.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
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 certificate for this domain.
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"}