Overview
The/users endpoint retrieves a paginated list of users with optional filtering by recipe, email, phone number, or third-party provider. This endpoint is tenant-specific and supports searching across multiple authentication methods.
Key Features:
- Pagination with customizable limits
- Filter by authentication recipe (emailpassword, passwordless, thirdparty, etc.)
- Search by email, phone number, or provider
- Sort by join time (ascending or descending)
- User ID mapping support
- Multitenancy support
Endpoint
http://localhost:3567
Authentication: Requires API key
Request
Headers
Your SuperTokens API key
CDI version (e.g., “5.4”)
Query Parameters
Comma-separated list of recipe IDs to include. Valid values:
emailpassword, passwordless, thirdparty.Example: emailpassword,thirdpartyMaximum number of users to return. Must be between 1 and 1000 (or 500 when searching).
Base64-encoded token for pagination. Use the
nextPaginationToken from the previous response.Sort order for users. Valid values:
ASC or DESC.Search for users by email address. Supports multiple emails separated by semicolons.Example:
[email protected];[email protected]Search for users by phone number. Supports multiple phone numbers separated by semicolons.Example:
+1234567890;+0987654321Search for users by third-party provider. Supports multiple providers separated by semicolons.Example:
google;githubRequest Body
None.Response
Success Response
Status Code:200 OK
Content-Type: application/json
Body:
Response status - always
"OK" on successArray of user objects. For CDI versions < 4.0, returns a different format with recipe wrapper.
Token for fetching the next page of results. Omitted if there are no more users.
User Object (CDI >= 4.0)
User’s unique identifier (external ID if mapping exists)
Unix timestamp in milliseconds when user joined
Whether this is a primary user account
Array of email addresses associated with the user
Array of phone numbers associated with the user
Array of third-party authentication providers
Array of login methods (authentication recipes) for this user
Array of tenant IDs the user belongs to (CDI >= 3.0)
Error Response
Status Code:400 Bad Request
"Unknown recipe ID: {recipeId}"- Invalid recipe ID provided"max limit allowed is 1000"- Limit exceeds maximum"limit must a positive integer with min value 1"- Invalid limit value"invalid pagination token"- Malformed or expired pagination token
Examples
Basic Usage
Filter by Recipe
Search by Email
Multiple Email Search
Search by Phone
Search by Provider
Pagination
Sort Descending
JavaScript (Node.js)
Python
Paginate Through All Users
Implementation Details
Search Tag Normalization
Email, phone, and provider search tags are normalized:- Converted to lowercase
- Trimmed of whitespace
- Empty tags are filtered out
Limit Restrictions
When searching (email, phone, or provider filters), the maximum limit may be lower than the default 1000 to ensure reasonable response times. Source: View sourceUser ID Mapping
If user ID mapping is enabled, the response will contain external user IDs instead of internal SuperTokens IDs. Source: View sourceVersion Compatibility
The response format varies based on CDI version:- < 3.0: No
tenantIdsfield - < 4.0: Users wrapped in
{recipeId, user}objects - >= 4.0: Direct user objects with
loginMethods - >= 5.3: Enhanced user metadata
Related Endpoints
Get User by ID
Retrieve a specific user by ID
User Count
Get total number of users
Search by Account Info
Advanced user search by account information
API Overview
Learn about pagination and error handling
Additional User Endpoints
Get User by ID
Users Count
Search by Account Info
Best Practices
Performance Tips:- Keep limits reasonable (100-500) for faster responses
- Use recipe filters to narrow down results
- Cache pagination tokens for consistent page navigation
- Consider tenant-specific queries for multitenancy setups
- Always use API keys for authentication
- Don’t expose user lists publicly
- Implement additional access controls in your application layer
- Be mindful of user privacy when logging or displaying user data