Delete Tenant
import requests
url = "https://api.hydradb.com/tenants/delete"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hydradb.com/tenants/delete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request DELETE \
--url https://api.hydradb.com/tenants/delete \
--header 'Authorization: Bearer <token>'{
"tenant_id": "tenant_1234",
"status": "deletion_scheduled",
"message": "Tenant deregistered. Background cleanup is in progress."
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}Tenants
Delete Tenant
Permanently delete a tenant and all its data.
DELETE
/
tenants
/
delete
Delete Tenant
import requests
url = "https://api.hydradb.com/tenants/delete"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hydradb.com/tenants/delete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request DELETE \
--url https://api.hydradb.com/tenants/delete \
--header 'Authorization: Bearer <token>'{
"tenant_id": "tenant_1234",
"status": "deletion_scheduled",
"message": "Tenant deregistered. Background cleanup is in progress."
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}When to use it
- Offboarding – a customer has churned and you need to remove their data
- Environment teardown – delete test or staging tenants
- Compliance – right-to-deletion requests under GDPR or similar
This operation is irreversible. Deleting a tenant permanently removes:
- Graph database storage
- Vector store collections (knowledge and memory)
- Source documents
- Chunk data
- Tenant metadata schema
- Tenant ID mapping
Endpoint
- Auth: Bearer token
- Idempotency: Re-sending for a deleted tenant returns
404 TENANT_NOT_FOUND - Async: Yes – returns
deletion_scheduled. Cleanup runs in the background.
Example
curl -X DELETE 'https://api.hydradb.com/tenants/delete?tenant_id=my_first_tenant' \
-H "Authorization: Bearer <your_api_key>"
const response = await client.tenant.deleteTenant({
tenant_id: "my_first_tenant"
});
response = client.tenant.delete_tenant(tenant_id="my_first_tenant")
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
tenant_id | string | Yes | The tenant to delete. |
Response
{
"tenant_id": "my_first_tenant",
"status": "deletion_scheduled",
"message": "Tenant deregistered. Background cleanup is in progress."
}
| Field | Description |
|---|---|
tenant_id | The tenant scheduled for deletion. |
status | Always deletion_scheduled. Cleanup is asynchronous. |
message | Human-readable status. |
Behavior notes
Cleanup is asynchronous. Deletion runs in the background and is typically complete within a few minutes. Treat deletion as eventually consistent.
Re-creation. Once deletion is scheduled, re-creating a tenant with the same
tenant_id may fail until cleanup completes. If you need to re-create immediately, use a different tenant_id.Related endpoints
- Before this: List data – confirm what’s stored before deleting
- Alternative: Delete knowledge · Delete memory – remove individual items instead of the whole tenant
Errors
Common codes:400 INVALID_PARAMETERS, 404 TENANT_NOT_FOUND. See Error Responses for the full list.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Unique identifier for the tenant/organization
Example:
"tenant_1234"
Was this page helpful?
