Amba

Users

Current user profile, partial updates, and push-token registration.

All endpoints operate on the authenticated user (me is implicit — the session token identifies the user).

Source: apps/api/src/routes/client/users.ts.

Endpoints

MethodPathDescription
GET/client/users/meCurrent user profile.
PATCH/client/users/meUpdate display_name, avatar_url, and/or properties.
POST/client/users/me/push-tokenRegister a push token (upsert on token).
DELETE/client/users/me/push-tokenMark a token inactive.

GET /client/users/me

Response 200

{
  "data": {
    "id": "…",
    "email": "…",
    "display_name": "…",
    "avatar_url": "…",
    "external_id": "…",
    "anonymous_id": "anon_…",
    "auth_providers": [{ "provider": "apple", "provider_id": "…" }],
    "properties": {},
    "first_seen_at": "…",
    "last_seen_at": "…"
  }
}

Errors

  • 404 NOT_FOUND.
  • 500 FETCH_FAILED.

Try it:

GET/client/users/me
client auth
curl -X GET 'https://api.amba.dev/client/users/me'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X GET '${BASE_URL}/client/users/me' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}'

PATCH /client/users/me

Only these keys are honored: display_name, avatar_url, properties. Other keys are silently ignored.

Request

{ "display_name": "Ada", "properties": { "theme": "dark" } }

Response 200

Updated user row (same shape as GET /me).

Errors

  • 400 INVALID_INPUT — no updatable fields provided.
  • 404 NOT_FOUND.
  • 500 UPDATE_FAILED.

Try it:

PATCH/client/users/me
client auth
curl -X PATCH 'https://api.amba.dev/client/users/me' \
  -H 'Content-Type: application/json' \
  -d '{
  "display_name": "Ada",
  "properties": {
    "theme": "dark"
  }
}'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X PATCH '${BASE_URL}/client/users/me' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{"display_name":"Ada","properties":{"theme":"dark"}}'

POST /client/users/me/push-token

Register a device push token. Upsert by token — re-registering the same device token updates app_user_id, platform, and reactivates it.

Request

FieldTypeRequired
tokenstringyes
platform"ios" | "android"yes

provider is derived automatically (iosapns, androidfcm).

Response 200

{
  "data": {
    "id": "…",
    "app_user_id": "…",
    "token": "…",
    "platform": "ios",
    "provider": "apns",
    "is_active": true
  }
}

Errors

  • 500 REGISTER_FAILED.

Try it:

POST/client/users/me/push-token
client auth
curl -X POST 'https://api.amba.dev/client/users/me/push-token'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X POST '${BASE_URL}/client/users/me/push-token' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{}'

DELETE /client/users/me/push-token

Soft-delete: sets is_active = false.

Request

FieldTypeRequired
tokenstringyes

Response 200

{ "data": { "unregistered": true } }

Errors

  • 500 UNREGISTER_FAILED.

Try it:

DELETE/client/users/me/push-token
client auth
curl -X DELETE 'https://api.amba.dev/client/users/me/push-token'
Loading auth… Configure auth in the settings drawer (top-right) to run this request.

Curl:

curl -X DELETE '${BASE_URL}/client/users/me/push-token' \
  -H 'X-Api-Key: ${CLIENT_API_KEY}' \
  -H 'Authorization: Bearer ${SESSION_TOKEN}'

On this page