Skip to main content

Identifying users

Overview

In order for Dopt to power experiences for your users, Dopt needs to be aware of those users and their properties.

Developers will need to identify users to Dopt using the Dopt users API.

info

API documentation for the Dopt users API can be found here.

We support two approaches for sending your user data to Dopt: individual identification and bulk identification. In both cases, we manage your user data via upsertion i.e. we provide a single set of APIs for both creating new users in Dopt and updating existing users.

Individual identification

You can use the users API to send us data for a single user. If you've used a Customer Data Platform (CDP) like Segment before, this will be familiar to you. In practice, you might integrate individual identification code into your users CRUD handler.

API reference →

curl \
-H "Content-Type: application/json" \
-H "x-api-key:$USERS_API_KEY" \
-d '{ "name":"Joe McKenney", "email": "joe@dopt.com", "city": "Oakland" }' \
-X POST \
https://users.dopt.com/identify/123456789

We recommend you use a unique user identifier that won’t change for your identifier, such as a database ID from your organization’s internal systems.

info

When you use the users API in the browser the source’s write key is public because it runs in a user’s browser and can be accessed using the browser’s developer tools. You can also call identify via the server which collects data from a server-based installation and isn't accessible to the user.

Bulk identification

Many users have likely been created in your system before Dopt was integrated. To tell us about those users we offer a bulk identify endpoint in the users API that allows you to send us data for many users at once. This endpoint allows you to identify up to 100 users at a time.

API reference →

curl -X POST https://users.dopt.com/identify/bulk \
-H "Content-Type: application/json" \
-H "x-api-key:HNWvcT78tyTwygnbzU6SW" \
-d '
[{
"__dopt_identifier": "123456789",
"name":"Joe McKenney",
"email": "joe@dopt.com",
"city": "Oakland"
}, {
"identifier": "987654321",
"name": "Alon Bartur",
"email": "alon@dopt.com",
"city": "Oakland"
}]
'

Updating user properties

You can update user properties by using the users API. Call the users API with a user identifier and new or updated user properties. The user properties will be updated via upsertion: if the user property doesn’t exist, it will be created. If it does exist, it will be updated.