logo
Schedulin Developers

Tag posts

Tags organize posts (and media) inside your workspace — for campaigns, content pillars, or clients. A workspace can have up to 5 tags, and tag names must be unique.

Create a tag

name (1–50 characters) and a hex color are required.

curl -X POST https://api.schedulin.app/v0/tags \
  -H "x-api-key: $SCHEDULIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Launch", "color": "#22c55e" }'
const tag = await client.tags.create({ name: "Launch", color: "#22c55e" });
tag = client.tags.create(name="Launch", color="#22c55e")

Creating a tag with a name that already exists returns 409 Conflict. List existing tags with GET /v0/tags (client.tags.list()), which returns them under data.

Tag a post

Pass tagIds when creating a post:

curl -X POST https://api.schedulin.app/v0/posts \
  -H "x-api-key: $SCHEDULIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "socialAccountId": "acc_123",
    "caption": "Launch week, day 1 🚀",
    "tagIds": ["tag_abc"],
    "action": "draft"
  }'

Or replace all tags on an existing post with PUT /v0/posts/{id}/tags — send an empty array to clear them:

curl -X PUT https://api.schedulin.app/v0/posts/post_789/tags \
  -H "x-api-key: $SCHEDULIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "tagIds": ["tag_abc"] }'
await client.posts.updateTags({ id: "post_789", tagIds: ["tag_abc"] });
client.posts.update_tags("post_789", tag_ids=["tag_abc"])

Filter posts by tag

curl "https://api.schedulin.app/v0/posts?tagIds=tag_abc" \
  -H "x-api-key: $SCHEDULIN_API_KEY"
const { posts } = await client.posts.list({ tagIds: ["tag_abc"], tagMode: "ANY" });
posts = client.posts.list(tag_ids=["tag_abc"], tag_mode="ANY").posts

With several tags, tagMode=ANY (posts with at least one of the tags) or tagMode=ALL (posts with every tag) controls the match. In a query string, repeat the parameter for several values (?tagIds[]=tag_abc&tagIds[]=tag_def); a single ?tagIds=tag_abc works too. The same applies to other list filters such as statuses and socialAccountIds.

Posts returned by the API list their tags as plain tag objects — the same shape GET /v0/tags returns:

{
  "id": "post_789",
  "tags": [
    {
      "id": "tag_abc",
      "name": "Launch",
      "color": "#a855f7",
      "createdAt": "2030-01-10T09:00:00.000Z",
      "updatedAt": "2030-01-10T09:00:00.000Z"
    }
  ],
  "...": "..."
}