Developer docs API v1

Post, measure and manage social accounts from your code

The Contentee API lets you list a profile's social media accounts, read their statistics, and publish or schedule posts to each network. It's written for developers and coding agents integrating with Contentee.

Base URL
https://api.contentee.ai
Auth
x-api-key header, one key per profile
Format
JSON. Errors are { "error": "…" }
Time
ISO 8601, UTC. Stats ranges in the profile's time zone
Contents
Basics

Concepts

Profile
One brand or workspace in Contentee. Every API key belongs to exactly one profile, and every request acts on that profile.
Account
A destination on a social network: a LinkedIn person or company page, a Facebook Page, a Pinterest board, a YouTube channel, a subreddit. A profile can have several accounts on the same network.
Default account
Each network has one default account per profile. A post that doesn't name an account goes to the default.
Account id
Contentee's opaque id for an account. The same id is used in every endpoint. It's not the network's own id for the account.

People connect accounts in the Contentee web app. The API can't connect accounts.

Basics

Authentication

Every request uses one key: the profile's API key, sent in the x-api-key header. The same key works for posting, listing accounts, checking post status and reading statistics.

http
x-api-key: <profile API key>
Where to get itContentee → Profile settings → API key. Only the profile's owner can see and rotate it.
ScopeOne profile. Don't send x-profile-id: the stats endpoints ignore it, and the posting endpoints refuse a request where it names a different profile.
RotationRotating the key invalidates the old one immediately.
Errors401 means a missing or invalid key. Stop and alert a person. Don't retry.
Keep it server-sideThe key can post and read everything for the profile. Never ship it to a browser or a mobile app.

Logged in to Contentee? Every endpoint below has a Try it button. It sends the request for the profile you pick at the top of the page, using your login, so you never paste the key into this page.

Accounts

Listing accounts

There are two ways to list accounts, and both return the same account ids. Use this one to find accounts you can post to with POST /api/posts. To find X, TikTok and Reddit accounts, or to check whether a connection is broken, use GET /api/v1/stats/accounts.

GET/api/accounts5 networks

Lists the profile's accounts on facebook, instagram, linkedin, pinterest and youtube. Filter with ?platform=. An invalid platform returns 400.

request
GET /api/accounts?platform=linkedin
x-api-key: <profile API key>
200 response
{
  "accounts": [
    { "id": "cmf1a...", "platform": "linkedin", "handle": "Acme Inc", "isDefault": true },
    { "id": "cmf1b...", "platform": "linkedin", "handle": "Jane Doe", "isDefault": false }
  ]
}

Which accounts appear

An account appears only if a person added it to this profile in the web app. When someone connects a login with access to several accounts, such as a LinkedIn person and their company pages, only the accounts they tick are added. The rest are never listed and can't be posted to.

Statistics

Statistics

The statistics endpoints are read-only. Numbers are collected from the networks periodically, not live: lastCollectedAt and metricsFetchedAt say how fresh they are.

null is not zeronull means the network doesn't report that number, or nothing has been collected yet. 0 means it's known to be zero. Show null as "not available", never as 0.
  • from and to are YYYY-MM-DD, inclusive, in the profile's time zone (profile.timeZone). The maximum range is 366 days.
  • 400 means bad parameters, and the message says which. 401 means a bad key. An unknown path returns 404.
GET/api/v1/stats/accounts8 networksincludes broken

Lists every account Contentee reports stats for: LinkedIn, Pinterest, YouTube, Facebook, Instagram, Reddit, TikTok and X. Without from and to you get the account list only. With them, each account also gets totals, posts and days. Send both or neither.

request
GET /api/v1/stats/accounts?from=2026-11-01&to=2026-11-24
x-api-key: <profile API key>
200 response
{
  "profile": { "id": "cm...", "name": "Acme", "timeZone": "Europe/Stockholm" },
  "generatedAt": "2026-11-25T10:00:00.000Z",
  "accounts": [
    {
      "id": "cmf1a...",
      "network": "linkedin",
      "handle": "Acme Inc",
      "name": "Acme Inc",
      "url": "https://www.linkedin.com/company/acme",
      "status": "connected",
      "lastCollectedAt": "2026-11-25T03:00:00.000Z",
      "urn": "urn:li:organization:12345",
      "totals": {
        "followers": 1520, "followersGained": 34, "impressions": 18200,
        "reach": 9100, "engagements": 640, "videoViews": null, "linkClicks": 210
      },
      "totalsBasis": "daily",
      "posts": { "published": 12, "scheduled": 3 },
      "days": [
        { "date": "2026-11-01", "followers": 1486, "impressions": 700, "reach": 350,
          "engagements": 22, "videoViews": null, "linkClicks": 8 }
      ]
    }
  ]
}

