Create User Alias

Add an alternative identifier that references an existing user

Link multiple identifiers to the same user profile. After creating an alias, you can pass either ID in future API calls.

Endpoint

text
POST /users/aliases

Authentication

Required: Bearer token in Authorization header

text
Authorization: Bearer YOUR_API_KEY

Request Body

json
{
  "user_id": "user_123",
  "alias_id": "legacy_999"
}

Parameters

Parameter Type Required Description
user_id string Yes ID of the existing user (you may instead supply primary_user_id UUID)
alias_id string Yes New alias to associate with the user

Response

json
{
  "success": true,
  "alias_id": "legacy_999",
  "user_id": "user_123",
  "message": "Alias created"
}

Examples

JavaScript

javascript
const response = await fetch('https://api.appizer.com/v1/users/aliases', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    user_id: 'user_123',
    alias_id: 'legacy_999'
  })
});

const data = await response.json();
console.log(data);

Python

python

response = requests.post(
    'https://api.appizer.com/v1/users/aliases',
    headers={
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={
        'user_id': 'user_123',
        'alias_id': 'legacy_999'
    }
)

print(response.json())

cURL

bash
curl -X POST https://api.appizer.com/v1/users/aliases \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "user_123",
    "alias_id": "legacy_999"
  }'

Error Responses

Status Code Description
400 Bad Request - Invalid request body or missing required fields
401 Unauthorized - Invalid or missing API key
404 Not Found - User ID does not exist
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error - Something went wrong on our end

Use Cases

  • System Migration: Link old system IDs to new user IDs
  • Multi-Platform: Connect user IDs across different platforms (web, iOS, Android)
  • Third-Party Integration: Associate external service IDs with your users
  • Anonymous to Identified: Link anonymous session IDs to authenticated user IDs

Best Practices

  • Create aliases before the user_id changes in your system
  • Use aliases for backward compatibility during migrations
  • Document which IDs are aliases vs primary IDs in your system
  • Avoid creating circular alias relationships
On this page