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
Path Parameters
Unique identifier of the organization to count users for. Organization must exist in database.
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.