Fields

FieldMeaning
networklinkedin, pinterest, youtube, facebook, instagram, reddit, tiktok or x.
handleThe name people recognise. For Reddit it's r/<name> or u/<name>. name is the display name and url the public profile.
urnLinkedIn only: urn:li:organization:<id> for a company page, urn:li:person:<id> for a person. What a mention links to. For a company page, name is its LinkedIn name, the exact words a mention must use.
statusconnected or broken. A broken account must be reconnected in Contentee, and posts to it fail until it is.
totals.followersFollowers on the last collected day at or before to. followersGained is last day minus first day, or null with fewer than two days.
totalsBasis"daily": totals come from the network's per-day numbers and days[] is filled in. "posts": totals are summed from posts in the range, and the activity fields in days[] are null.
postspublished in the range, and scheduled after now.
GET/api/v1/stats/posts

Returns the top posts in a date range, sorted highest first with nulls last. Ties go newest first. There's no pagination, so narrow the range or filter by account to see more.

ParamValues
from, toRequiredYYYY-MM-DD
sortOptionalimpressions (default), engagements (likes + comments + shares + saves), linkClicks, publishedAt
limitOptional1–50, default 10
accountIdOptionalAn account id. Repeat it for several accounts. Without it, all accounts are included.
request
GET /api/v1/stats/posts?from=2026-11-01&to=2026-11-24&sort=engagements&limit=50&accountId=cmf1a...
x-api-key: <profile API key>
200 response
{
  "posts": [
    {
      "id": "cmp9...",
      "accountId": "cmf1a...",
      "network": "linkedin",
      "url": "https://www.linkedin.com/feed/update/urn:li:share:7.../",
      "publishedAt": "2026-11-12T08:00:00.000Z",
      "text": "First 280 characters of the caption as plain text…",
      "thumbnailUrl": "https://…",
      "metrics": {
        "impressions": 2400, "views": null, "likes": 51, "comments": 6,
        "shares": 4, "saves": null, "linkClicks": 38
      },
      "metricsFetchedAt": "2026-11-24T03:00:00.000Z"
    }
  ]
}

What each network reports

✓ reportednull always null

Account level: totals and days

NetworktotalsBasisfollowersimpressionsreachengagementsvideoViewslinkClicks
LinkedIn company pagedaily✓✓✓✓null✓
LinkedIn personal profilepostsnullnullnullnullnullnull
Pinterestdaily✓✓null✓✓✓
YouTubeposts✓nullnull✓✓null
Facebookposts✓nullnull✓nullnull
Instagramposts✓nullnull✓nullnull
Redditpostsnullnullnull✓nullnull
TikTokpostsnullnullnullnullnullnull
Xpostsnullnullnullnullnullnull

Post level: metrics

NetworkimpressionsviewslikescommentssharessaveslinkClicks
LinkedIn company page✓null✓✓✓null✓
LinkedIn personal profilenullnullnullnullnullnullnull
Pinterest✓✓nullnullnull✓✓
YouTubenull✓✓✓nullnullnull
Facebooknullnull✓✓✓nullnull
Instagramnullnull✓✓nullnullnull
Redditnullnull✓✓nullnullnull
TikToknullnullnullnullnullnullnull
Xnullnullnullnullnullnullnull

LinkedIn personal profiles, TikTok and X are listed with their post counts, but no metrics are collected for them.

Posting

Posting

There are two posting endpoints. For a posting system that has to be reliable, use POST /api/posts wherever the network is supported. Use POST /api/distribute for X, TikTok, Reddit and Discord, or when you want Contentee to write the text.

