Upload Certificate
This method allows uploading a custom certificate for a specified domain.
info
To successfully upload the certificate, ensure the certificate file begins with one of the following headers:
-----BEGIN CERTIFICATE-----
-----BEGIN X509 CERTIFICATE-----
-----BEGIN TRUSTED CERTIFICATE-----
And ends with the corresponding closing tag:
-----END CERTIFICATE-----
-----END X509 CERTIFICATE-----
-----END TRUSTED CERTIFICATE-----
Request Parameters
POST /api/clients/v1/domains/{id}/uploadCertificate/
Headers
- Content-Type: application/json
- Authorization: Bearer
$access_token
Path
| Parameter | Type | Constraints | Description | Example |
|---|---|---|---|---|
| id | integer | > 0, required | Domain ID | 1 |
JSON body
| Parameter | Type | Constraints | Description |
|---|---|---|---|
| cert | string | Required | Certificate |
| ca_cert | string | Required | Root certificate |
| key | string | Required | Certificate private key |
| password | string | 0 < password < 256 | Password for the certificate key |
Response Parameters
JSON body
| Parameter | Type | Description |
|---|---|---|
| domain_id | integer | Domain ID |
| domain_name | string | Domain name |
| is_custom | boolean | Indicates the certificate was uploaded manually |
| issuer | string | Certificate issuer |
| serial | string | Certificate serial number |
| issue_date | datetime | Certificate issue date |
| expiry_date | datetime | Certificate expiration date |
Examples
200 OK
Certificate uploaded
{
"domain_id": 1,
"domain_name": "example.com",
"is_custom": false,
"issuer": "C = US, O = Let's Encrypt, CN = Artificial Apricot R3",
"serial": "2B9C69E943BE4ECD9945FB0E9C05C0316FEG",
"issue_date": "2024-05-17T15:46:40.108Z",
"expiry_date": "2024-08-17T15:46:40.108Z"
}
400 Bad Request
Invalid path or body parameters provided
{
"id": [
"A valid integer is required."
],
"detail": [
"The key does not match the certificate",
"The CA certificate does not match the domain certificate",
"Invalid SSL cert content",
"Invalid SSL private key content",
"The certificate does not match the domain name",
"The certificate has expired",
"Certificate password is too long, max length: 256"
]
}
401 Unauthorized
Authentication credentials are missing or invalid
{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid or expired"
}
]
}
403 Forbidden
Only project participants can upload the certificate
{
"detail": "Only project participants can upload certificates"
}
404 Not Found
Domain with the specified ID not found
{
"detail": "Domain not found"
}
409 Conflict
certificate already exists
{
"detail": "Certificate cannot be uploaded due to a conflict"
}