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

POST /users/aliases

Authentication

Required: Bearer token in Authorization header

Authorization: Bearer YOUR_API_KEY

Request Body

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

Parameters

ParameterTypeRequiredDescription
user_idstringYesID of the existing user (you may instead supply primary_user_id UUID)
alias_idstringYesNew alias to associate with the user

Response

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

Examples

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

import requests

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

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 CodeDescription
400Bad Request - Invalid request body or missing required fields
401Unauthorized - Invalid or missing API key
404Not Found - User ID does not exist
429Too Many Requests - Rate limit exceeded
500Internal 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