Assign Endpoint Certificate
Override the TLS certificate served on an endpoint that uses a custom domain. By default the platform serves a Let's Encrypt cert it manages itself (auto-renewed via ACME); this endpoint lets you swap in a certificate you've uploaded via POST /v1/certificates/self instead.
Restricted to custom-domain endpoints only (the linked domain must be one you own — shared domains always use platform-managed certs). Also gated behind the custom_ssl entitlement on your plan.
Set use_default: true (or pass certificate_id: 0/null) to revert to the auto-managed cert. The previous custom certificate row is detached but not deleted from your library — it's still available to assign to another endpoint.
Path parameters
id string (uuid) Req
Endpoint UUID. Must use a custom domain.
Request body
certificate_id int64 | null
Numeric ID of an uploaded certificate (from /certificates/self). Must be active and not expired. Pass
null or 0 together with use_default: true to revert.use_default boolean
true = revert to platform-managed ACME cert. false = use the supplied certificate_id. Either explicit certificate_id with use_default: false or use_default: true works.Response (200 OK)
ok boolean
Always
true on success.certificate_id int64 | null
The newly attached certificate, or
null if reverted to default.certificate_name string
Name of the attached certificate. Present only when a certificate is assigned (omitted on revert-to-default).
Errors
400 Bad Request
Unknown fields (strict decoding), invalid JSON, endpoint isn't on a custom domain, certificate isn't active, certificate is expired, certificate domain doesn't match the endpoint, or the certificate doesn't cover the endpoint hostname.
401 Unauthorized
Missing auth.
403 Forbidden
Plan doesn't include the
custom_ssl entitlement.404 Not Found
Endpoint or certificate doesn't exist (or doesn't belong to you).
Request — assign custom cert
curl -X PUT "https://api.ngris.com/v1/endpoints/<uuid>/certificate" \
-H "X-API-KEY: <your_api_key>" \
-H "Content-Type: application/json" \
-d '{"certificate_id": 42, "use_default": false}'
Request — revert to ACME
curl -X PUT "https://api.ngris.com/v1/endpoints/<uuid>/certificate" \
-H "X-API-KEY: <your_api_key>" \
-H "Content-Type: application/json" \
-d '{"use_default": true}'
Python
from ngris import Ngris
client = Ngris(api_key="<your_api_key>")
client.endpoints.assign_certificate(
"<endpoint_uuid>", certificate_id=42,
)
# Revert to platform-managed:
client.endpoints.assign_certificate(
"<endpoint_uuid>", use_default=True,
)
Response — 200 OK
{
"ok": true,
"certificate_id": 42,
"certificate_name": "acme.example.com"
}