Path Parameters
The organization identifier. Can be either:
- Organization UUID (e.g.,
9f256f86-d3c4-4a6e-b89a-1e9a23c5d78e) - Organization name/slug (e.g.,
acme-corp)
Response
Returns an empty response with status code 200 on success.Response Example
Error Responses
Error code indicating the type of error.
Human-readable error message.
Common Errors
- 401 Unauthorized: Invalid or missing authentication token
- 403 Forbidden: User doesn’t have permission to delete the organization
- Only organization owners/admins can delete organizations
- Some deployments may restrict deletion to super admins only
- 404 Not Found: Organization doesn’t exist or has already been deleted
- 500 Internal Server Error: Server encountered an unexpected error during deletion
Deletion Process
When you delete an organization, the following happens in order:- Validation: Checks if the organization exists and user has permission
- Cascading Deletion:
- All projects and their resources are deleted
- All user memberships and role assignments are removed
- All service users and their credentials are deleted
- All policies and permissions are removed
- Billing information is archived/deleted
- Organization Removal: The organization record is permanently deleted
- Audit Log: A final audit entry is created before deletion
Alternatives to Deletion
If you want to temporarily deactivate an organization instead of permanent deletion, consider:- Disable Organization: Use the
POST /v1beta1/organizations/{id}/disableendpoint to disable the organization while preserving all data - Change State: Disabled organizations can be re-enabled later with
POST /v1beta1/organizations/{id}/enable
Best Practices
Before Deleting an Organization
Before Deleting an Organization
- Backup Important Data: Export any data you may need later
- Notify Members: Inform all organization members about the deletion
- Review Dependencies: Check for any external integrations or API keys
- Cancel Billing: Ensure billing is canceled to avoid future charges
- Consider Disabling First: Try disabling the organization for a period before permanent deletion
Deletion Confirmation
Deletion Confirmation
In production applications, implement a confirmation flow:
Handling Deletion Failures
Handling Deletion Failures
Deletion may fail if:
- The organization has active billing subscriptions
- There are locked resources or pending operations
- Database constraints prevent deletion
Notes
- Organization deletion is typically restricted to owners or super admins
- Some deployments may implement soft deletion where data is marked as deleted but retained for a period
- The organization name becomes available for reuse after deletion
- Any API tokens or credentials associated with the organization are immediately invalidated
- Billing is automatically canceled upon deletion
- Consider implementing a “grace period” in your application where users can cancel the deletion