Skip to main content
POST

Overview

The /admin/users endpoint allows administrators to create new users programmatically. This endpoint requires admin privileges and can be used to create users with specific metadata, roles, and confirmation status.
This endpoint requires either a service role key or admin user JWT token for authentication.

Authentication

This endpoint supports two authentication methods:
  • Service Role Key: Authorization: Bearer <service-role-key>
  • Admin JWT: Authorization: Bearer <admin-jwt-token>

Request

Request Body

Response

Implementation Examples

Admin User Management Component

Bulk User Creation

Node.js Admin Service

Use Cases

User Onboarding

  • Create users for new employees
  • Set up accounts with specific roles and departments
  • Pre-confirm email addresses for trusted domains

Bulk Operations

  • Import users from existing systems
  • Create test accounts for development
  • Set up demo accounts with sample data

Administrative Tasks

  • Create admin accounts with elevated privileges
  • Set up service accounts for integrations
  • Create users with specific metadata requirements

Security Considerations

  • Authentication: Requires service role key or admin JWT
  • Authorization: Verify admin privileges before allowing user creation
  • Input Validation: Validate all input data thoroughly
  • Audit Logging: Log all admin user creation activities
  • Rate Limiting: Implement rate limiting to prevent abuse

Best Practices

  • Password Policy: Enforce strong password requirements
  • Metadata Structure: Use consistent metadata schemas
  • Error Handling: Provide clear error messages
  • Bulk Operations: Implement proper error handling for bulk creation
  • Monitoring: Monitor admin activities for security

Rate Limiting

  • Endpoint: 100 requests per hour per admin
  • Bulk Endpoint: 10 requests per hour per admin
  • Purpose: Prevent abuse while allowing legitimate admin operations

Testing