SuperAI Flow Platform

Sections

Theme switcher

Count organization users

Get the total count of users in a specific organization.

This endpoint returns an integer count of all users belonging to an organization, regardless of their active/inactive status. Use this for quota checks, billing calculations, or displaying user count without loading full user details.

Context: - Counts all users in organization (active and inactive) - More efficient than fetching full user list when only count is needed - Useful for pagination calculations and quota enforcement - Returns integer directly (not wrapped in object) - Includes users in all statuses

Behavior: 1. Validates organization exists by ID 2. Executes COUNT query on users table filtered by organization_id 3. Returns integer count directly Performance Notes: - Very efficient - uses database COUNT query (no data loading) - Response time: < 50ms typically - Suitable for frequent polling or quota checks - Database index on organization_id ensures fast counting

Use Cases: - Display user count in organization dashboard - Check organization user quota before creating new users - Calculate per-user billing for organization - Determine if organization has any users before deletion - Monitor organization growth over time

Related Endpoints: - GET /admin/organizations/{id}/users - Get full user list with details - POST /admin/organizations/{id}/users - Add user to organization - GET /admin/organizations/{id} - Get organization details

Header Parameters

Authorizationstring

Path Parameters

organization_idstring Required

Unique identifier of the organization to count users for. Organization must exist in database.

Response

200
Object
User count retrieved successfully
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