Skip to navigation

Add posts to collections, remove them, or replace their collections

Requires posts:write. Changes which collections up to 100 posts already on the team are in, by postIds and/or links. Responds 200 immediately. Does not create posts and does not spend credits.

operation:

  • add puts each post in the listed collections and keeps the ones it is already in
  • remove takes each post out of the listed collections
  • set replaces every collection the post is in with the listed ones (collections: [] takes it out of all of them)

collections takes the same refs as the add routes: { "id": "…" } or { "name": "…" } (case-insensitive). On add and set a name that matches no active collection creates a campaign (created: true), but only when at least one named post is on the team. remove never creates; an unknown name is 404 with error.code: collection_not_found. A name that matches more than one collection is 409 collection_name_ambiguous, and an id on another team is 404. Nothing is written in either case.

Post misses are per-post rows, as on POST /content/posts/tags: not_on_team (link), not_found (id), duplicate_in_batch, unsupported_platform, invalid_url. teamId targets an Enterprise sub-team as on the other content routes.

Rate class content_post_collections (20 / minute, 500 / day per key).

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

OR
X-Api-Keystring
API Key authentication via header

Request

This endpoint expects an object.
operationenumRequired

add merges. remove drops the listed collections and never creates one. set replaces every collection the post is in (collections: [] takes it out of all of them).

Allowed values:
collectionslist of objectsRequired

Must be non-empty for add and remove.

postIdslist of stringsOptional

Post ids on the target team (from GET /posts)

teamIdstringOptional

Enterprise keys only — a sub-team of the key’s enterprise

Response

Membership update applied. Per-post rows give each post’s collections afterwards and what was rejected.

dataobjectOptional
metaobjectOptional

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error