Admin API
Developer-plane routes for managing projects, users, content, gamification, and every other Amba resource.
All admin routes sit under /admin and require a valid developer access token in Authorization: Bearer. Project-scoped routes are nested under /admin/projects/:projectId/* and additionally enforce project ownership — the developer must own the referenced project or the request is rejected with 403 PROJECT_FORBIDDEN.
Shape
Successful writes return 201 with { "data": <resource> }. Reads return 200 with { "data": <payload> } or { "data": <array> }. Failures return { "error": { "code": ..., "message": ... } }.
Modules
| Module | Prefix | Purpose |
|---|---|---|
| projects | /admin/projects | Create, list, update, delete, and reprovision Amba projects; manage API keys. |
| users | /admin/projects/:projectId/users | List and inspect end users and their engagement events. |
| push | /admin/projects/:projectId/push/campaigns | Create push campaigns, trigger immediate sends, run a test push. |
| segments | /admin/projects/:projectId/segments | CRUD on rule-based user segments; kick off manual re-evaluation. |
| config | /admin/projects/:projectId/config | Remote-config keys with segment-based + percentage overrides. |
| content | /admin/projects/:projectId/content | Content libraries, items, bulk import, and scheduled delivery. |
| streaks | /admin/projects/:projectId/streaks | Streak definitions (daily / weekly, grace window, freezes). |
| xp | /admin/projects/:projectId/xp | XP rules + per-user XP inspection. |
| achievements | /admin/projects/:projectId/achievements | Achievement definitions. |
| challenges | /admin/projects/:projectId/challenges | Time-boxed challenges + participants. |
| leaderboards | /admin/projects/:projectId/leaderboards | Leaderboard definitions + entries. |
| currencies | /admin/projects/:projectId/currencies | Virtual currencies, grants, transaction history. |
| catalog | /admin/projects/:projectId/catalog | Catalog items, prices, bundles. |
| stores | /admin/projects/:projectId/stores | Stores + listings. |
| inventory | /admin/projects/:projectId/inventory | Per-user inventory reads + manual grants. |
| referrals | /admin/projects/:projectId/referrals | Referral programs + stats. |
| feeds | /admin/projects/:projectId/feeds | Feed rules + moderation. |
| friends | /admin/projects/:projectId/friends | Friendship inspection + moderation deletes. |
| groups | /admin/projects/:projectId/groups | Groups + members. |
| messaging | /admin/projects/:projectId/messaging | Conversation + message inspection and moderation. |
| reviews | /admin/projects/:projectId/reviews | Review moderation. |
| moderation | /admin/projects/:projectId/moderation | Moderation queue, rules, user trust. |
| onboarding | /admin/projects/:projectId/onboarding | Onboarding flow definitions. |
| deep-links | /admin/projects/:projectId/deep-links | Deep-link config + tracked links. |
| media | /admin/projects/:projectId/media | Media assets + folders. |
| roles | /admin/projects/:projectId/roles | Role definitions + assignments. |
| sessions | /admin/projects/:projectId/sessions | Session analytics. |
| integrations | /admin/projects/:projectId/integrations | Third-party integrations (RevenueCat, Superwall). |
Common errors
| Code | Status | Meaning |
|---|---|---|
UNAUTHORIZED | 401 | Missing or invalid developer token. |
PROJECT_FORBIDDEN | 403 | Developer does not own the referenced project. |
NOT_FOUND | 404 | Resource does not exist in the tenant DB. |
TENANT_NOT_PROVISIONED | 503 | Project's Neon DB is still provisioning or in a failed state. |
LIST_FAILED / FETCH_FAILED / CREATE_FAILED / UPDATE_FAILED / DELETE_FAILED | 500 | Generic handler failure — the real error is logged server-side. |