Delete organization (owner only)
curl --request DELETE \
--url https://api.example.com/organizations/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/organizations/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/organizations/{id}', 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}",
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: Bearer <token>"
],
]);
$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}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/organizations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyOrganizations
Delete Organization
⚠️ SECURITY: Only the organization OWNER can delete the organization. This action is PERMANENT and cannot be undone. All members, invites, and data will be deleted.
DELETE
/
organizations
/
{id}
Delete organization (owner only)
curl --request DELETE \
--url https://api.example.com/organizations/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/organizations/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/organizations/{id}', 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}",
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: Bearer <token>"
],
]);
$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}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/organizations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyPermanently deletes an organization and all associated data.
A successful deletion returns no response body, only a 204 status code.
Authentication
This endpoint requires authentication via Bearer token:- Authorization:
Bearer <token>
⚠️ Security Warning
Only the organization OWNER can delete the organization. This is a destructive action that cannot be undone. All data will be permanently removed.Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Organization UUID |
What Gets Deleted
When an organization is deleted, the following data is also permanently removed:Organization Data
- Organization profile and settings
- All organization members
- All pending invitations
API Resources
- All OAuth applications and tokens
- All webhooks and delivery history
- All API keys
Billing Data
- Stripe subscription (will be cancelled)
- Billing history is preserved in Stripe
Example Request
curl -X DELETE https://api.timbrix.mx/organizations/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer <your_token>"
import { Timbrix } from "@timbrix/sdk"
const client = new Timbrix({ bearerToken: "<your_token>" })
await client.organizations.delete("550e8400-e29b-41d4-a716-446655440000")
console.log("Organization deleted")
Example Response
Status: 204 No Content
Common Errors
403 Forbidden
Only the owner can delete the organization.{
"statusCode": 403,
"message": "Access denied. Only the organization owner can delete the organization"
}
404 Not Found
The organization with the specified ID does not exist.{
"statusCode": 404,
"message": "Organization not found"
}
Before You Delete
Important considerations:- Export your data - There is no way to recover deleted data
- Cancel subscriptions - Stripe subscription will be cancelled automatically
- Notify team members - Members will lose access immediately
- Backup API keys - All API keys will stop working
- Save webhooks - Webhook URLs and settings will be lost
Alternative: Archive Instead
Consider implementing an archive feature instead of permanent deletion:- Preserve historical data
- Maintain audit trails
- Allow potential restoration
- Keep billing records