Endurance

ACME certificates

Certificates

GET /acme/certificates

List the ACME certificates

curl
curl -X GET "https://appliance.example.com/api/v1/acme/certificates" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/acme/certificates';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/acme/certificates", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/acme/certificates', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "ACME Certificates",
  "data": []
}

POST /acme/certificates

Add a new ACME certificate. Required: accountId, commonName. Optional: description, altNames, challengeTypeId, autoRenew, renewalInterval, keyLength.

This change is staged. Send PUT /services/apply to apply it.

curl
curl -X POST "https://appliance.example.com/api/v1/acme/certificates" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/acme/certificates';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.post("https://appliance.example.com/api/v1/acme/certificates", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/acme/certificates', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "ACME Certificate Added",
  "data": {
    "id": "<id>"
  }
}

By ID

GET /acme/certificates/{id}

Get an ACME certificate

Path parameters
id string Required

Certificate UUID

curl
curl -X GET "https://appliance.example.com/api/v1/acme/certificates/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/acme/certificates/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/acme/certificates/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/acme/certificates/{id}', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "ACME Certificate",
  "data": {
    "provisionStatus": {
      "status": "<status>",
      "challengeTokens": "<challengeTokens>",
      "pendingOrder": "<pendingOrder>"
    },
    "certId": "<certId>",
    "id": "<id>",
    "accountId": "<accountId>",
    "commonName": "<commonName>",
    "description": "<description>",
    "challengeTypeId": "<challengeTypeId>",
    "autoRenew": true,
    "renewalInterval": 30,
    "altNames": "<altNames>"
  }
}

PUT /acme/certificates/{id}

Editable fields: description, altNames, accountId, challengeTypeId, autoRenew, renewalInterval, keyLength, certId. commonName cannot be changed after creation.

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

Certificate UUID

curl
curl -X PUT "https://appliance.example.com/api/v1/acme/certificates/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/acme/certificates/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.put("https://appliance.example.com/api/v1/acme/certificates/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/acme/certificates/{id}', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "ACME Certificate Updated",
  "data": []
}

DELETE /acme/certificates/{id}

Delete an ACME certificate

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

Certificate UUID

curl
curl -X DELETE "https://appliance.example.com/api/v1/acme/certificates/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/acme/certificates/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.delete("https://appliance.example.com/api/v1/acme/certificates/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/acme/certificates/{id}', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "ACME Certificate Deleted",
  "data": []
}

Start an ACME order for a certificate

POST /acme/certificates/{id}/renew

Starts the ACME HTTP-01 challenge flow. Stores challenge tokens in the cluster-synced database. After all nodes have synced, call /complete to authorize the challenges and obtain the certificate.

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

Certificate UUID

curl
curl -X POST "https://appliance.example.com/api/v1/acme/certificates/{id}/renew" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/acme/certificates/{id}/renew';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.post("https://appliance.example.com/api/v1/acme/certificates/{id}/renew", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/acme/certificates/{id}/renew', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "ACME order initiated",
  "data": []
}