Custom Certificates
On this page, we'll dive into the different custom certificate endpoints you can use to manage custom certificates programmatically. We'll look at how to query, create, update, and delete custom certificates.
The custom certificate model
The custom certificate model contains all the information about your custom certificates.
Properties
- Name
uuid
- Type
- string
- Description
Unique identifier for the custom certificate.
- Name
expires_at
- Type
- timestamp
- Description
The expiration date and time of the certificate.
- Name
not_before
- Type
- timestamp
- Description
The date and time before which the certificate is not valid.
- Name
fingerprint
- Type
- string
- Description
The fingerprint of the certificate, used for verification.
- Name
issuer
- Type
- string
- Description
The issuer of the certificate, containing information about the certificate authority.
- Name
public_key_sha
- Type
- string
- Description
The SHA-1 hash of the public key.
- Name
sans
- Type
- array
- Description
An array of Subject Alternative Names (SANs) included in the certificate.
- Name
serial_number
- Type
- string
- Description
The serial number of the certificate.
- Name
signature_algorithm
- Type
- string
- Description
The algorithm used to sign the certificate.
- Name
subject
- Type
- string
- Description
The subject of the certificate, containing information about the entity the certificate belongs to.
- Name
created_at
- Type
- timestamp
- Description
The date and time when the certificate was created in SaaS Custom Domains.
Retrieve all
This endpoint allows you to retrieve a paginated list of all custom certificates belonging to an account. By default, 20 custom certificates are shown per page.
Optional attributes
- Name
page
- Type
- integer
- Description
The page number to retrieve. Default value is
1
.
- Name
per_page
- Type
- integer
- Description
The number of items to retrieve per page. Default value is
20
.
Request
curl -G https://app.saascustomdomains.com/api/v1/accounts/:account_uuid/custom_certificates \
-H "Authorization: Bearer {token}" \
-d page=7
Response
{
"data": [
{
"uuid": "cert_1",
"expires_at": "2098-12-31T18:00:00.000-06:00",
"not_before": "2019-12-31T18:00:00.000-06:00",
"fingerprint": "abcdef1234567890abcdef1234567890abcdef12",
"issuer": "CN=Example CA, O=Example Org, C=US",
"public_key_sha": "abcdef1234567890abcdef1234567890abcdef12",
"sans": ["example.com", "www.example.com"],
"serial_number": "1234567890",
"signature_algorithm": "sha256WithRSAEncryption",
"subject": "CN=example.com, O=Example Org, C=US",
"created_at": "2024-07-19T04:48:27.000-05:00"
},
{
"uuid": "cert_2",
// ...
},
// ...
],
"pagination": {
"page": 7,
"count": 322
}
}
Retrieve
This endpoint allows you to retrieve a custom certificate by providing its UUID. Refer to the list at the top of this page to see which properties are included with custom certificate objects.
Request
curl https://app.saascustomdomains.com/api/v1/accounts/:account_uuid/custom_certificates/:certificate_uuid \
-H "Authorization: Bearer {token}"
Response
{
"uuid": "cert_1",
"expires_at": "2098-12-31T18:00:00.000-06:00",
"not_before": "2019-12-31T18:00:00.000-06:00",
"fingerprint": "abcdef1234567890abcdef1234567890abcdef12",
"issuer": "CN=Example CA, O=Example Org, C=US",
"public_key_sha": "abcdef1234567890abcdef1234567890abcdef12",
"sans": ["example.com", "www.example.com"],
"serial_number": "1234567890",
"signature_algorithm": "sha256WithRSAEncryption",
"subject": "CN=example.com, O=Example Org, C=US",
"created_at": "2024-07-19T04:48:27.000-05:00"
}
Delete
This endpoint allows you to delete custom certificates.
Request
curl -X DELETE https://app.saascustomdomains.com/api/v1/accounts/:account_uuid/custom_certificates/:certificate_uuid \
-H "Authorization: Bearer {token}"
Response
{
"message": "Custom certificate cert_1 deleted."
}