Request a certificate from an external issuer for a confirmed domain. It is ordered immediately and renewed automatically before it expires.

POST /organizations/{organizationId}/external_issuers/domains/{domainId}/certificates/new/{issuer}

POST https://zanpki.com/organizations/{organizationId}/external_issuers/domains/{domainId}/certificates/new/{issuer}

Operation ID organizations.organizationId.external_issuers.domains.domainId.certificates.new.issuer.post
Access Browser session signed in through ZanAuth, using the access token cookie alongside its ID token and refresh token cookies. Or: An access token issued for this site by its ZanAuth issuer, or a static key.

Parameters

NameInTypeDescription
organizationId Path Required string (snowflake) Organization ID.
domainId Path Required string (snowflake) Domain ID.
issuer Path Required one of: 2, 3, 4 External issuer ID: 2 (Let's Encrypt), 3 (ZeroSSL), or 4 (Google Trust Services).
Idempotency-Key Header Optional string This key identifies one request so that sending it again does not carry it out twice. Use a new random value, such as a UUID, for each new request, and send the same value again only with that same request. If you send the same request again with the same key within 10 minutes of the first response, and the first request was carried out, it is not carried out again. Instead, the server returns the first response, or HTTP 409 if that response was too large to keep. The same request means the same method, path, query, body, and Accept header, sent the same way (both as plain HTTP or both as an AI agent's tool call) by the same signed-in person or program, or from the same IP address if you are not signed in. If the first request was refused or failed, sending it again with the same key runs it again. If the first request is still being processed, the server returns HTTP 409. Wait a few seconds, then send the request again with the same key. If the same caller uses the same key for a different request to the same operation, the server returns HTTP 422. The key must be 1 to 255 printable ASCII characters long. If the server cannot record the key, for example during a database fault, the request is carried out without this check.

Request body

Required, sent as application/x-www-form-urlencoded, application/json.

Schema: AskForDomainCertificateBody

PropertyTypeDescription
certificates_requested_names string Required Requested DNS names for a certificate from an external issuer, one per line (the apex domain, subdomains, or wildcards such as *.acme.com). Searches match substrings.
certificates_key_type one of: 1, 2, 3, 4, 5, 6, 7, 8, 9 Required Key type generated for each order, chosen from the types supported by the issuer.
certificates_issuer_profile string, or null Optional Name of a certificate profile offered by the issuer's ACME directory (such as Let's Encrypt's classic), or null to use the issuer's default.
certificates_lifetime_days integer, or null Optional Certificate validity period in days (1 to 90) for issuers that support custom lifetimes (such as Google Trust Services), or null to use the default (90 days).

Responses

StatusDescriptionSchemaContent type
201 Certificate requested. The Location header points to the domain page.
403 Your roles do not permit this action. Problem application/json
422 The request input was rejected. The errors object lists each validation failure. ValidationProblem application/json
Any other status The request was rejected. The problem type identifies the error, and the detail field provides a human-readable explanation. Problem application/json

403 Your roles do not permit this action.

PropertyTypeDescription
type string Required A URL that identifies the kind of problem. Its last segment, such as auth_required or input_invalid, is the code your app should check.
title string Required The HTTP status as text, such as Not Found.
status integer (int32) Required The HTTP status code of the response.
detail string Required A human-readable explanation of what went wrong.
instance string Required The path the request was sent to.

422 The request input was rejected. The errors object lists each validation failure.

PropertyTypeDescription
type string Required A URL that identifies the kind of problem. Its last segment, such as auth_required or input_invalid, is the code your app should check.
title string Required The HTTP status as text, such as Not Found.
status integer (int32) Required The HTTP status code of the response.
detail string Required A human-readable explanation of what went wrong.
instance string Required The path the request was sent to.
errors InputErrors Required Validation errors for each rejected value. Parameter errors are returned as a list, and body errors as a tree matching the request body structure.

Any other status: The request was rejected. The problem type identifies the error, and the detail field provides a human-readable explanation.

PropertyTypeDescription
type string Required A URL that identifies the kind of problem. Its last segment, such as auth_required or input_invalid, is the code your app should check.
title string Required The HTTP status as text, such as Not Found.
status integer (int32) Required The HTTP status code of the response.
detail string Required A human-readable explanation of what went wrong.
instance string Required The path the request was sent to.

Example

curl -X POST 'https://zanpki.com/organizations/{organizationId}/external_issuers/domains/{domainId}/certificates/new/{issuer}' \
  -H 'Authorization: Bearer <access token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "certificates_requested_names": "<string>",
    "certificates_key_type": "<one of: 1, 2, 3, 4, 5, 6, 7, 8, 9>"
}'

All documentation