Delete organization
Permanently delete an organization and all associated data.
This endpoint performs a hard delete of the organization and ALL related entities including users, flows, executions, and task data. This operation is IRREVERSIBLE. For temporary deactivation, use PATCH /deactivate instead.
Context: - HARD DELETE: Data is permanently removed from database - Cascades to all related entities (users, flows, executions, tasks) - Cannot be undone - use with extreme caution - Recommended to deactivate first and delete only after confirmation - Running workflows may fail if organization is deleted - For data retention compliance, consider soft delete via deactivate - No response body returned (204 No Content status)
Behavior: 1. Validates organization exists by ID 2. Checks for foreign key constraints 3. Deletes all related entities in order: - User records - Flow definitions - Flow executions - Task outputs - Task statuses 4. Deletes organization record 5. Returns 204 No Content Use Cases: - Remove test/sandbox organizations after development - Comply with GDPR "right to be forgotten" requests - Clean up organizations created by mistake - Decommission organizations with no production data - Automated cleanup of expired trial organizations
Safer Alternative: For reversible deactivation, use: PATCH /admin/organizations/{id}/deactivate
Related Endpoints: - PATCH /admin/organizations/{id}/deactivate - Soft deactivation (recommended) - GET /admin/organizations/{id} - Verify organization before deletion - GET /admin/organizations/{id}/users/count - Check user count before delete
Header Parameters
Path Parameters
Unique identifier of the organization to delete. Organization must exist and all deletion constraints must be satisfied.
Response
Response Attributes
Standard error detail structure.
This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.
Show child attributes
Response Attributes
Standard error detail structure.
This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.
Show child attributes
Response Attributes
Standard error detail structure.
This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.
Show child attributes
Response Attributes
Show child attributes
Response Attributes
Standard error detail structure.
This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.