SuperAI Flow Platform

Sections

Theme switcher

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

Authorizationstring

Path Parameters

organization_idstring Required

Unique identifier of the organization to deactivate. Must exist in database.

Response

200
Object
Organization and all users deactivated successfully

Response Attributes

created_atstring Required

Timestamp when organization was created. Format: ISO 8601 UTC (e.g., '2025-01-23T15:30:00Z').

idstring Required

Unique identifier for the organization. Format: UUID v4

is_activeboolean

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.

Default value
true
modified_atstring Required

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.

namestring Required

Organization display name. Unique across the platform. Used in UI, reports, and organization selection. Can be updated via PUT /admin/organizations/{id}

400
Object
Invalid UUID format

Response Attributes

errorobject Required

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

request_idnull
403
Object
Forbidden - Insufficient permissions to access this resource

Response Attributes

errorobject Required

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

request_idnull
404
Object
Organization not found

Response Attributes

errorobject Required

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

request_idnull
422
Object
Validation Error

Response Attributes

detailarray

Show child attributes

500
Object
Internal Server Error - An unexpected error occurred

Response Attributes

errorobject Required

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

request_idnull
Was this section helpful?

What made this section unhelpful for you?

PATCH

/

Select
1

Response

Was this section helpful?

What made this section unhelpful for you?

View as Markdown

Ask an AI

Open in ChatGPTOpen in ClaudeOpen in Perplexity

Code with AI

Open in Copilot