Create a User
Create and verify a user to your application.
All requests to the /v2/users/*
endpoints must include both the client_id
and api_key
as detailed in the
Authentication document.
Create and verify a user to your application
.
Creating a Users
Creating users happens through the /v2/users endpoint. Once hit, a dots user will be created if one does not exist based on phone number. This user must then be verified through a one-time code sent over text-message. This code can be requested through the /v2/users/{user_id}/send-verification-token endpoint and then verified through the /v2/users/{user_id}/verify endpoint.
Method
Make a POST
request to the /v2/users endpoint
Parameters
Name | Type | Required | Description |
---|---|---|---|
string | ✔️ | User’s email address | |
country_code | string | ✔️ | User’s phone number country code without the plus sign (‘1’ for the US) |
phone_number | string | ✔️ | User’s phone number as a string containing only digits |
first_name | string | ✔️ | User’s first name as a string |
last_name | string | ✔️ | User’s last name as a string |
username | string | User’s username on your platform. If the username is taken or left blank a random username will be generated | |
metadata | string/object/null | Optional metadata to be stored with the user |
Verifying the created User
Once a user is created, they must be verified through a one-time code sent over text-message. This process can be done using Flows or through the API.
Verify using a Flow
Dots’ pre built components can be used to verify the user. Information on flows can be found here.
Verify through the API
1. Send a verification token by making a POST
request to the /v2/users/{user_id}/send-verification-token endpoint
3. Submit the verification token by calling the /v2/users/{user_id}/verify endpoint
Parameters
Name | Type | Required | Description |
---|---|---|---|
token | string | ✔️ | Verification token sent to the user’s phone number |