Issue Client Certificate

POST /v1/client-cas/{uuid}/certificates

Issue a certificate for one device from a CA managed by ngris, for the device's certificate signing request (CSR). The device makes its own key and keeps it: only the signing request is sent, never the key. Every endpoint that trusts the CA then accepts the device.

The ngris client-cert request --ca <CA name> --name <device> command does all of it on the device: it makes the key and the signing request, calls this route and writes <device>.crt, <device>.key and ca.pem. To renew a device, issue a new certificate with the same name (with the CLI, into a new folder: --out-dir); the old one keeps working until it expires or you revoke it.

A certificate file for a browser or phone (with its key and a password) is made in the dashboard only: Security → mTLS → Client certificates → New certificate → Download for a browser or phone. Through the API, send a signing request.

Plan-gated: needs the managed_client_ca entitlement. Each active certificate counts toward plan_limits.max_active_client_certificates on GET /v1/account/plan (0 means none).

Path parameters

uuid string (uuid) Req
The managed CA's uuid from /client-cas ("kind": "managed").

Request body

name string Req
The device name, for example laptop-anna: 1 to 64 letters, digits, dots, dashes or underscores. It becomes the certificate's subject (CN=laptop-anna) and your app receives it in X-Ngris-Client-Cert-Name. Names don't have to be unique.
days int
Optional. The lifetime in days, 1 to 397. Default 90.
csr string Req
The device's signing request, PEM text starting with -----BEGIN CERTIFICATE REQUEST-----. One request, at most 16 KiB. Only its key is used: the certificate's name, lifetime and uses are set by ngris.

Response (201 Created)

certificate object
The new certificate object: its uuid, serial, fingerprint_sha256, not_after and so on.
certificate_pem string
The device certificate, PEM. Install it on the device next to its key.
ca_certificate_pem string
The CA's public certificate, PEM.

Errors

400 Bad Request
A name that breaks the rule above, days out of range, a missing or unreadable signing request, or a CA that was uploaded (ngris only issues from the CAs it manages). The message says what to fix.
401 Unauthorized
Missing auth.
403 Forbidden
Caller lacks the cert:write permission; the plan doesn't include managed_client_ca ("code": "entitlement_required"); or the account has reached its plan's number of active certificates.
404 Not Found
The CA doesn't exist or belongs to another account.
409 Conflict
"code": "quota_paused": the CA is paused because the account has more managed CAs than its plan allows. It resumes on its own once the account has room.
429 Too Many Requests
Too many certificate requests for the account. Retry-After says when to try again.
503 Service Unavailable
"Managed client certificates aren't available right now." Try again later.
On the device (CLI)
ngris client-cert request --ca "Company laptops" --name laptop-anna curl --cert laptop-anna.crt --key laptop-anna.key https://your-endpoint.ngris.io/
Request
# On the device: a key that stays there, and its signing request openssl req -new -newkey rsa:2048 -nodes -keyout laptop-anna.key \ -subj "/CN=laptop-anna" -out laptop-anna.csr curl -X POST "https://api.ngris.com/v1/client-cas/019b2c40-1a2b-7c3d-8e4f-5a6b7c8d9e0f/certificates" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json" \ -d "$(jq -n --arg csr "$(cat laptop-anna.csr)" \ '{name: "laptop-anna", days: 90, csr: $csr}')"
Response — 201 Created
{ "certificate": { "uuid": "019b2c41-7d0e-7f3a-9c5e-2a6b8d4f1e07", "name": "laptop-anna", "serial": "5b1e0c9a3f7d42e8b6a1c0d9e8f7a6b5", "fingerprint_sha256": "9a8b7c6d5e4f30211203f4e5d6c7b8a99a8b7c6d5e4f30211203f4e5d6c7b8a9", "subject": "CN=laptop-anna", "public_key_alg": "rsa-2048", "not_before": "2026-10-29T09:55:00Z", "not_after": "2027-01-27T10:00:00Z", "delivery": "csr", "status": "active", "created_via": "api", "created_at": "2026-10-29T10:00:00Z", "client_ca_uuid": "019b2c40-1a2b-7c3d-8e4f-5a6b7c8d9e0f", "created_by_user_uuid": "019a52c2-ca1e-78ba-ab5c-50362cc29134" }, "certificate_pem": "-----BEGIN CERTIFICATE-----\nMIIC...\n-----END CERTIFICATE-----\n", "ca_certificate_pem": "-----BEGIN CERTIFICATE-----\nMIIB...\n-----END CERTIFICATE-----\n" }
Was this helpful?
Was this helpful?