Users API
The Users API allows you to create, update, and manage user identities and profiles.
Identify / Set User Properties
Creates a new user profile or updates an existing one if the distinct_id already exists.
Endpoint
POST /public/identify
Authentication
Include your Public API Key in the JSON payload.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| apiKey | string | Yes | Your Public API Key. |
| distinct_id | string | Yes | The unique identifier of the user. |
| properties | object | No | A dictionary of properties to set on the user's profile. |
Request Example
curl -X POST "https://api.empmix.com/public/identify" \
-H "Content-Type: application/json" \
-d '{
"apiKey": "YOUR_PUBLIC_API_KEY",
"distinct_id": "user_123",
"properties": {
"$name": "John Doe",
"$email": "test@test.com",
"plan": "pro"
}
}'Advanced Profile Operations (People API)
Increment numeric values (e.g., login count) or append to arrays (e.g., list of interests) safely without overwriting the entire profile.
Endpoint
POST /public/people/set
Authentication
⚠️
Privileged Endpoint
This endpoint requires your Secret Key.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| apiKey | string | Yes | Your Secret Key. |
| distinct_id | string | Yes | The unique identifier of the user. |
| operations | object | Yes | An object detailing the operations to perform ($set, $add, $append). |
Request Example
{
"apiKey": "YOUR_SECRET_KEY",
"distinct_id": "user_123",
"operations": {
"$set": {
"last_login": "2023-10-27"
},
"$add": {
"login_count": 1
}
}
}Alias Identity
Links an anonymous device ID to a newly created database user ID (typically used upon signup).
Endpoint
POST /public/alias
Authentication
Include your Secret Key in the JSON payload.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| apiKey | string | Yes | Your Secret Key. |
| alias_id | string | Yes | The permanent ID to link to. |
| original_id | string | Yes | The anonymous ID you are aliasing from. |
Request Example
{
"apiKey": "YOUR_SECRET_KEY",
"alias_id": "user_123",
"original_id": "anon_456"
}