Add a User to Stytch.
user_id is returned in the response that can then be used to perform other operations within Stytch.
An email or a phone_number is required.Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Request type
The email address of the end user.
The name of the user. Each field in the name object is optional.
Flag for whether or not to save a user as pending vs active in Stytch. Defaults to false. If true, users will be saved with status pending in Stytch's backend until authenticated. If false, users will be created as active. An example usage of a true flag would be to require users to verify their phone by entering the OTP code before creating an account for them.
An identifier that can be used in API calls wherever a user_id is expected. This is a string consisting of alphanumeric, ., _, -, or | characters with a maximum length of 128 characters.
Roles to explicitly assign to this User. See the RBAC guide for more information about role assignment.
Successful response
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
The unique ID of the affected User.
The unique ID of a specific email address.
The status of the User. The possible values are pending and active.
The unique ID for the phone number.
The user object affected by this API call. See the Get user endpoint for complete response field details.
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.