Skip to main content
PUT
Update user information, metadata, and settings. This endpoint requires service role authentication and allows administrators to modify user accounts programmatically.
This endpoint requires service role authentication. Only use the service role key on your backend servers, never in client-side code.

Path Parameters

string
required
The unique identifier (UUID) of the user to update.

Request Body

string
New email address for the user. Must be unique and valid.
string
New phone number in E.164 format (e.g., +1234567890).
string
New password for the user. Must meet security requirements.
string
ISO 8601 timestamp when email was confirmed. Set to null to mark as unconfirmed.
string
ISO 8601 timestamp when phone was confirmed. Set to null to mark as unconfirmed.
object
User-controlled metadata (profile information, preferences, etc.).
object
Application-controlled metadata (roles, permissions, subscription info, etc.).
string
Duration to ban the user (e.g., “24h”, “7d”, “permanent”). Set to null to unban.

Response

string
Unique identifier for the user
string
Audience claim, typically “authenticated”
string
User’s role in the system
string
User’s email address
string
User’s phone number
string
ISO 8601 timestamp when email was confirmed
string
ISO 8601 timestamp when phone was confirmed
string
ISO 8601 timestamp of last sign in
object
Application-controlled metadata
object
User-controlled metadata
string
ISO 8601 timestamp when user was created
string
ISO 8601 timestamp when user was last updated
string
ISO 8601 timestamp until when user is banned (if applicable)

Error Responses

Update Operations

Update Profile Information

Update Contact Information

Update App Metadata (Roles & Permissions)

Ban/Unban User

Reset Password

Implementation Examples

React Admin User Update Form

Node.js Backend Handler

Bulk User Update

Security Considerations

  • Service Role Protection: Never expose service role keys in client-side code
  • Input Validation: Validate all input data before processing
  • Audit Logging: Log all user modifications for compliance
  • Rate Limiting: Implement rate limits for admin operations
  • Permission Checks: Verify admin permissions before allowing updates

Best Practices

  • Validate email uniqueness before updating
  • Ensure phone numbers are in E.164 format
  • Validate password strength requirements
  • Sanitize metadata to prevent injection attacks
  • Use user_metadata for user-controlled data
  • Use app_metadata for application-controlled data
  • Implement schema validation for metadata
  • Consider metadata size limits
  • Provide clear feedback on update success/failure
  • Show validation errors clearly
  • Implement optimistic updates where appropriate
  • Allow partial updates without requiring all fields

Testing

Unit Tests

Create User

Create new user accounts

Generate Link

Generate authentication links

Invite User

Send user invitations

Get Profile

Get user profile information