Collections
Collections let members work with saved ad and page groups through the public API.
List collections
Section titled “List collections”Requires collections:read.
curl https://api.afterlib.com/v1/collections \ -H "Authorization: Bearer $AFTERLIB_API_KEY"The response includes owned collections, accessible team collections, and visible default-style collections such as favorites when available. Hidden collections are not returned.
Read collection items
Section titled “Read collection items”Requires collections:read plus the matching item scope.
itemType=adsrequiresads:read.itemType=pagesrequirespages:read.
curl "https://api.afterlib.com/v1/collections/00000000-0000-0000-0000-000000000000/items?itemType=pages&limit=50" \ -H "Authorization: Bearer $AFTERLIB_API_KEY"The response includes the collection summary, itemType, returned items, cursor, and hasMore.
Missing or inaccessible collections return 404 so collection existence is not leaked.
Add a collection item
Section titled “Add a collection item”Requires collections:write plus the matching item scope.
curl https://api.afterlib.com/v1/collections/00000000-0000-0000-0000-000000000000/items \ -X POST \ -H "Authorization: Bearer $AFTERLIB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "itemType": "pages", "itemId": "1234567890" }'The endpoint is idempotent. If the item already exists in the collection, the response returns added: false.