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
NameTypeRequiredDescription
emailstring✔️User’s email address
country_codestring✔️User’s phone number country code without the plus sign (‘1’ for the US)
phone_numberstring✔️User’s phone number as a string containing only digits
first_namestring✔️User’s first name as a string
last_namestring✔️User’s last name as a string
usernamestringUser’s username on your platform. If the username is taken or left blank a random username will be generated
metadatastring/object/nullOptional 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
NameTypeRequiredDescription
tokenstring✔️Verification token sent to the user’s phone number