Deactivate organization
Deactivate organization and cascade deactivation to all associated users.
This endpoint performs a cascading deactivation that marks the organization as inactive AND deactivates all users belonging to the organization. This is different from PUT with is_active=False, which only affects the organization. Use this for offboarding customers or suspending organization access.
Context: - Sets organization is_active to False - Cascades deactivation to all organization users - Deactivated users cannot log in or access the system - Does NOT delete data (soft deactivation for audit trail) - Does NOT stop running workflows (they complete normally) - Deactivation can be reversed by setting is_active=True via PUT - All flow executions and data remain intact
Behavior: 1. Validates organization exists by ID 2. Sets organization is_active to False 3. Queries all users in the organization 4. Sets each user's status to inactive 5. Updates organization modified_at timestamp 6. Persists all changes to database 7. Returns updated organization Side Effects: - All users in organization immediately lose access - Users cannot log in after deactivation - Running workflows continue but new executions cannot be created - Organization no longer appears in active organization lists - WebSocket connections for deactivated users may be terminated
Use Cases: - Customer offboarding or subscription cancellation - Temporary suspension due to payment issues - Compliance requirement to disable organization access - Security incident response (immediately disable all access) - Decommissioning departments or teams
Reactivation: To reactivate, use PUT /admin/organizations/{id} with is_active=True Note: User reactivation must be done individually after org reactivation
Related Endpoints: - PUT /admin/organizations/{id} - Reactivate organization - GET /admin/organizations/{id}/users - View affected users - GET /admin/organizations/{id} - Check deactivation status - DELETE /admin/organizations/{id} - Permanently delete organization
Header Parameters
Path Parameters
Unique identifier of the organization to deactivate. Must exist in database.
Response
Response Attributes
Timestamp when organization was created. Format: ISO 8601 UTC (e.g., '2025-01-23T15:30:00Z').
Unique identifier for the organization. Format: UUID v4
Whether the organization is active. Active organizations allow user logins and flow executions. Inactive organizations are read-only; users cannot log in. Set via PUT /admin/organizations/{id} or PATCH /deactivate endpoint.
Timestamp when organization was last modified. Updated automatically on any field change. Format: ISO 8601 UTC (e.g., '2025-01-24T10:45:00Z'). Used for change tracking and audit logs.
Organization display name. Unique across the platform. Used in UI, reports, and organization selection. Can be updated via PUT /admin/organizations/{id}
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.