> ## Documentation Index
> Fetch the complete documentation index at: https://docs.timbrix.mx/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Certificates

> Delete CSD certificate and private key from an organization

## Description

Deletes the CSD (Certificado de Sello Digital) certificate and private key files from an organization. This removes the files from S3 and clears all certificate metadata from the database. Only the organization owner can perform this action.

## Authorization

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication
</ParamField>

## Path Parameters

<ParamField path="id" type="string" required>
  The unique ID of the organization
</ParamField>

## Example Request

```bash theme={null}
curl -X DELETE "https://api.timbrix.com/organizations/123e4567-e89b-12d3-a456-426614174000/certificates" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Response Codes

<ResponseField name="204" type="No Content">
  Certificates deleted successfully
</ResponseField>

<ResponseField name="400" type="Bad Request">
  No certificates found to delete
</ResponseField>

<ResponseField name="401" type="Unauthorized">
  Authentication required
</ResponseField>

<ResponseField name="403" type="Forbidden">
  Access denied. Only organization owners can delete certificates
</ResponseField>

<ResponseField name="404" type="Not Found">
  Organization not found
</ResponseField>

## Security

⚠️ **OWNER ONLY**: Only the organization OWNER can delete CSD certificates. Admins and members cannot perform this action.

⚠️ **IRREVERSIBLE**: This action permanently deletes the certificate files from S3. Make sure you have backup copies before deleting.

## Notes

* This operation deletes both the certificate (.cer) and private key (.key) files
* All certificate metadata is cleared from the database (serial number, expiration date, password)
* The organization will not be able to sign invoices until new certificates are uploaded
* Returns 400 if no certificates exist for the organization
