Add SSL certificate

PUT /ssl-certs/:domain

Associate one or multiple domains with the certificate provided. See the SSL guide for more information. This endpoint is available to API users with the system-owner or brand-admin roles. The brand-admin role is restricted to domains mapped to sites associated with their brand. Only use this endpoint over HTTPS.

You can provide the certificate chain as the cert but it must be in reverse order (as is typical for nginx). The first certificate must correspond to the provided private key.

From 7.104 you can also specify the intermediates using the parameter intermediates. If intermediates is populated intermediates provided on cert will be ignored.

The private key must begin with -----BEGIN PRIVATE KEY----- and end with -----END PRIVATE KEY-----. In 7.95, RSA PRIVATE KEY is also accepted.

Input

key string Required. PEM formatted private key.
cert string Required. PEM formatted certificate.
domains Array List of additional domains.
intermediates Array List of intermediates.
Content-Type: application/json
{
    "cert": "-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJAJzF83HrOtgIMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwNzI3MTQ1NzI4WhcNMTYwODA2MTQ1NzI4WjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEA5k3MeLJUSK52Oqzz5vdNVZOqkLJNUZueLomO+fMFJXhAGjfFZPkgLD+B\nbNWxHD/AcydOe31tJvD0TAH4gFz+wpVk3DA50KN5crN69YQrUQHvYxOxSBUq+TXB\n8vvL+3/W1JzvwY6r4jUVpLwQaUsfUWxWner0CG9cbrK3dK6nSAhdIzuh2NMwINbs\nyNEv/QXuH0UYpcBNuzYJPwsNzpIoqQSCu2l43E9n1zNRBK7AjkYH4bpZWiGdYLlO\neRqTkSpGg7KmeyQt+8q59n0IUOhR+6R/xz1Fsm9ZhPiEeO9a78d7qaNqWqNrnP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k82UOdJR3BRS8BqDKbRAktxTd35jaCdca/f3mkvrZ7a6jYgs7iD/xlaGtS6vTkz\nbZArr0TwEz+uvMU4YTtaMCA=\n-----END PRIVATE KEY-----",
    "domains": ["mydomain.com", "yourdomain.co.uk"]
}

Response

Status: 204 OK

Remove certificate

DELETE /ssl-certs/:domain

Remove domain association with a certificate. This endpoint is available to API users with the system-owner or brand-admin roles. The brand-admin role is restricted to domains mapped to sites associated with their brand. Only use this endpoint over HTTPS.

This endpoint was added in 7.94.

Response

Status: 204 OK

Add domain validation

POST /ssl-certs/:domain/domain-validation

Add domain validation key and value for certificate authorities to validate domain ownership.

Input

hash string Required. Hash key.
content string Required. Content value.
Content-Type: application/json
{
    "hash": "v77kf9su7gz680vrwv8q0z39vy9prk4z",
    "content": "vxnjsk4f19mtx66fitv4mbcrfkplxwx8",
}

Response

Status: 204 OK

Example

Endpoint call

POST /ssl-certs/mydomain.com/domain-validation
{
    "hash": "foo",
    "content": "vxnjsk4f19mtx66fitv4mbcrfkplxwx8",
}

Check validation

GET http://mydomain.com/.well-known/pki-validation/fileauth/foo

vxnjsk4f19mtx66fitv4mbcrfkplxwx8