The basics
- Base URL:
https://getcontentcannon.com/v1. The API reference lists every route, and you can try them there. - Keys:
Authorization: Bearer cc_…on every request. A key reaches one workspace, with scopesread,postoradmin. Make one in Settings in the app. - Idempotency: send
Idempotency-Key: <unique>on a POST. The same key always gets the first answer. - Errors:
{"title", "fix", "code", "status"}. Build oncode, which is stable.titleandfixare written for people.
A workspace is one customer. A profile is a brand or channel, with its own time zone, posting times and accounts. A post goes to some of a profile's accounts, with one target per account.
A first post
- Make a profile.
PUT /v1/profiles/ext:<your id>creates it if it's missing, with three posting times on weekdays and one at the weekend. - Connect accounts.
POST /v1/profiles/{id}/connect-sessionsreturns a link. The person signs in on each platform, then returns to yourreturn_url. - Add files.
POST /v1/media {"url": "…"}with a URL we can fetch, or{"upload": true}thenPUT /v1/media/{id}/filewith the bytes. Files are copied to our storage. - Make the post.
POST /v1/posts
{
"profile": "ext:brand-1",
"external_ref": "clip-3f2c",
"content": {
"type": "video", "media": ["<media id>"], "cover": "<media id>",
"text": "Caption…", "title": "Short title", "ai_generated": false,
"variants": {"x": {"text": "Shorter, for X"}}
},
"targets": [
{"account": "<TikTok account id>", "options": {"who": "PUBLIC_TO_EVERYONE"}},
{"account": "<YouTube account id>"}
],
"approved": true,
"place": {"next_free": true}
}external_ref is your own id for the post. It makes creation idempotent, and you can look the post up by it.
Placing and holding posts
placeis{"queue": "end"}or"start",{"at": "<ISO time>"},{"next_free": true}or{"now": true}. One post per posting time.POST /v1/profiles/{id}/queue/fillplaces the queue into every empty time, in order.PATCH /v1/posts/{id}replaces the content until the post goes. What goes out is the content at that moment.POST /v1/posts/{id}/holdholds a post that isn't ready."at_due": "wait"waits for its files for up to the profile'swait_minutes;"return"sends it back to the top of the queue, with your reason as its note.POST /v1/posts/{id}/readyreleases it.- On a profile with
"approval": "required", nothing goes out untilPOST /v1/posts/{id}/approve. - If a platform never answers, the target becomes
unknownand isn't resent automatically. A person checks, then callsretryormark-posted.
Content and platforms
Content is video, photos, document, text or thread. variants changes it for one platform, such as shorter words for X or a PDF for LinkedIn. PATCH /v1/targets/{id} changes the words for one account.
GET /v1/platforms lists what each platform takes, its text and title limits, and its questions with their allowed answers. Accounts keep default answers; posts can change them.
Events and webhooks
Every change to a post, target, account or file is an event. Read them with GET /v1/events?after=<id>, or register a URL with POST /v1/webhooks (the secret is shown once). Each delivery has these headers:
Cannon-Event: the event type, such astarget.posted;Cannon-Delivery: the same on every retry, for skipping repeats;Cannon-Signature: t=<unix time>,v1=<hex>, wherev1is the HMAC-SHA256 of"<t>.<body>"with your secret.
Reply with a 2xx. Anything else is retried with backoff for about a day. Checking the signature in Python:
import hashlib, hmac, time
def is_ours(secret: str, header: str, body: bytes) -> bool:
parts = dict(p.split("=", 1) for p in header.split(",") if "=" in p)
t, v1 = parts.get("t", ""), parts.get("v1", "")
if not t.isdigit() or abs(time.time() - int(t)) > 300:
return False
mac = hmac.new(secret.encode(), f"{t}.".encode() + body, hashlib.sha256)
return hmac.compare_digest(mac.hexdigest(), v1)The events most worth handling: target.posted (with the post's URL), target.failed, target.held, target.unknown, account.signed_out and post.returned.
Building your own screens
The web app is built on the API, so everything it shows is available to your own screens.
GET /v1/profiles/{id}/calendar?start=YYYY-MM-DD&days=7returns, in one call, each day's posting times with their posts, the queue, the free times, how many posts Fill would place, and every post in full.- Each post includes its state, note, whether it's ready and approved, signed file links for previews, and each target's words, limits, status and any error with its fix.
- Connect links last from a few minutes to 7 days, so clients can connect their accounts without signing up.
Posting for other people
If you post for other people, such as an agency's clients, get each person's permission first, and show them exactly what will be posted.
TikTok's posting screen
TikTok's rules apply to your screens too, and the API enforces them:
- show the creator's nickname, and let the person choose who can watch, with nothing chosen for them (
GET /v1/accounts/{id}/creator-infogives both); - leave comments, duets and stitches unticked to start;
- include TikTok's commercial content disclosure and its consent text before the post button.
A TikTok target without a choice of who can watch can't be given a time, unless it goes to the creator's drafts ("mode": "inbox").
Testing
In test mode every platform is a stand-in that signs in and posts without reaching the platform. GET /v1/test/posted lists what went out. [fail-post:<token>] or [fail-signout:<token>] in a post's words makes its first send fail that way.
The CLI and MCP
The cannon command-line tool and an MCP server (for AI assistants) use the same API and keys. Both are in early access: ask when you request access.