Management API v1
Connect to your Client Server
The Management API is part of SSLNexus Client Server 2.0. Send requests to your own Control Centre’s HTTPS origin. API access is included on every tier, including Free. Current licence, target, policy and capacity rules apply to each operation.
- Sign in as an organisation administrator. In MSP Hub, select the client estate before creating its credential.
- Open API Access in the sidebar or header. Give the service identity a name and an expiry. Select its scopes and enter the target IDs it may manage. An empty target list grants estate-wide access within the selected scopes.
- Copy the token when it appears. Load it into
SSLNEXUS_TOKENfrom the calling application’s secret store. Configure the host to trust the Client Server’s TLS certificate.
Start with a read credential. This Bash example lists the targets visible to it.
export SSLNEXUS_URL=https://nexus.example.org
BASE="$SSLNEXUS_URL/api/v1"
AUTH="Authorization: Bearer $SSLNEXUS_TOKEN"
curl --fail-with-body -sS -H "$AUTH" "$BASE/targets"Download the OpenAPI 3.1 contract. Your installed server also serves its own contract at /docs/api-v1/openapi.json. Download inventory examples for curl, PowerShell or Ansible. After setting the same two environment variables, run bash inventory.sh, pwsh -File ./inventory.ps1 or ansible-playbook -i localhost, inventory.yml.
Create and track a certificate
Choose a verified domain and a configured target. Use a credential with create and read scopes. Every POST, PATCH and DELETE requires an Idempotency-Key of 1–128 bytes after trimming. Generate a distinct key for each intended write and save it with the exact request body. The example uses a saved key in REQUEST_KEY.
printf '%s' '{"common_name":"app.example.org","target":"web01"}' > create.json
curl --fail-with-body -sS -X POST "$BASE/certificates" -H "$AUTH" \
-H "Idempotency-Key: $REQUEST_KEY" -H 'Content-Type: application/json' \
--data-binary @create.json
# Example 201 response
# {"certificate_id":"cert-example","job_id":"job-example"}
JOB_ID=job-example
curl --fail-with-body -sS -H "$AUTH" "$BASE/jobs/$JOB_ID"Use the returned certificate ID for inventory and job ID for progress. A 202 response accepts a job. Poll until succeeded, failed, cancelled or not_required. Intermediate states include queued, running and pending_approval. An approval-mode renewal needs a separately authorised approval. If issuance succeeded and deployment failed, repair the target and use deploy with a fresh key to reuse the certificate.
For DNS-01 with Let’s Encrypt, first save the DNS provider connection in the certificate’s organisation. In the create request, include "validation_method": "dns-01" with the target and names. Save the DNS provider credential on the verified domain. For the standard Sectigo enrolment connector, omit validation_method and use the connector’s domain control validation settings.
Retry and rotate credentials
If a response is lost, repeat the same method and path under the same identity with the original key and byte-for-byte identical body. Recorded outcomes include rejections. Different bytes under the same key produce 409 idempotency_conflict. On request_pending, result_pending or initial_job_unknown, keep the key, inspect the certificate and worker jobs, and reconcile with local audit history using X-Request-ID before issuing fresh work.
To rotate, choose a future expiry in API Access and select Rotate. The replacement inherits the service identity and its grants. Move callers and verify a permitted request before revoking the old credential. To suspend an identity, revoke all its active credentials. Track already accepted jobs in the admin job list.
Call reference
Replace {id}, {job} and {version} with IDs from earlier responses. Set CERT_ID, JOB_ID and VERSION_ID accordingly in the curl examples. For each new write, set REQUEST_KEY and save the example body, where present, as request.json. List calls for targets and inventory accept limit (1–500, default 100) and after. Pass the returned next_after as the URL-encoded after until it is empty. Example responses show selected fields.
| Operation | Method and path | Scope |
|---|---|---|
| List targets | GET /targets | read |
| List certificates | GET /certificates | read |
| Create and issue | POST /certificates | create |
| Inspect a certificate | GET /certificates/{id} | read |
| Remove management | DELETE /certificates/{id} | delete |
| Inspect a job | GET /jobs/{job} | read |
| List public versions | GET /certificates/{id}/versions | read |
| Download a certificate chain | GET /certificates/{id}/versions/{version} | read |
| Import an existing certificate | POST /certificates/import | import |
| Update renewal policy | PATCH /certificates/{id}/renewal-policy | policy |
| Start initial issuance | POST /certificates/{id}/actions/issue | issue |
| Request renewal | POST /certificates/{id}/actions/renew | renew |
| Approve a renewal | POST /certificates/{id}/actions/approve-renewal | approve-renewal |
| Deploy the stored certificate | POST /certificates/{id}/actions/deploy | deploy |
| Request a new certificate | POST /certificates/{id}/actions/replace | replace |
| Reissue from retained material | POST /certificates/{id}/actions/reissue | reissue |
| Recover a deployment | POST /certificates/{id}/actions/recover | recover |
| Adopt a discovered certificate | POST /certificates/{id}/actions/adopt | adopt |
| Revoke at the issuing CA | POST /certificates/{id}/actions/revoke | revoke |
List targets
GET /api/v1/targets · scope read
Use the returned ID when registering a certificate.
Response fields: items, next_after.
Fields in each items entry: id, name, platform, application, provider.
curl --fail-with-body -sS -H "$AUTH" "$BASE/targets"Success 200.
{
"items": [
{
"id": "web01",
"platform": "linux",
"provider": "letsencrypt"
}
],
"next_after": ""
}List certificates
GET /api/v1/certificates · scope read
Returns the certificate inventory visible to the service identity.
Response fields: items, next_after.
Fields in each items entry: id, common_name, sans, provider, target, status, management_state, last_job_id, next_renewal_at, revocation_supported, expires_at, renewal_mode, renewal_before_days, removal_names, renewal_retry_count, renewal_retry_delay_minutes, maintenance_window_start, maintenance_window_end.
curl --fail-with-body -sS -H "$AUTH" "$BASE/certificates"Success 200.
{
"items": [
{
"id": "cert-example",
"common_name": "app.example.org",
"status": "active"
}
],
"next_after": ""
}Create and issue
POST /api/v1/certificates · scope create
For remote issuance, supply a registered target and eligible DNS name. The target supplies its configured CA and deployment binding. Successful creation queues the first issue job.
| JSON field | Type | Usage |
|---|---|---|
common_name (required) | string | DNS identity to manage. |
target | string | Registered deployment target ID. |
provider | string | Configured CA adapter name. |
sans | array | Additional DNS names. |
key_size | integer | RSA bits, at least 4096 in multiples of 1024. |
renewal_before_days | integer | Renewal threshold in days, 1–3650. |
renewal_mode | string | automatic or approval. |
renewal_retry_count | integer | Retry count, 0–20 for policy updates. |
renewal_retry_delay_minutes | integer | Minutes between attempts, 1–10080 for policy updates. |
maintenance_window_start | string | UTC HH:MM. Supply both endpoints or leave both empty. |
maintenance_window_end | string | UTC HH:MM. |
renewal_window_type | string | days or percentage. Inferred when a single timing value is supplied. |
renewal_remaining_percent | integer | Percentage of the current leaf lifetime remaining, 1–99. Supply this field alone or with the percentage unit. |
Example request.json
{
"common_name": "app.example.org",
"target": "web01"
}curl --fail-with-body -sS -H "$AUTH" -X POST -H "Idempotency-Key: $REQUEST_KEY" "$BASE/certificates" \
-H 'Content-Type: application/json' --data-binary @request.jsonSuccess 201.
{
"certificate_id": "cert-example",
"job_id": "job-example"
}Inspect a certificate
GET /api/v1/certificates/{id} · scope read
Read its expiry, target, provider, management state, last job, policy and exact removal names.
Response fields: id, common_name, sans, provider, target, status, management_state, last_job_id, next_renewal_at, revocation_supported, expires_at, renewal_mode, renewal_before_days, removal_names, renewal_retry_count, renewal_retry_delay_minutes, maintenance_window_start, maintenance_window_end.
curl --fail-with-body -sS -H "$AUTH" "$BASE/certificates/$CERT_ID"Success 200.
{
"id": "cert-example",
"common_name": "app.example.org",
"revocation_supported": true,
"removal_names": [
"app.example.org"
]
}renewal_window_type identifies the active unit. Percentage policies return renewal_remaining_percent. Day policies return renewal_before_days. Where the current leaf dates are known, valid_from and expires_at describe that leaf.
Remove management
DELETE /api/v1/certificates/{id} · scope delete
Read the certificate immediately before removal. Copy the exact ordered removal_names, including any previous renewal names, into names. Confirm the inventory ID in the body. This preserves deployed certificates and stored material. Capacity and re-registration rules still apply. A true certificate_capacity_release_pending means release of a never-issued reservation is queued.
| JSON field | Type | Usage |
|---|---|---|
confirm_certificate_id (required) | string | Must match the request path. |
names (required) | array | Exact ordered removal_names returned by the certificate read. |
Example request.json
{
"confirm_certificate_id": "cert-example",
"names": [
"app.example.org"
]
}curl --fail-with-body -sS -H "$AUTH" -X DELETE -H "Idempotency-Key: $REQUEST_KEY" "$BASE/certificates/$CERT_ID" \
-H 'Content-Type: application/json' --data-binary @request.jsonSuccess 200.
{
"certificate_id": "cert-example",
"deleted": true
}To build the confirmation from current inventory, retrieve the record with a read credential and inspect the ID and names before submitting DELETE. A change to the names requires a fresh confirmation.
curl --fail-with-body -sS -H "$AUTH" "$BASE/certificates/$CERT_ID" \
| jq -e '{confirm_certificate_id:.id, names:.removal_names}' > request.json
cat request.jsonInspect a job
GET /api/v1/jobs/{job} · scope read
On failure, inspect error_code and retryable alongside status and stage.
Response fields: id, operation, certificate_id, status, stage, progress, error_code, retryable.
curl --fail-with-body -sS -H "$AUTH" "$BASE/jobs/$JOB_ID"Success 200.
{
"id": "job-example",
"certificate_id": "cert-example",
"operation": "deploy",
"status": "succeeded",
"stage": "completed",
"progress": 100
}List public versions
GET /api/v1/certificates/{id}/versions · scope read
An organisation-wide read credential can list retained versions. A target-restricted credential sees the current public version of an authorised record. Use the version ID from certificates for downloads.
Response fields: certificate_id, common_name, certificates.
Fields in each certificates entry: id, fingerprint_sha256, serial_number, issuer, sans, not_before, not_after.
curl --fail-with-body -sS -H "$AUTH" "$BASE/certificates/$CERT_ID/versions"Success 200.
{
"certificate_id": "cert-example",
"certificates": [
{
"id": "<version ID>",
"serial_number": "7"
}
]
}Download a certificate chain
GET /api/v1/certificates/{id}/versions/{version} · scope read
Save the application/x-pem-file response to a PEM file. The version ID is distinct from the certificate inventory ID. Only public certificate material is returned.
curl --fail-with-body -sS -H "$AUTH" "$BASE/certificates/$CERT_ID/versions/$VERSION_ID" --output certificate-chain.pemSuccess 200.
Import an existing certificate
POST /api/v1/certificates/import · scope import
For inventory only, send public certificate PEM using an estate-wide import credential. Managed deployment also requires deploy scope, deploy=true, the registered target, domain, and a matching private_key_pem for an unexpired certificate. Transmit key material only to your own Client Server over HTTPS.
| JSON field | Type | Usage |
|---|---|---|
certificate_pem (required) | string | Public PEM certificate. |
private_key_pem | string | Matching private key for managed import, write only. |
target | string | Registered deployment target ID. |
domain | string | Certificate DNS name for managed import. |
deploy | boolean | True for managed import and deployment. Defaults to false. |
deployment_plugin | string | Deployment plugin for a compatible target. |
renewal_window_type | string | days or percentage. Inferred when a single timing value is supplied. |
renewal_remaining_percent | integer | Percentage of the current leaf lifetime remaining, 1–99. Supply this field alone or with the percentage unit. |
renewal_before_days | integer | Days before expiry, 1–3650. |
Example request.json
{
"certificate_pem": "<PEM-encoded public certificate>",
"deploy": false
}curl --fail-with-body -sS -H "$AUTH" -X POST -H "Idempotency-Key: $REQUEST_KEY" "$BASE/certificates/import" \
-H 'Content-Type: application/json' --data-binary @request.jsonSuccess 201.
{
"certificate_id": "cert-example",
"managed": false
}For a managed import, construct the JSON locally from the certificate and key files. Store the request in a protected directory so the original bytes are available for a retry. Use the import call above with this request body. A successful managed import returns managed: true and a deployment job ID.
umask 077
jq -n --rawfile cert certificate.pem --rawfile key private-key.pem \
'{certificate_pem:$cert, private_key_pem:$key, deploy:true,
domain:"app.example.org", target:"web01"}' > request.jsonUpdate renewal policy
Preview before applying. With the read scope, call GET /api/v1/certificates/{id}/renewal-preview?renewal_remaining_percent=30. Omit the query to inspect the saved policy. The preview reports eligible_from, next_check, next_attempt and recovery_seconds when available. Check unknown_dates, conflict and warning before changing the policy.
PATCH /api/v1/certificates/{id}/renewal-policy · scope policy
Send the settings you want to change. Omitted fields keep their saved values. A day threshold and a percentage threshold cannot be supplied together. A successful update synchronises eligible renewal schedules. The enrolled ACME client controls internal ACME renewal.
| JSON field | Type | Usage |
|---|---|---|
renewal_before_days | integer | Renewal threshold in days, 1–3650. |
renewal_mode | string | automatic or approval. |
renewal_retry_count | integer | Retry count, 0–20 for policy updates. |
renewal_retry_delay_minutes | integer | Minutes between attempts, 1–10080 for policy updates. |
maintenance_window_start | string | UTC HH:MM. Supply both endpoints or leave both empty. |
maintenance_window_end | string | UTC HH:MM. |
renewal_window_type | string | days or percentage. Inferred when a single timing value is supplied. |
renewal_remaining_percent | integer | Percentage of the current leaf lifetime remaining, 1–99. Supply this field alone or with the percentage unit. |
expected_updated_at | timestamp | Optional. Use the preview’s reviewed_at to reject the update if the certificate has changed. |
Example request.json
{
"renewal_remaining_percent": 30,
"renewal_mode": "approval",
"renewal_retry_count": 3,
"renewal_retry_delay_minutes": 60,
"maintenance_window_start": "01:00",
"maintenance_window_end": "03:00"
}curl --fail-with-body -sS -H "$AUTH" -X PATCH -H "Idempotency-Key: $REQUEST_KEY" "$BASE/certificates/$CERT_ID/renewal-policy" \
-H 'Content-Type: application/json' --data-binary @request.jsonSuccess 200.
{
"certificate_id": "cert-example"
}To return to days, send {"renewal_before_days":20}. To change retries alone, send {"renewal_retry_count":2}. Read the certificate after the update for the resulting policy.
Start initial issuance
POST /api/v1/certificates/{id}/actions/issue · scope issue
Use for an eligible unissued record. An active certificate or pending capacity reconciliation can prevent issuance.
curl --fail-with-body -sS -H "$AUTH" -X POST -H "Idempotency-Key: $REQUEST_KEY" "$BASE/certificates/$CERT_ID/actions/issue"Success 202.
{
"certificate_id": "cert-example",
"job_id": "job-example",
"status": "queued"
}Request renewal
POST /api/v1/certificates/{id}/actions/renew · scope renew
Uses the configured renewal window and licence. A fresh approval-mode renewal waits for approval. Outside the window a job may finish as not_required.
curl --fail-with-body -sS -H "$AUTH" -X POST -H "Idempotency-Key: $REQUEST_KEY" "$BASE/certificates/$CERT_ID/actions/renew"Success 202.
{
"certificate_id": "cert-example",
"job_id": "job-example",
"status": "pending_approval"
}Approve a renewal
POST /api/v1/certificates/{id}/actions/approve-renewal · scope approve-renewal
Requires a pending renewal, its own scope and current entitlement. Releases the same job.
curl --fail-with-body -sS -H "$AUTH" -X POST -H "Idempotency-Key: $REQUEST_KEY" "$BASE/certificates/$CERT_ID/actions/approve-renewal"Success 202.
{
"certificate_id": "cert-example",
"job_id": "job-example",
"status": "queued"
}Deploy the stored certificate
POST /api/v1/certificates/{id}/actions/deploy · scope deploy
Deploys existing issued or managed imported material using the configured binding. Use after repairing a failed deployment.
curl --fail-with-body -sS -H "$AUTH" -X POST -H "Idempotency-Key: $REQUEST_KEY" "$BASE/certificates/$CERT_ID/actions/deploy"Success 202.
{
"certificate_id": "cert-example",
"job_id": "job-example",
"status": "queued"
}Request a new certificate
POST /api/v1/certificates/{id}/actions/replace · scope replace
Requests fresh CA material for an already-issued managed certificate with reconciled capacity and matching target CA.
curl --fail-with-body -sS -H "$AUTH" -X POST -H "Idempotency-Key: $REQUEST_KEY" "$BASE/certificates/$CERT_ID/actions/replace"Success 202.
{
"certificate_id": "cert-example",
"job_id": "job-example",
"status": "queued"
}Reissue from retained material
POST /api/v1/certificates/{id}/actions/reissue · scope reissue
Validates and redeploys a retained certificate using its managed deployment binding. Inventory-only and internal ACME records are ineligible.
curl --fail-with-body -sS -H "$AUTH" -X POST -H "Idempotency-Key: $REQUEST_KEY" "$BASE/certificates/$CERT_ID/actions/reissue"Success 202.
{
"certificate_id": "cert-example",
"job_id": "job-example",
"status": "queued"
}Recover a deployment
POST /api/v1/certificates/{id}/actions/recover · scope recover
Requires a managed record, an unexpired stored certificate and a registered target. Queues deployment of existing material.
curl --fail-with-body -sS -H "$AUTH" -X POST -H "Idempotency-Key: $REQUEST_KEY" "$BASE/certificates/$CERT_ID/actions/recover"Success 202.
{
"certificate_id": "cert-example",
"job_id": "job-example",
"status": "queued",
"reuses_existing_certificate": true
}Adopt a discovered certificate
POST /api/v1/certificates/{id}/actions/adopt · scope adopt
Requires a discovered record with a fingerprint. Use its registered target or supply target_id. Select a configured CA for future renewals. SSLNexus verifies fetched material, accounts for capacity and schedules eligible renewals.
| JSON field | Type | Usage |
|---|---|---|
target_id | string | Registered target that owns the discovered certificate. |
provider | string | Configured CA adapter name. |
renewal_before_days | integer | Renewal threshold in days, 1–3650. |
renewal_mode | string | automatic or approval. |
renewal_retry_count | integer | Retry count, 0–20 for policy updates. |
renewal_retry_delay_minutes | integer | Minutes between attempts, 1–10080 for policy updates. |
maintenance_window_start | string | UTC HH:MM. Supply both endpoints or leave both empty. |
maintenance_window_end | string | UTC HH:MM. |
renewal_window_type | string | days or percentage. Inferred when a single timing value is supplied. |
renewal_remaining_percent | integer | Percentage of the current leaf lifetime remaining, 1–99. Supply this field alone or with the percentage unit. |
Example request.json
{
"target_id": "web01",
"provider": "letsencrypt"
}curl --fail-with-body -sS -H "$AUTH" -X POST -H "Idempotency-Key: $REQUEST_KEY" "$BASE/certificates/$CERT_ID/actions/adopt" \
-H 'Content-Type: application/json' --data-binary @request.jsonSuccess 200.
{
"certificate_id": "cert-example",
"adopted": true
}Revoke at the issuing CA
POST /api/v1/certificates/{id}/actions/revoke · scope revoke
Internal ACME completes synchronously with HTTP 200 and status succeeded. External adapters return HTTP 202 with a job ID. Check revocation_supported first. Supported types include Relay, Let’s Encrypt, DigiCert, DigiCert ACME, generic ACME, Google Trust Services and Sectigo. Poll the job for provider completion.
| JSON field | Type | Usage |
|---|---|---|
reason (required) | string | unspecified, key_compromise, affiliation_changed, superseded or cessation_of_operation. |
message | string | Optional revocation context. |
Example request.json
{
"reason": "key_compromise",
"message": "Incident IR-104"
}curl --fail-with-body -sS -H "$AUTH" -X POST -H "Idempotency-Key: $REQUEST_KEY" "$BASE/certificates/$CERT_ID/actions/revoke" \
-H 'Content-Type: application/json' --data-binary @request.jsonSuccess 202, 200.
{
"certificate_id": "cert-example",
"job_id": "job-example",
"status": "queued"
}Troubleshoot a request
| HTTP status | What to check |
|---|---|
| 400 | Check JSON, required fields, pagination, revocation reason and Idempotency-Key. |
| 401 | Check the bearer token, expiry and revocation status. |
| 402 | Check licence activation, capacity and eligibility. |
| 403 | Check the granted scope, target IDs and selected estate. |
| 404 | Check the resource ID against inventory visible to this identity. Scoped lookups can return a plain-text 404. |
| 409 | Check active jobs, policy, adapter eligibility, confirmation names and idempotency conflicts. |
| 413 | Writes have a 512 KiB outer body limit. Individual handlers may enforce smaller limits. |
| 500 / 503 | Capture the request ID and reconcile storage or worker state before retrying. |
{"code":"idempotency_conflict","message":"Key already used with different input"}