POST /api/postsPOST /api/distribute
TextPublished exactly as sentAI writes a post per network, unless you pass platformText
NetworksFacebook, Instagram, LinkedIn, Pinterest, YouTubeThose five plus X, TikTok, Reddit, Discord
Per callOne post to one accountOne post per network or per chosen account
IdempotentYes, with Idempotency-KeyNo. Retrying creates duplicates
SchedulingNow or at scheduledAt, up to 90 days aheadNow or at scheduledAt
StatusGET /api/posts?reference=. Cancel with DELETEresults[] in the response only
POST/api/postsverbatimidempotentschedulable

Publishes one post to one account, with the text exactly as sent, now or at a time you choose. Publishing happens in the background, so the response is 202 and you poll for the result.

request
POST /api/posts
x-api-key: <profile API key>
Idempotency-Key: launch-2026-11-25-linkedin
Content-Type: application/json
body
{
  "platform": "linkedin",
  "text": "Exactly what should be posted.\n\n#launch",
  "rewrite": false,
  "accountId": "cmf1a...",
  "link": "https://acme.com/launch",
  "title": "We just launched"
}
FieldNotes
Idempotency-Key headerRequiredYour id for this post, at most 64 characters. Sending the same key again returns the same post with 200 and never creates a second one.
platformRequiredfacebook, instagram, linkedin, pinterest or youtube
textRequiredNot empty. Never trimmed, rewritten or reformatted.
rewriteRequiredMust be false.
accountIdOptionalFrom GET /api/accounts. Without it, the post goes to the network's default account.
scheduledAtOptionalWhen to publish: an ISO 8601 time with an offset, such as 2026-12-01T14:30:00+07:00 or …Z. Omit it to publish now. See Scheduling.
referenceOptionalIf sent, must equal the Idempotency-Key.
titleOptionalUsed by YouTube, Pinterest and LinkedIn link cards.
linkOptionalA public http(s) URL. How it's used depends on the network.
imageUrl / videoUrlOptionalPublic http(s) URLs. Send one or the other, not both. Contentee downloads and uploads them.
thumbnailUrlOptionalOnly together with videoUrl.
mentionsOptionalLinkedIn only. Words in text to turn into clickable tags of company pages or people. See LinkedIn mentions.
No fallback accountWhen accountId is set, the post goes to that account or fails. It never falls back to another account.

Responses

202Accepted and queued, or scheduled.
200This Idempotency-Key was already used. You get the existing post.
400Nothing was created. Causes: a validation error, the network isn't connected, accountId isn't one of this profile's accounts on that network, several accounts with no default and no accountId, the plan's post limit is reached, scheduledAt is in the past, more than 90 days ahead or has no offset, a media URL couldn't be downloaded, or a mention is invalid.
503Contentee couldn't check a mentioned page's name with LinkedIn just now. Nothing was created. Send the same request again.
401 / 403Bad key or no access. Stop.

The post object

200 / 202 response
{
  "id": "cmp9...",
  "reference": "launch-2026-11-25-linkedin",
  "platform": "linkedin",
  "status": "queued",
  "scheduledAt": null,
  "externalId": null,
  "permalink": null,
  "publishedAt": null,
  "error": null,
  "accountId": "cmf1a...",
  "accountHandle": "Acme Inc",
  "createdAt": "2026-11-25T10:00:00.000Z",
  "updatedAt": "2026-11-25T10:00:00.000Z"
}
scheduled→queued→processing→publishedorfailed
scheduled→cancelledwith DELETE, before the time comes
  • scheduled: waiting for scheduledAt. Only posts sent with scheduledAt start here. The rest start at queued.
  • queued or processing: in progress. Keep polling.
  • published: it's live, and externalId, permalink and publishedAt are set.
  • failed: it definitely wasn't posted. error gives the reason in plain language.
  • cancelled: a scheduled post that was cancelled. It will never be posted.
Contentee retries temporary failures itself, up to 5 attempts, waiting 1 min2 min4 min8 min between them. It checks before each retry, so a retry never duplicates. Expect a final status within about 20 minutes of the publish time.

Scheduling

Add scheduledAt to publish later. The post is stored straight away with "status": "scheduled". At that time it publishes exactly like a post sent now: to the same account, with the same retries, ending as published or failed.

  • Send an ISO 8601 time with an offset, such as 2026-12-01T14:30:00+07:00 or …Z. A time without an offset is refused, so Contentee never guesses the time zone.
  • The time must be in the future and at most 90 days ahead. Otherwise you get 400 and nothing is created.
  • Contentee downloads the image or video when it accepts the post, so a scheduled post doesn't depend on the link still working later. If the download fails, you get 400.
  • Idempotency is the same: sending the same key again returns the same post, whatever state it's in.
  • scheduledAt in the response is always UTC. It's null for a post sent now.
