CoolaData provides an API that can be used to match between 2 identities of the same user without having to send an event. The API matches between a user_id and that user’s user_alternative_id.
Once an event is sent with a user_id and user_alternative_id together or and API request for matching is sent, Cooladata will associate all events from this registered user, based on user_alternative_id, to the pre-registered user, based on user_id. Read more about handling multiple user identities here.
The API is called using customer_user_id (the actual user id sent in events, not the internal_user_id Cooladata allocated per user). The API will work only for existing users that sent events in the past. Notice that since Cooladata deletes users after a period of inactivity, the user updated might not exist in Cooladata records if the period has past. For more information about the period Cooladata keeps users for please contact support@cooladata.com or contact your CSM directly.
API End Point
https://app.cooladata.com/api/v2/projects/{projectId}/users/identities
Replace the [project_id] placeholder with your actual Project ID found in the project settings.
Method
POST
Header
ContentType:application/json Authorization:Token [User_API_Token]
Replace the [User_API_Token] placeholder with your actual user API Token found when clicking on your user in the application.
The request will be permitted only for ADMIN user permissions.
Payload
{ "customer_user_id" : "<user_id>", "alternative_user_id": "<new alternative user id >" }
Sample Payload
{ "customer_user_id" : "458dsf832-4324h3-dsfsf34532-dsf73d", "alternative_user_id": "johdue@gmailtest.com" }
Response
- Success: 200 ok + number of users updated
- Failure: 400 bad request
- No customer user id <id> for project <project id> – this means the user_id you requested to update does not exist (never sent events) or was deleted since the period of user inactivity defined in your project has past.
- Operation requires admin permissions on project <project id> – this means you are using a non-admin authorization token.