Delete Domain Certificate

DELETE /v1/domains/self/{uuid}/certificates/{cert_uuid}

Delete one certificate of a domain: a certificate you uploaded, or the one ngris issued through ACME. The certificate and its private key are removed from ngris; this can't be undone.

The default certificate (is_default: true, the one served for the domain) can be deleted only while another certificate of the domain is switched on (is_active: true). ngris then makes one of those the default before deleting: the ACME certificate if it is one of them, else the newest. To choose which one takes over, set it first with PUT /v1/domains/self/{uuid}/active-cert. When no other certificate is switched on, the request answers 409 and nothing changes: upload a replacement, or request an ACME certificate with POST /v1/domains/self/{uuid}/reissue-ssl, first.

Any other certificate is deleted without that check. Deleting never requests a new certificate, and ngris renews only an ACME certificate it holds: after deleting the ACME certificate, the domain gets a new one only through reissue-ssl. The edges reload their certificates as soon as the delete succeeds.

Account scope: the domain must belong to your active account, and your role needs delete access to certificates.

Path parameters

uuid string (uuid) Req
The domain's uuid from /domains/available.
cert_uuid string (uuid) Req
The certificate's uuid from /certificates. It must belong to this domain.

Response (200 OK)

ok string
"true" on success (a string, not a boolean).
message string
Certificate deleted.

Errors

400 Bad Request
The certificate belongs to a different domain.
401 Unauthorized
Missing auth.
403 Forbidden
Your role can't delete certificates.
404 Not Found
The domain doesn't exist or belongs to another account, the certificate doesn't exist, or a path segment isn't a uuid.
409 Conflict
The certificate is the domain's default and no other certificate of the domain is switched on. Nothing was deleted.
Request
curl -X DELETE "https://api.ngris.com/v1/domains/self/019bd08f-98db-71b2-8e54-f518d319f111/certificates/019be236-c4fb-72c2-b153-1eefef23705b" \ -H "X-API-KEY: <your_api_key>"
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") client._delete_void( "/domains/self/019bd08f-98db-71b2-8e54-f518d319f111/certificates/019be236-c4fb-72c2-b153-1eefef23705b" )
Response — 200 OK
{ "ok": "true", "message": "Certificate deleted." }
Response — 409 Conflict
{ "error": "Cannot delete the only certificate for example.com. Upload a replacement first or let the system re-issue an ACME certificate." }
Was this helpful?
Was this helpful?