Test User Management API Overview
Overview
Using the test user management APIs enables administrators to manage their test users utilizing a management key. This allows administrators to generate login details to test the user authentication flow.
Management keys are generated from Company > Management Keys. These keys will be used within the bearer token. The format is <Project ID>:<Management Key>
.
Use Cases
Test User Management:
- Create test Users
- Generate OTP (sms/email) for test users
- Generate Magic Link (sms/email) for test users
- Generate Enchanted Link (email) for test users
- Delete Test Users
Examples
Example - Create Test User and Validate Authentication Functionality with OTP
- Create a user with the
test
flag set to true to set it as a test user. - Generate an OTP code for the test user, when you generate this, you can set it to sms or email for the delivery method.
- Verify the OTP code via verify OTP email or verify OTP sms
- Delete the test user or delete all test users
Example - Create Test User and Validate Authentication Functionality with Enchanted Link
- Create a user with the
test
flag set to true to set it as a test user. - Generate an Enchanted Link for the test user.
- Verify the token
- Delete the test user or delete all test users
User Management API Overview
Use the Descope API to manage your application users with a management key.
Generate OTP POST
### Generate an OTP verification code for a test user. This endpoint is used to generate an OTP verification code for a test user. You can define whether this is sent via email or sms. Once you generate the OTP code, you must verify the OTP code via [verify OTP email](/api/otp/email/verify-otp) or [verify OTP sms](/api/otp/sms/verify-otp) ### See Also - See [OTP Authentication](/api/otp/) for details about implementing OTP. - See [Create a user](/api/management/users/create-user) with the `test` flag set to true to set it as a test user. - See [Manage Test Users](/manage/testusers/) for more information on test users. ### Endpoint Authentication Use authorization bearer header with the following format: `Authorization: Bearer <ProjectId:ManagementKey>`