body
{
  "platform": "linkedin",
  "text": "Our December release is live.",
  "rewrite": false,
  "accountId": "cmf1a...",
  "scheduledAt": "2026-12-01T14:30:00+07:00"
}
202 response
{
  "id": "cmp9...",
  "reference": "december-release-linkedin",
  "platform": "linkedin",
  "status": "scheduled",
  "scheduledAt": "2026-12-01T07:30:00.000Z",
  "externalId": null,
  "permalink": null,
  "publishedAt": null,
  "error": null,
  "accountId": "cmf1a...",
  "accountHandle": "Acme Inc",
  "createdAt": "2026-11-25T10:00:00.000Z",
  "updatedAt": "2026-11-25T10:00:00.000Z"
}

LinkedIn mentions

On LinkedIn, a post can tag company pages and people, so that their name shows as a clickable link. The text is still published exactly as sent: mentions only says which words in it become tags.

body
{
  "platform": "linkedin",
  "accountId": "cmf1b...",
  "text": "Our first video is out at Acme Inc. Thanks Jane Doe!",
  "mentions": [
    { "text": "Acme Inc", "accountId": "cmf1a..." },
    { "text": "Jane Doe", "urn": "urn:li:person:AbC123" }
  ],
  "rewrite": false
}
FieldNotes
mentionsUp to 10 entries. Only with "platform": "linkedin".
mentions[].textThe words in text that become the tag. Each mention takes the first place its words appear that no earlier mention has taken, so to tag a name twice, list it twice.
mentions[].accountIdA LinkedIn company page connected to this profile (its id from GET /api/v1/stats/accounts). text must be the page's exact current LinkedIn name, including case. Contentee checks it with LinkedIn when it accepts the post.
mentions[].urnInstead of accountId: any urn:li:organization:<id> or urn:li:person:<id>, for pages and people not connected to Contentee. Their names can't be checked, and LinkedIn shows a company mention as plain text unless text is the page's exact name.

You get 400, and nothing is created, when mentions is sent for another network, a mention's words aren't in text, an entry has both or neither of accountId and urn, the accountId isn't a LinkedIn company page of this profile, or the words aren't the page's exact LinkedIn name (the error gives the name). The post object then has a mentions list showing what was tagged, with each URN.

Checked when acceptedA page's name is checked when the post is accepted. If the page is renamed before a scheduled post goes out, LinkedIn may show that tag as plain text.

Post types per network

What gets posted with POST /api/posts depends on which media fields you send. Character limits count characters as people see them (an emoji is 1), except YouTube's description, which counts bytes. Text that's too long is refused, never shortened.

NetworkYou sendResultLimits
LinkedIntextText post3,000 chars
+ linkLink card, titled by title or the link
+ imageUrlImage post (link ignored)
+ videoUrlVideo post (link ignored)
FacebooktextText post63,206 chars
+ linkLink preview
+ imageUrlPhoto post (link ignored)
+ videoUrlReel (link ignored)
Instagramtext + imageUrlFeed image post2,200 chars, 30 hashtags. Media required. link ignored.
text + videoUrlReel, thumbnailUrl as cover
Pinteresttext + imageUrlImage pinDescription 500, title 100, link 2,048. Media required. accountId is a board.
text + videoUrlVideo pin
YouTubetext + videoUrlVideo uploadDescription 5,000 bytes, title 100 chars, no < or >. Video required.

Without a title, YouTube uses the first non-empty line of text. A custom thumbnailUrl is best effort: channels without permission still get the video, without the thumbnail.

GET/api/posts?reference=<Idempotency-Key>

Returns the post created with that key, as { "posts": [ … ] }. An empty list means the request never arrived, so it's safe to send it again with the same key. A post that was accepted is always found here, even if its request ended in a 5xx.

Recommended client loop

  1. Generate a unique Idempotency-Key per post and store it.
  2. Send POST /api/posts. On a timeout, network error or 5xx, send the same request with the same key again. Retrying is always safe.
  3. Poll GET /api/posts?reference=<key> every 30–60 seconds until the status is published or failed. A scheduled post stays scheduled until its time, so start polling then.
  4. On a 400, don't retry unchanged. Show the error to a person, or fix the input.
