Skip to content

Choose which certificate the edge serves

POST
/domains/{domain}/ssl/certificates/{certificateId}/select
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.

domain
required
string

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

Example
example.com
certificateId
required
integer

The id of a certificate from GET /domains/{domain}/ssl/certificates.

Selected. hostnames lists the names that changed over.

Media type application/json
object
message
string
hostnames
Array<string>
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.

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"
}

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 certificate for this domain.

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"
}

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"
}