Update a Website's SSL Certificate
Updates the SSL certificate for a website.
URL
/api/v1/website/[website_id]
HTTP Method
PUT
URL Parameters
Parameter |
Required |
Type |
Description |
---|---|---|---|
website_id |
true |
integer |
Specifies the website ID to update the certificate for. |
PUT Parameters
Parameter |
Required |
Type |
Description |
Acceptable Values |
---|---|---|---|---|
key_pem |
true |
string containing PEM encoded cert with proper newlines |
SSL private key |
|
cert_pem |
true |
string containing PEM encoded cert with proper newlines |
SSL public key/certificate |
|
ca_pem |
false |
string containing PEM encoded cert with proper newlines |
SSL authority certificate(s) chain |
|
passphrase |
false |
string |
Passphrase |
|
validate_chain |
false |
string containing integer |
Whether to validate the chain. |
"0" → Don't validate |
Response Parameters
Returns a string indicating success/error.
Example: Update SSL certificate for website 1
Request
/api/v1/website
curl -kv
-u api_ninja:ninja_password
-X PUT
-H 'Content-Type: text/json'
--data-binary @updateSSLcert.json
https://172.31.1.172:4849/api/v1/website/1
PUT Parameters
{ "key_pem": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBA . . . wBygvM0FOokt\n-----END RSA PRIVATE KEY-----", "cert_pem": "-----BEGIN CERTIFICATE-----\nMIID+j . . . otyBZ0ags=\n-----END CERTIFICATE-----", "passphrase": "optional_key_passphrase", "validate_chain": "0" }
Response
{"result":"success"}
Example: Update SSL certificate for website 1 with SSL authority certificate chain, and validate the chain
Request
/api/v1/website
curl -kv
-u api_ninja:ninja_password
-X PUT
-H 'Content-Type: text/json'
https://172.31.1.172:4849/api/v1/website/1
PUT Parameters
{ "key_pem": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBA . . . wBygvM0FOokt\n-----END RSA PRIVATE KEY-----", "cert_pem": "-----BEGIN CERTIFICATE-----\nMIID+j . . . otyBZ0ags=\n-----END CERTIFICATE-----", "passphrase": "optional_key_passphrase", "ca_pem": "-----BEGIN CERTIFICATE-----\nMIIaowIBA . . . wBygvMkFOokt\n-----END CERTIFICATE-----", "validate_chain": "1" }
Response
{"result":"success"}