Entitlements
Read the current user's active entitlements.
Entitlements are populated server-side (your server-side grant, or an optional subscription integration) — this read endpoint is the only client-side way to inspect them. It never writes, so a client cannot grant itself access.
is_active is derived: an entitlement reads active only when it is marked active and has not passed its expiration_date. A lapsed subscription therefore never reads as active, even before its expiry event is processed.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /client/entitlements | The current user's entitlements. |
| POST | /client/entitlements/restore | Restore Purchases — re-sync owned entitlements. |
GET /client/entitlements
Query parameters
| Param | Type | Description |
|---|---|---|
active_only | boolean | When true, returns only currently-active (unexpired) grants. |
Response 200
Errors
500 FETCH_FAILED.
Try it:
/client/entitlementscurl -X GET 'https://api.amba.dev/v1/client/entitlements'Curl:
POST /client/entitlements/restore
Re-syncs the user's owned entitlements from the configured subscription service and re-applies them, returning the active set. This is the App Store "Restore Purchases" requirement (guideline 3.1.1). No request body.
Fail-closed: if the subscription service is unreachable, the endpoint returns an error and the user's entitlement state is left unchanged — it never silently unlocks or revokes.
Response 200
Errors
404 USER_NOT_FOUND— no app user resolved from the session token.409 RESTORE_UNAVAILABLE— no subscription service configured for the project.502 RESTORE_UPSTREAM_FAILED— the subscription service could not be reached; access unchanged.500 RESTORE_FAILED.
Curl: