CertCLM logoCertCLM

API reference

The authenticated REST surface — everything the console does, scriptable.

All endpoints live under /api/v1 and require Authorization: Bearer <token> from POST /api/v1/auth/login (except /auth/login and the agent-scoped routes). Content type is JSON; errors are {"error": "..."}.

Auth

Method & path Description
POST /auth/login {username, password} → {token, user}
GET /auth/me Current principal
POST /auth/logout Invalidate the session token
GET|POST /users, PATCH /users/{id} User management (admin)

Certificates

Method & path Description
GET /certificates List inventory
POST /certificates Issue: {domain, sans[], primary_ca, backup_cas[], duration_days, auto_renew, challenge_type, dns_provider_id, push_target_ids[]}
GET /certificates/{id} Single certificate
POST /certificates/{id}/renew Rotate now through the failover chain
POST /certificates/{id}/export {format: pem|pfx, password} — PKCS#12 or PEM bundle
PUT /certificates/{id}/push-targets Bind {target_ids[]}
POST /certificates/{id}/push Re-push to bound targets now
POST /certificates/{id}/verify-deployment {host?, port?} → presented-vs-stored fingerprint comparison

DNS credentials

Method & path Description
GET|POST /dns-credentials, DELETE /dns-credentials/{id} CRUD; secrets encrypted at rest, masked on read
GET /dns-credentials/suggest?domain= Authoritative-NS-based provider/credential suggestion

Nodes & deployment

Method & path Description
GET|POST /nodes Enroll/list pull nodes (returns the node token once)
GET|POST /deployments Deployment tasks {cert_id, node_id, cert_path, key_path, post_hook}
GET /agent/tasks (agent auth) Poll pending tasks
POST /agent/csr Agent CSR submission → issued cert for agent-held key flow

Push targets & results

Method & path Description
GET|POST /push-targets, DELETE /push-targets/{id} Target CRUD; POST /push-targets/{id}/test validates credentials
GET /push-results Per-target delivery history
GET|POST /ssh-credentials, DELETE /ssh-credentials/{id} Reusable SSH logins (password/PEM key) for ssh targets — encrypted at rest
GET /ssh-config/hosts, POST /ssh-config/import Read the server's ~/.ssh/config; turn selected aliases into ssh targets

Discovery

Method & path Description
POST /discovery/scan {cidrs[], hosts[], ports[], timeout_seconds}
GET /discovery/results Found certificates with risk grades
POST /discovery/claim Convert a discovered cert into a managed one
GET /discovery/domains Normalized domain inventory (assets vs observations)
GET /discovery/ct CT-log lookup (crt.sh) for domains under a suffix

Everything else

Method & path Description
GET|POST /notifications, POST /notifications/{id}/test Channels (telegram/smtp/webhook, lang en/ru/zh-CN)
GET /ca/info, GET /ca/root.crt, POST /ca/init, POST /ca/issue Private root CA
GET|PATCH /ca/providers CA provider configuration
GET /acme-accounts ACME account keys per CA
GET /hooks/templates Deployment post-hook templates (nginx, HAProxy, …)
GET /dashboard/stats Inventory counters
GET /audit_logs Audit trail
GET /cluster/status HA/cluster status

Desktop bridge

Inside the desktop app, the frontend calls the same REST surface through an in-process binding (CertCLMService.api) that injects a session token — the public HTTP API stays fully authenticated; nothing is exposed unauthenticated for the shell.