Delete Certificates
curl --request DELETE \
--url https://api.example.com/organizations/{id}/certificates \
--header 'Authorization: <authorization>'import requests
url = "https://api.example.com/organizations/{id}/certificates"
headers = {"Authorization": "<authorization>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<authorization>'}};
fetch('https://api.example.com/organizations/{id}/certificates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/organizations/{id}/certificates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/organizations/{id}/certificates"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/organizations/{id}/certificates")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/organizations/{id}/certificates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"204": {},
"400": {},
"401": {},
"403": {},
"404": {}
}Organizations
Delete Certificates
Delete CSD certificate and private key from an organization
DELETE
/
organizations
/
{id}
/
certificates
Delete Certificates
curl --request DELETE \
--url https://api.example.com/organizations/{id}/certificates \
--header 'Authorization: <authorization>'import requests
url = "https://api.example.com/organizations/{id}/certificates"
headers = {"Authorization": "<authorization>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<authorization>'}};
fetch('https://api.example.com/organizations/{id}/certificates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/organizations/{id}/certificates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/organizations/{id}/certificates"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/organizations/{id}/certificates")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/organizations/{id}/certificates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"204": {},
"400": {},
"401": {},
"403": {},
"404": {}
}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
Path Parameters
Example Request
curl -X DELETE "https://api.timbrix.mx/organizations/123e4567-e89b-12d3-a456-426614174000/certificates" \
-H "Authorization: Bearer YOUR_TOKEN"
import { Timbrix } from "@timbrix/sdk"
const client = new Timbrix({ bearerToken: "<your_token>" })
await client.organizations.deleteCertificates(
"123e4567-e89b-12d3-a456-426614174000"
)
Response Codes
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