Skip to main content

POST /api/alias

Merges user identities. This endpoint is optional but recommended for preserving event history when users sign up.

Request

Headers

Content-Type
string
required
application/json
X-Api-Key
string
required
Your API key

Body

userId
string
required
New user ID (the identified user ID)
previousId
string
required
Previous user ID (usually the anonymous ID)
timestamp
string
required
ISO 8601 timestamp

Example Request

curl -X POST https://api.solute.dev/api/alias \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: your_api_key" \
  -d '{
    "userId": "user_123",
    "previousId": "anon_456",
    "timestamp": "2025-01-15T10:30:00Z"
  }'

Response

Success Response

success
boolean
required
true if the request was successful
userId
string
required
The new user ID
previousId
string
required
The previous user ID

Example Response

{
  "success": true,
  "userId": "user_123",
  "previousId": "anon_456"
}

Use Case

This endpoint is typically called when a user signs up. It merges their anonymous identity with their new user ID, ensuring all events from before signup are associated with the user.