POST /v1/identify/alias

Alias one ID into another

alias is a server-side operation that merges two identifiers into the same profile. The most common use is collapsing an external_id you wrote earlier into a different one (e.g. an internal user ID swap after a re-auth migration).

This endpoint requires a server key (gflux_secret_*). It accepts no publishable key, your browser cannot rewrite identities.

POST /v1/identify/alias HTTP/1.1
Host: api.getfluxly.com
Authorization: Bearer gflux_secret_abcdef1234
Content-Type: application/json
X-Idempotency-Key: 1f2a3b4c-5d6e-7f80-91a2-b3c4d5e6f708

{
  "user_id": "user_42",
  "anonymous_id": "anon_a8f3c2"
}

Request body

At least one of anonymous_id or previous_id is required alongside user_id.

FieldTypeRequiredNotes
user_idstringyesThe target identifier (the one that survives)
anonymous_idstringone ofBrowser-side identifier to fold in
previous_idstringone ofA prior external_id to fold in
request_idstringnoEchoed back in the response, for log correlation

Response, 200 OK

{
  "alias": {
    "user_id": "user_42",
    "anonymous_id": "anon_a8f3c2",
    "merged_at": "2026-05-16T07:00:00Z"
  }
}

Errors

HTTPerrorWhen
400validation_errorMissing user_id or no source ID provided
403wrong_key_typeTried to use a publishable key
409alias_conflictSource ID already belongs to a different active profile

alias_conflict is rare and almost always a code bug, your application is calling alias with the same source ID for two different targets. The response body names both profiles so you can pick one and re-alias.