POST/v2/certificates

Create a certificate

Creates a certificate from a user-generated certificate and private key or requests one from Let's Encrypt. Set type to custom and provide private_key and leaf_certificate, or set it to lets_encrypt and provide dns_names; both request types require name. A Let's Encrypt certificate starts in the pending state and transitions to verified when it is ready to use.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

3 body fields

Certificate creation details. Provide name and the fields for either a custom certificate or a Let's Encrypt certificate.

namestringrequired
A unique human-readable name referring to a certificate.
typestringoptional
A string representing the type of the certificate. The value will be `custom` for a user-uploaded certificate or `lets_encrypt` for one automatically generated with Let's Encrypt.
Allowed:customlets_encrypt
dns_namesarray<string>required
An array of fully qualified domain names (FQDNs) for which the certificate was issued. A certificate covering all subdomains can be issued using a wildcard (e.g. `*.example.com`).

5 status codes
201Returns the created certificate object, including its identifier, name, expiration date, fingerprint, DNS names, state, and type. A Let's Encrypt certificate initially has a `pending` state and transitions to `verified` when issued.
certificateobjectoptional
401Returned when authentication credentials are invalid.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429Returned when the API rate limit has been exceeded.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500Returned when a server error occurs.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
defaultThere was an unexpected error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.

Error handling

A 401 is returned when authentication credentials are invalid. A 429 is returned when the API rate limit has been exceeded, and a 500 indicates a server error. Provide name and choose a matching request type: custom requires private_key and leaf_certificate, while lets_encrypt requires dns_names.