Skip to content

Collections

Collections let members work with saved ad and page groups through the public API.

Requires collections:read.

Terminal window
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.

Requires collections:read plus the matching item scope.

  • itemType=ads requires ads:read.
  • itemType=pages requires pages:read.
Terminal window
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.

Requires collections:write plus the matching item scope.

Terminal window
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.