SuperAI Flow Platform

Sections

Theme switcher

List organization users

Retrieve all users belonging to a specific organization.

This endpoint returns a complete list of users within an organization, including the organization name for each user. Use this to manage organization membership, audit user access, or populate organization user interfaces.

Context: - Returns users regardless of their active/inactive status - Includes organization name in each user response for convenience - Users are ordered by creation date (newest first) - Each user includes full profile information and role - Organization must exist (404 if not found) - No pagination implemented yet (loads all users in memory)

Behavior: 1. Validates organization exists by ID 2. Queries all users with matching organization_id 3. Joins with organization table to include organization_name 4. Orders results by created_at descending 5. Returns complete user list with organization details Performance Notes: - Current implementation loads all users in memory - Suitable for organizations with < 1000 users - For larger organizations, pagination should be added (see TODOs.md) - Database query includes JOIN with organization table

Use Cases: - Display organization members in admin dashboard - Generate user access reports for specific organization - Audit which users have access to organization resources - Populate user selection dropdowns filtered by organization - Export organization user lists for compliance

Related Endpoints: - POST /admin/organizations/{id}/users - Add user to organization - GET /admin/organizations/{id}/users/count - Get user count only - GET /admin/users - List all users across organizations - GET /admin/users/{user_id} - Get individual user details

Header Parameters

Authorizationstring

Path Parameters

organization_idstring Required

Unique identifier of the organization to query users from. Organization must exist in database.

Response

200
Object
List of organization users retrieved successfully

Response Attributes

created_atstring Required

Timestamp when user was created (ISO 8601 UTC).

emailstring Required

User's email address. Unique within organization. Used for login and notifications.

first_namestring Required

User's first name. Used in UI displays and emails.

idstring Required

Unique identifier for the user. Format: UUID v4

last_namestring Required

User's last name. Used in UI displays and emails.

modified_bystring Required

Identifier of the user or system that last modified this user. Used for audit trail.

organization_idstring Required

UUID of the organization this user belongs to.

organization_namestring Required

Display name of the user's organization. Included for convenience to avoid additional API calls. Useful in user lists and dashboards showing cross-organization data.

rolestring Required

User's role within the organization. Values: 'org_admin', 'backoffice', 'app_user', 'integration'

statusstring Required

User's account status. Values: 'active', 'inactive'. 'active' users can log in; 'inactive' users cannot.

updated_atstring Required

Timestamp when user was last modified (ISO 8601 UTC).

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?

GET

/

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