DELETE/api/posts?reference=<Idempotency-Key>

Cancels a scheduled post before its time comes. Once the post has started, it can no longer be cancelled.

request
DELETE /api/posts?reference=december-release-linkedin
x-api-key: <profile API key>
200Cancelled. You get the post, now with "status": "cancelled".
409Too late: the post has already started (queued, processing, published or failed). Nothing changes.
404No post has that reference.
A cancelled key stays usedSending POST /api/posts again with the same Idempotency-Key returns the cancelled post. To post it after all, use a new key.
POST/api/distributeAI-written9 networksschedulable

Contentee writes a post per network from your article and publishes it now or at a scheduled time. The whole call uses one post from the plan's allowance, however many networks it reaches.

Not idempotentDon't retry blindly after a timeout. You may post twice.
body
{
  "title": "10 Tips for Better Social Media Marketing",
  "content": "<h1>10 Tips</h1><p>Tip 1: …</p>",
  "language": "en",
  "platforms": ["linkedin", "twitter", "facebook", "tiktok"],
  "socialAccountIds": ["cmf1a...", "cmf1b..."],
  "url": "https://yourblog.com/social-media-tips",
  "imageUrl": "https://cdn.example.com/featured.png",
  "videoUrl": "https://cdn.example.com/promo.mp4",
  "preferVideo": true,
  "platformText": { "twitter": "Exact text for X" },
  "scheduledAt": "2026-12-01T14:30:00",
  "timezone": "Europe/Stockholm"
}
FieldNotes
title, content, languageRequiredThe article. content may be HTML. language is a code such as en or sv.
platformsRequiredAny of linkedin, twitter (or x), facebook, instagram, youtube, tiktok, pinterest, reddit, discord.
socialAccountIdsOptionalOne post per listed account. Networks with none listed post to their default account.
platformTextOptionalExact text per network. Listed networks skip the AI rewrite.
urlOptionalInserted where links are clickable. Links to the profile's website get UTM tags.
imageUrl, videoUrlOptionalType is detected from the file extension. Video: .mp4 .mov .webm .mkv .avi. Image: .png .jpg .jpeg .gif .webp .bmp .svg.
preferVideoOptionalWith both media sent, video wins unless this is false.
scheduledAtOptionalFuture ISO datetime. Without an offset it's read in timezone, then the owner's time zone, then UTC. Omit to publish now.
topic, metaDescription, relatedKeywordsOptionalHelp the AI. topic (or title) is the Reddit post title.

Media per network

NetworkText onlyImageVideo
LinkedIn✓✓✓
X✓✓✓
Facebook✓✓✓
Instagram—✓✓
Pinterest—✓✓
Reddit✓✓✓
Discord✓✓✓
YouTube——Required
TikTok——Required

YouTube and TikTok are skipped, not failed, when there's no video, and no quota is used. Account ids for X, TikTok and Reddit come from GET /api/v1/stats/accounts.

200 response
{
  "groupId": "distribute_…",
  "socialPostsCount": 3,
  "scheduledCount": 0,
  "skippedCount": 1,
  "quotaExhausted": 0,
  "scheduledAt": null,
  "results": [
    { "platform": "linkedin", "socialAccountId": "cmf1a...", "ok": true, "postId": "cmp9..." },
    { "platform": "tiktok", "ok": false, "skipped": true, "error": "tiktok requires a video; skipped (no video supplied)" }
  ]
}

ok: false with skipped: true means nothing was created for that network. ok: false without skipped is a failure, explained in error.

Reference

Quick reference

PurposeRequest
List postable accountsGET /api/accounts[?platform=]
List all accounts and their statusGET /api/v1/stats/accounts
Account stats for a rangeGET /api/v1/stats/accounts?from=&to=
Top posts for a rangeGET /api/v1/stats/posts?from=&to=
Publish one post verbatimPOST /api/posts
Schedule one post verbatimPOST /api/posts with scheduledAt
Tag LinkedIn pages or peoplePOST /api/posts with mentions
Cancel a scheduled postDELETE /api/posts?reference=
Check a post's statusGET /api/posts?reference=
Publish an article to many networksPOST /api/distribute