Content Libraries
Manage and schedule content delivery — daily tips, quotes, articles, and more.
Content libraries let you manage collections of content items (tips, quotes, affirmations, articles) and deliver them to users on a schedule. Great for apps that need daily content rotation.
How it works
- Create a content library (e.g., "Daily Motivation", "Workout Tips")
- Add content items to the library with text, media, categories, and tags
- Create a delivery schedule to control when and how items are delivered
- The client SDK fetches today's content or browses the full library
SDK usage
Get today's content
getToday returns a single ContentItem | null — the one item selected by the channel's active schedule for the current day window.
Browse a library
Get a single item
Create, update, and delete items from the client
The SDK exposes write endpoints for user-owned content. The server stamps owner_app_user_id from the current session — the caller cannot set it. updateItem and deleteItem return 404 when the target item isn't owned by the current user.
CreateContentItemInput:
UpdateContentItemInput:
Client API reference
| Method | Path | Description |
|---|---|---|
GET | /client/content/today | Today's scheduled content items. |
GET | /client/content/libraries/:id/items | List items in a library (query: category, limit, offset). |
GET | /client/content/items/:id | Fetch a single item. |
POST | /client/content/libraries/:id/items | Create an item owned by the current user. |
PATCH | /client/content/items/:id | Update an item owned by the current user. |
DELETE | /client/content/items/:id | Delete an item owned by the current user. |
Admin API reference
Libraries
| Method | Path | Description |
|---|---|---|
POST | /admin/content/libraries | Create library |
GET | /admin/content/libraries | List libraries with item counts |
Items
| Method | Path | Description |
|---|---|---|
POST | /admin/content/libraries/:id/items | Add items to library |
GET | /admin/content/libraries/:id/items | List items (paginated) |
PATCH | /admin/content/items/:id | Update an item |
DELETE | /admin/content/items/:id | Delete an item |
POST | /admin/content/libraries/:id/bulk | Bulk import items |
Schedules
| Method | Path | Description |
|---|---|---|
POST | /admin/content/schedules | Create delivery schedule |
GET | /admin/content/schedules | List schedules |
PATCH | /admin/content/schedules/:id | Update schedule |
POST /admin/content/libraries/:id/items
Body:
Schedule types
| Type | Description |
|---|---|
daily_rotation | Rotates through items one per day |
weekly | Delivers one item per week |
random | Picks a random item each delivery |
sequential | Delivers items in sort order |
MCP tools
| Tool | Description |
|---|---|
amba_content_libraries_create | Create a content library |
amba_content_items_add | Add items to a library |
amba_content_schedules_create | Set up a delivery schedule |
Example: Daily affirmations
Versioning + rollouts
Each content_item row carries three columns that together let you ship copy changes without an app deploy:
content_key— a stable, user-facing key (e.g.mission_intro,paywall_headline). Multiple rows with the same(library_id, content_key)are treated as versions of each other.version— integer, immutable per row. The first POST under a key seeds version1; subsequent POSTs auto-increment.rollout_percent— integer in[0, 100]. The server hashes(user_id, item_id)into a[0, 99]bucket and serves the highest-version row whosebucket < rollout_percent. If no version matches, the highest-version row pinned at100%serves as the stable baseline so every user always gets a row.
The hash is deterministic, so the same user always sees the same version on subsequent requests until you change rollout_percent. Distribution is uniform — at 50% rollout, expect within ±10% of half your users to land on the new version.
Items with content_key = NULL predate this feature and continue to behave exactly as before.
Ramp a rollout: 10% → 50% → 100%
The partner-shipped recipe for ramping a copy change with no app deploy:
Versioning admin endpoints
| Method | Path | Description |
|---|---|---|
POST | /admin/content/libraries/:id/items/:key/versions | Create a new version. First version of a key seeds at 100%; subsequent at 0%. |
PATCH | /admin/content/libraries/:id/items/:key/versions/:v | Update body / metadata / rollout_percent (0–100). Common: ramp the rollout. |
GET | /admin/content/libraries/:id/items/:key/versions | List all versions of a key (DESC by version) with their rollout_percent each. |
Versioned client fetch
Returns the version the current authenticated user should see. The bucket is computed from the user's id, so two different users may receive different versions of the same key. The response shape matches the regular GET /client/content/items/:id (a single ContentItem), so the SDK's rendering pipeline does not need special-casing.
If no version's bucket matches and no 100% baseline exists (the operator-error case where every version is at 0%), the highest-version row is returned anyway — better to serve something than nothing while the operator notices.