> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.docs.siftsy.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.siftsy.com/_mcp/server.

# Collections and tags

> Create, rename, and organize collections and content tags, and put posts in them — without adding content or spending credits.

Collections (campaigns and groups) and content tags are how a team curates its posts. The routes on this page manage both programmatically: create them ahead of time, rename them, and move posts that are already on the team in and out of them.

None of these routes add posts or spend credits. To add new posts straight into a collection or with tags, pass `collections` and `tags` on [`POST /content/posts/add`](/guides/core-concepts/adding-content#add-posts-by-url) instead.

> **Info**
>
> Every write route here needs the `posts:write` scope, which is **off by default**. A team admin enables it per key under **Team Settings → API**. Reading collections needs `collections:read`; listing tags needs `posts:read`.

| Task                                                                | Route                                                                |
| ------------------------------------------------------------------- | -------------------------------------------------------------------- |
| List collections                                                    | `GET /collections`                                                   |
| Create a collection                                                 | `POST /collections`                                                  |
| Rename a collection                                                 | `PATCH /collections/{id}`                                            |
| Archive or unarchive a collection                                   | `POST /collections/{id}/archive`, `POST /collections/{id}/unarchive` |
| Add posts to collections, remove them, or replace their collections | `POST /content/posts/collections`                                    |
| List the team's tags                                                | `GET /tags`                                                          |
| Create tags                                                         | `POST /tags`                                                         |
| Rename a tag (every post that has it)                               | `PATCH /tags/{tag}`                                                  |
| Add, replace, or remove tags on posts                               | `POST /content/posts/tags`                                           |

Every change made through these routes shows in the team's activity feed, credited to the API key.

## Collections

Collections are the campaign / group hierarchy in Siftsy. `type: campaign` rows are top-level. `type: group` rows nest one level under a campaign through `parentId`. See [Content selection](/guides/core-concepts/content-selection#collections) for how they are read.

Collection names are unique on the team in any casing, because the content routes match collections by name. Wherever a name is already taken, the response is `409 collection_name_taken` with the existing collection in `error.candidates[]` (`{ id, name, type }`), and nothing is written. Pass that id instead.

### Create a collection

```bash
POST /analyst/v1/collections
{ "name": "Summer Launch", "description": "Paid + organic, June–August" }
```

```json
HTTP/1.1 201 Created

{ "data": { "id": "col_launch", "name": "Summer Launch", "type": "campaign", "parentId": null, … }, "meta": {} }
```

| Field         | Required | Meaning                                                                                               |
| ------------- | -------- | ----------------------------------------------------------------------------------------------------- |
| `name`        | Yes      | Up to 120 characters. Whitespace is collapsed                                                         |
| `type`        | No       | `campaign` (default) or `group`                                                                       |
| `parentId`    | No       | Only with `type: group`: the campaign to nest under. A group id here is `400`; an unknown id is `404` |
| `description` | No       | Up to 500 characters                                                                                  |

To create a group inside that campaign:

```bash
POST /analyst/v1/collections
{ "name": "Wave 1", "type": "group", "parentId": "col_launch" }
```

The returned `id` works anywhere a collection ref is accepted, as `{ "id": "col_…" }`.

### Rename a collection

```bash
PATCH /analyst/v1/collections/col_launch
{ "name": "Summer Launch 2026" }
```

Returns `200` with the renamed collection. Renaming to the current name changes nothing. Posts stay where they are.

### Archive a collection

`POST /collections/{id}/archive` archives a collection, the same as Archive in the app. Archiving a campaign also archives every group under it. Archived collections drop out of `GET /collections` unless you pass `include_archived=true`. Nothing is deleted, and no credits move.

The body is optional. By default the posts stay as they are. Pass `includePosts: true` to archive every post in the collection as well, including posts in a campaign's groups.

```bash
POST /analyst/v1/collections/col_launch/archive
{ "includePosts": true }
```

```json
{
  "data": { "id": "col_launch", "name": "Summer Launch", "type": "campaign", "status": "archived", "archivedAt": "2026-11-23T18:04:11.000Z", … },
  "meta": {
    "changed": true,
    "subcollectionIds": ["col_wave1"],
    "posts": { "status": "archived", "updated": 18, "failed": [] }
  }
}
```

| `meta` field       | Meaning                                                                                                                                                          |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `changed`          | `false` when the collection was already archived. Its groups and posts are still brought along                                                                   |
| `subcollectionIds` | Groups archived along with a campaign                                                                                                                            |
| `posts`            | `null` unless you sent `includePosts: true`. `failed` lists posts that could not be updated (`reason: update_failed`); send the same request again to retry them |

`POST /collections/{id}/unarchive` takes the same body and returns the same shape. It restores the collection and, for a campaign, its archived groups. With `includePosts: true`, the collection's archived posts are restored too.

To archive individual posts instead of a whole collection, use [`POST /content/posts/archive`](/guides/core-concepts/adding-content#archive-posts).

### Put posts in collections

`POST /content/posts/collections` changes which collections up to 100 posts already on the team are in. Name posts by `postIds`, `links`, or both. Name collections by `{ "id": "…" }` or `{ "name": "…" }` (case-insensitive). It answers immediately with `200`.

```bash
POST /analyst/v1/content/posts/collections
{
  "operation": "add",
  "links": ["https://www.tiktok.com/@dove/video/7412345678901234567"],
  "postIds": ["post_01j9z"],
  "collections": [{ "name": "Q4 Launch" }]
}
```

| `operation` | Effect                                                                                                      |
| ----------- | ----------------------------------------------------------------------------------------------------------- |
| `add`       | Put each post in the listed collections. The collections it is already in stay                              |
| `remove`    | Take each post out of the listed collections                                                                |
| `set`       | Replace every collection the post is in with the listed ones. `collections: []` takes it out of all of them |

On `add` and `set`, a name that matches no active collection creates a campaign (`created: true` in `collections`), but only when at least one of the posts is on the team. `remove` never creates a collection: an unknown name is `404 collection_not_found`. A name that matches more than one collection is `409 collection_name_ambiguous`.

```json
{
  "data": {
    "operation": "add",
    "teamId": "team_2f8c1a",
    "collections": [{ "id": "col_9a1", "name": "Q4 Launch", "type": "campaign", "created": false }],
    "counts": { "requested": 2, "updated": 2, "rejected": 0, "failed": 0 },
    "updated": [
      { "postId": "post_01j9y", "link": "https://www.tiktok.com/@dove/video/7412345678901234567", "collectionIds": ["col_9a1"] },
      { "postId": "post_01j9z", "link": "https://www.instagram.com/reel/C9AbCdEfGhI/", "collectionIds": ["col_2b7", "col_9a1"] }
    ],
    "rejected": [],
    "failed": []
  }
}
```

Each row in `updated` lists every collection the post is in afterwards. Posts that could not be changed come back in `rejected` with a [reason](#per-post-reasons).

## Content tags

Tags are plain strings, up to 60 characters. They are trimmed, a leading `#` is dropped, and matching is case-insensitive: a tag the team already has keeps its existing spelling.

### List tags

```bash
GET /analyst/v1/tags
```

```json
{ "data": [{ "name": "launch", "postCount": 42 }, { "name": "paid", "postCount": 0 }], "meta": { "count": 2 } }
```

Most-used first. Saved tags that are on no post yet, or were taken off their last post, are listed at `postCount: 0`. The list is not paged: it covers the 500 most-used tags plus every saved tag. `postCount` is `null` when counts are temporarily unavailable.

### Create tags

`POST /tags` saves up to 25 tags on the team before any post has them, the same as creating a tag in the app's tag picker.

```bash
POST /analyst/v1/tags
{ "tags": ["paid", "holiday"] }
```

```json
HTTP/1.1 201 Created

{ "data": [{ "name": "paid", "created": true }, { "name": "Holiday", "created": false }], "meta": {} }
```

It returns `201` when at least one tag is new, and `200` when every tag already existed.

### Rename a tag

`PATCH /tags/{tag}` renames a tag on every post that has it and in the team's saved tags, the same as renaming it in the app. `{tag}` is the current name in any casing, URL-encoded.

```bash
PATCH /analyst/v1/tags/launch
{ "name": "Q4 launch" }
```

```json
{ "data": { "name": "Q4 launch", "previousName": "launch", "postsAffected": 42, "failed": [] }, "meta": {} }
```

If the new name is already a tag on the team, the two merge, and posts that had both keep one. A rename that only changes casing is allowed. `failed` lists post ids that could not be updated; send the same request again to finish them.

### Tag posts

`POST /content/posts/tags` changes tags on up to 100 posts already on the team, named by `postIds`, `links`, or both. Up to 25 tags per request. Every tag it touches is kept on the team, so it shows in `GET /tags`. It answers immediately with `200`.

```bash
POST /analyst/v1/content/posts/tags
{
  "operation": "add",
  "links": ["https://www.tiktok.com/@dove/video/7412345678901234567"],
  "postIds": ["post_01j9y"],
  "tags": ["launch", "holiday"]
}
```

| `operation` | Effect                                                                                                                         |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `add`       | Merge `tags` onto each post. Existing spelling wins                                                                            |
| `set`       | Replace the post's tags with `tags`. `tags: []` clears them                                                                    |
| `replace`   | Swap one tag for another with `from` and `to`. The other tags stay. A post without `from` is `rejected` with `tag_not_present` |
| `remove`    | Drop the listed tags                                                                                                           |

```bash
POST /analyst/v1/content/posts/tags
{ "operation": "replace", "postIds": ["post_01j9y"], "from": "launch", "to": "paid" }
```

```json
{
  "data": {
    "operation": "add",
    "teamId": "team_2f8c1a",
    "counts": { "requested": 2, "updated": 1, "rejected": 1, "failed": 0 },
    "updated": [
      { "postId": "post_01j9y", "link": "https://www.tiktok.com/@dove/video/7412345678901234567", "tags": ["launch", "holiday"] }
    ],
    "rejected": [
      { "link": "https://www.tiktok.com/@missing/video/1", "postId": null, "reason": "not_on_team" }
    ],
    "failed": []
  }
}
```

To rename a tag across the whole team, use `PATCH /tags/{tag}` rather than `replace` over every post.

## Per-post reasons

`POST /content/posts/collections` and `POST /content/posts/tags` never create posts. Posts they cannot change come back in `rejected`:

| Reason                                | Meaning                                                                                         |
| ------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `not_on_team`                         | The link is not a post on the team. Use `POST /content/posts/add` if it still needs to be added |
| `not_found`                           | The post id is unknown, or belongs to another team                                              |
| `duplicate_in_batch`                  | The same post was named twice. Only the first reference is written                              |
| `unsupported_platform`, `invalid_url` | The link is not a post Siftsy can process                                                       |
| `tag_not_present`                     | `replace` only: the post does not have the `from` tag                                           |

A post that was found but could not be written lands in `failed` with `reason: update_failed`. Send the same request again to retry it.

Enterprise keys can target a sub-team with `teamId` on both routes, as on the other content routes.

## Rate limits

| Class                      | Per minute | Per day | Route                             |
| -------------------------- | ---------- | ------- | --------------------------------- |
| `content_post_collections` | 20         | 500     | `POST /content/posts/collections` |
| `content_post_tags`        | 20         | 500     | `POST /content/posts/tags`        |
| `team_tags`                | 5          | 100     | `POST /tags`, `PATCH /tags/{tag}` |

The other routes on this page count against the global budget only. See [Rate limits](/guides/core-concepts/rate-limits).