Issue a certificate from one of the organization's authorities with a newly generated key, either stored in ZanPKI or returned once for download.
POST /organizations/{organizationId}/certificates
POST https://zanpki.com/organizations/{organizationId}/certificates
| Operation ID |
organizations.organizationId.certificates.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
| Name | In | Type | Description | |
|---|---|---|---|---|
organizationId
| Path | Required | string (snowflake) | Organization ID. |
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: IssueCertificateBody
| Property | Type | Description | |
|---|---|---|---|
issuances_name
| string | Required | Display name for the certificate in ZanPKI (up to 100 characters). Exported files are named after it. |
issuances_common_name
| string | Required | The subject common name (CN), such as a hostname. |
country
| string, or null | Optional | Two-letter ISO country code, such as US. |
state
| string, or null | Optional | The subject's state or province, up to 64 characters; empty for none. |
city
| string, or null | Optional | The subject's city or locality, up to 64 characters; empty for none. |
organization
| string, or null | Optional | Company or organization name in the certificate subject (up to 64 characters), or empty if none. |
unit
| string, or null | Optional | A department or team within the subject's organization, up to 64 characters; empty for none. |
email
| string (email), or null | Optional | Email address in the certificate subject, or empty if none. Must be permitted by the signing authority and its issuer chain. |
issuances_profile
| one of: 1, 2, 3, 4 | Required | Certificate profile that sets its X.509 key purposes: 1 for TLS server (website, service, or VPN), 2 for mTLS client (service), 3 for VPN user (client authentication), or 4 for TLS server and client (both directions). Pass null when searching to match any profile. |
issuances_profile_id
| string (snowflake), or null | Optional | ID of the organization's custom profile derived from the base profile, or null if using a built-in ZanPKI profile or if the custom profile was deleted. |
issuances_authority_id
| string (snowflake) | Required | ID of the organization's authority that signed the certificate, or null for an imported certificate not signed by any of the organization's authorities. |
issuances_key_type
| one of: 1, 2, 3, 4, 5, 6, 7, 8, 9 | Required | Key algorithm and size. RSA 4096 is the default, because every browser and almost all software accept it. ML-DSA-87 is the strongest level of ML-DSA, the post-quantum signature standard. In our tests, Chrome accepted ML-DSA certificates, but Safari and Java refused them, and Firefox hasn't been tested, so use ML-DSA only where you control the software that checks the certificate. Choose an elliptic curve only for clients that need one. Chrome doesn't accept an EC P-521 website certificate. |
issuances_digest
| one of: 1, 2, 3, 4, null | Optional | Signature hash algorithm used by the signing authority. Leave it empty to use the profile's digest, or, if the profile has none, to match the authority's key: SHA-384 for RSA 4096 and EC P-384, SHA-512 for EC P-521, and SHA-256 for RSA 2048, RSA 3072, and EC P-256. An ML-DSA authority always signs with pure ML-DSA, which has no separate hash. |
sans
| string, or null | Optional | DNS names, IP addresses, email addresses, or URIs separated by spaces, commas, or newlines. Server certificates require at least one DNS name or IP address. |
days
| integer (int32) | Required | Certificate validity period in days from now (1 to 825, default 397). The certificate must expire before its signing authority expires. |
holds_private_key
| boolean | Optional | If turned off, the private key is not stored in ZanPKI and is only available for a single download (with the certificate and issuer chain) within one minute. |
Responses
| Status | Description | Schema | Content type |
|---|---|---|---|
| 201 | Certificate issued. | ||
| 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.
| Property | Type | Description | |
|---|---|---|---|
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.
| Property | Type | Description | |
|---|---|---|---|
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.
| Property | Type | Description | |
|---|---|---|---|
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}/certificates' \
-H 'Authorization: Bearer <access token>' \
-H 'Content-Type: application/json' \
-d '{
"issuances_name": "<string>",
"issuances_common_name": "<string>",
"issuances_profile": "<one of: 1, 2, 3, 4>",
"issuances_authority_id": "<string (snowflake)>",
"issuances_key_type": "<one of: 1, 2, 3, 4, 5, 6, 7, 8, 9>",
"days": "<integer (int32)>"
}'