Skip to content
Documentation / Management API

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.

  1. Sign in as an organisation administrator. In MSP Hub, select the client estate before creating its credential.
  2. 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.
  3. Copy the token when it appears. Load it into SSLNEXUS_TOKEN from 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.

OperationMethod and pathScope
List targetsGET /targetsread
List certificatesGET /certificatesread
Create and issuePOST /certificatescreate
Inspect a certificateGET /certificates/{id}read
Remove managementDELETE /certificates/{id}delete
Inspect a jobGET /jobs/{job}read
List public versionsGET /certificates/{id}/versionsread
Download a certificate chainGET /certificates/{id}/versions/{version}read
Import an existing certificatePOST /certificates/importimport
Update renewal policyPATCH /certificates/{id}/renewal-policypolicy
Start initial issuancePOST /certificates/{id}/actions/issueissue
Request renewalPOST /certificates/{id}/actions/renewrenew
Approve a renewalPOST /certificates/{id}/actions/approve-renewalapprove-renewal
Deploy the stored certificatePOST /certificates/{id}/actions/deploydeploy
Request a new certificatePOST /certificates/{id}/actions/replacereplace
Reissue from retained materialPOST /certificates/{id}/actions/reissuereissue
Recover a deploymentPOST /certificates/{id}/actions/recoverrecover
Adopt a discovered certificatePOST /certificates/{id}/actions/adoptadopt
Revoke at the issuing CAPOST /certificates/{id}/actions/revokerevoke

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 fieldTypeUsage
common_name (required)stringDNS identity to manage.
targetstringRegistered deployment target ID.
providerstringConfigured CA adapter name.
sansarrayAdditional DNS names.
key_sizeintegerRSA bits, at least 4096 in multiples of 1024.
renewal_before_daysintegerRenewal threshold in days, 1–3650.
renewal_modestringautomatic or approval.
renewal_retry_countintegerRetry count, 0–20 for policy updates.
renewal_retry_delay_minutesintegerMinutes between attempts, 1–10080 for policy updates.
maintenance_window_startstringUTC HH:MM. Supply both endpoints or leave both empty.
maintenance_window_endstringUTC HH:MM.
renewal_window_typestringdays or percentage. Inferred when a single timing value is supplied.
renewal_remaining_percentintegerPercentage 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.json

Success 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 fieldTypeUsage
confirm_certificate_id (required)stringMust match the request path.
names (required)arrayExact 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.json

Success 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.json

Inspect 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.pem

Success 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 fieldTypeUsage
certificate_pem (required)stringPublic PEM certificate.
private_key_pemstringMatching private key for managed import, write only.
targetstringRegistered deployment target ID.
domainstringCertificate DNS name for managed import.
deploybooleanTrue for managed import and deployment. Defaults to false.
deployment_pluginstringDeployment plugin for a compatible target.
renewal_window_typestringdays or percentage. Inferred when a single timing value is supplied.
renewal_remaining_percentintegerPercentage of the current leaf lifetime remaining, 1–99. Supply this field alone or with the percentage unit.
renewal_before_daysintegerDays 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.json

Success 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.json

Update 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 fieldTypeUsage
renewal_before_daysintegerRenewal threshold in days, 1–3650.
renewal_modestringautomatic or approval.
renewal_retry_countintegerRetry count, 0–20 for policy updates.
renewal_retry_delay_minutesintegerMinutes between attempts, 1–10080 for policy updates.
maintenance_window_startstringUTC HH:MM. Supply both endpoints or leave both empty.
maintenance_window_endstringUTC HH:MM.
renewal_window_typestringdays or percentage. Inferred when a single timing value is supplied.
renewal_remaining_percentintegerPercentage of the current leaf lifetime remaining, 1–99. Supply this field alone or with the percentage unit.
expected_updated_attimestampOptional. 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.json

Success 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 fieldTypeUsage
target_idstringRegistered target that owns the discovered certificate.
providerstringConfigured CA adapter name.
renewal_before_daysintegerRenewal threshold in days, 1–3650.
renewal_modestringautomatic or approval.
renewal_retry_countintegerRetry count, 0–20 for policy updates.
renewal_retry_delay_minutesintegerMinutes between attempts, 1–10080 for policy updates.
maintenance_window_startstringUTC HH:MM. Supply both endpoints or leave both empty.
maintenance_window_endstringUTC HH:MM.
renewal_window_typestringdays or percentage. Inferred when a single timing value is supplied.
renewal_remaining_percentintegerPercentage 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.json

Success 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 fieldTypeUsage
reason (required)stringunspecified, key_compromise, affiliation_changed, superseded or cessation_of_operation.
messagestringOptional 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.json

Success 202, 200.

{
  "certificate_id": "cert-example",
  "job_id": "job-example",
  "status": "queued"
}

Troubleshoot a request

HTTP statusWhat to check
400Check JSON, required fields, pagination, revocation reason and Idempotency-Key.
401Check the bearer token, expiry and revocation status.
402Check licence activation, capacity and eligibility.
403Check the granted scope, target IDs and selected estate.
404Check the resource ID against inventory visible to this identity. Scoped lookups can return a plain-text 404.
409Check active jobs, policy, adapter eligibility, confirmation names and idempotency conflicts.
413Writes have a 512 KiB outer body limit. Individual handlers may enforce smaller limits.
500 / 503Capture the request ID and reconcile storage or worker state before retrying.
{"code":"idempotency_conflict","message":"Key already used with different input"}