Identify
POST https://api.casinocrm.io/v1/players/identify — tells casinocrm.io that an
anonymous_id is a real player with these traits. Call it on signup and
whenever a trait (email, phone, …) changes.
Auth: API key (project-scoped) — Authorization: Bearer ucrm_pk_....
Request
{
"anonymous_id": "casino_player_001", // REQUIRED — your stable player id
"traits": { // all optional
"email": "player@example.com",
"phone": "+420771234567", // E.164
"telegram_id": "12345",
"wallet": { "network": "btc", "address": "bc1q..." }
}
}
Identity = anonymous_id
anonymous_id is required — a stable id you control. Server-side platforms
send their own permanent player id here. There is no top-level external_id
field on identify; use anonymous_id as the join key (the same value you put on
every event).
Accepted traits
Only these keys are allowed inside traits (others return
422 unrecognized_keys):
| Trait | Notes |
|---|---|
email | case-insensitive match |
phone | E.164 (+420...) |
telegram_id | string |
wallet | { "network": "btc|eth|...", "address": "..." } — address validated per network |
Resolution algorithm
- Validate —
anonymous_idrequired; traits optional. - Find candidates by priority:
email→phone→telegram_id→wallet (network,address). - Resolve:
- No candidate → INSERT a new player keyed by
anonymous_id(action: created). - One candidate → MERGE traits, attach the
anonymous_id(action: updated). - Conflicting candidates → keep the oldest, mark others
status='conflict'for admin review.
- No candidate → INSERT a new player keyed by
Response
{
"data": {
"player_id": "uuid", // store this if you want to send events by player_id
"action": "created" | "updated"
}
}
Errors
| Code | Meaning |
|---|---|
200 | resolved |
401 | bad/missing API key |
422 anonymous_id Required | missing anonymous_id |
422 unrecognized_keys | a trait key is not in the accepted set |
422 wallet ... | wallet address doesn't match the network format |