Skip to content

Redeem an enrollment code for a certificate

POST
/api/certs/service/retrieve
curl --request POST \
--url https://example.com/api/certs/service/retrieve \
--header 'Content-Type: application/json' \
--data '{}'

Signs and returns a service certificate for the enrollment the code identifies, using the public key and options fixed at approval time. Codes are reusable until the enrollment expires; every redemption is logged for the approving user and auditors. The certificate is valid from now until the enrollment’s expiry.

The enrollment code to redeem

Media typeapplication/json
One of:
object

Example generated

{}

The signed service certificate

Media typeapplication/json
object
data
required
object
certificate
required
string
error
string

Example generated

{
"data": {
"certificate": "example"
},
"error": "example"
}

Unknown or expired enrollment code

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}

Signing failed or timed out

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}