Ask NSIN to issue a certificate as well
const url = 'https://api.nsin.ir/domains/example.com/ssl/certificates/request';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/request \ --header 'Authorization: Bearer <token>'Uploading a certificate keeps its hostnames out of every automatic order — NSIN must not silently replace material you installed on purpose — so a domain that uploaded before NSIN ever issued for it has no certificate of ours at all, and nothing to choose between. This asks for one.
Your certificate keeps serving throughout: the new one fills the
automatic slot behind it, and you switch over with
POST /domains/{domain}/ssl/certificates/{certificateId}/select when
you are ready. From then on the name stays in our renewals, so whichever
one you are not serving stays valid.
Returns immediately with status: "pending"; poll
GET /domains/{domain}/ssl/certificates. Requires ssl.manage and a
plan that includes custom certificates.
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 ”Issuance started.
object
Example
{ "status": "pending"}NSIN already holds a certificate for this domain (select it
instead), or an external-DNS domain has not delegated
_acme-challenge yet.
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"}Read-only key, insufficient role, or the plan does not include custom certificates.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
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.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}A certificate has already been requested and is on its way.
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"}The certificate issuer is temporarily unavailable.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}