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).
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /client/users/me | Current user profile. Auto-backfills timezone from request headers. |
| PATCH | /client/users/me | Update display_name, avatar_url, properties, and/or timezone. |
| POST | /client/users/me/push-token | Register a push token (upsert on token). |
| DELETE | /client/users/me/push-token | Mark a token inactive. |
GET /client/users/me
Response 200
Auto-backfill of timezone
If timezone is NULL for the user and the request carries one of the following headers, the API stores the header value and returns it in the response:
Time-Zone(RFC 7231).X-Amba-Timezone(Amba SDK convention; preferred when both are present).
A non-null existing timezone is never overwritten by header detection — explicit user preference always wins. Invalid IANA names are ignored.
Errors
404 NOT_FOUND.500 FETCH_FAILED.
Try it:
/client/users/mecurl -X GET 'https://api.amba.dev/v1/client/users/me'Curl:
PATCH /client/users/me
Only these keys are honored: display_name, avatar_url, properties, timezone. Other keys are silently ignored.
timezone must be a valid IANA name (e.g. America/New_York, Europe/London, UTC). Validated by Intl.DateTimeFormat; bogus zones (or explicit null) are rejected with 400 INVALID_TIMEZONE. Set this once you know the user's zone — it powers the delivery_mode='local_time' push feature so 09:00 reminders fire at 09:00 in the user's actual time.
Request
Response 200
Updated user row (same shape as GET /me).
Errors
400 INVALID_INPUT— no updatable fields provided.400 INVALID_TIMEZONE—timezoneis not a valid IANA name.404 NOT_FOUND.500 UPDATE_FAILED.
Try it:
/client/users/mecurl -X PATCH 'https://api.amba.dev/v1/client/users/me' \
-H 'Content-Type: application/json' \
-d '{
"display_name": "Ada",
"properties": {
"theme": "dark"
}
}'Curl:
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
| Field | Type | Required |
|---|---|---|
token | string | yes |
platform | "ios" | "android" | yes |
provider is derived automatically (ios → apns, android → fcm).
Response 200
Errors
500 REGISTER_FAILED.
Try it:
/client/users/me/push-tokencurl -X POST 'https://api.amba.dev/v1/client/users/me/push-token'Curl:
DELETE /client/users/me/push-token
Soft-delete: sets is_active = false.
Request
| Field | Type | Required |
|---|---|---|
token | string | yes |
Response 200
Errors
500 UNREGISTER_FAILED.
Try it:
/client/users/me/push-tokencurl -X DELETE 'https://api.amba.dev/v1/client/users/me/push-token'Curl: