Toktopus
API reference

Toktopus API

Schedule posts on your accounts from your own tools: a script, a spreadsheet, Zapier or your own app. Everything the dashboard does for posts, with the same review and the same rules.

Overview

Authentication

Make a key in the dashboard under API Docs › API keys. It is shown once: store it somewhere safe. Send it on every request:

Authorization: Bearer pfy_your_key_here

Quick start

Find a live account, then schedule a video in one call. The server downloads the file from your link, checks it and sends the post for review.

curl https://post-for-you-67a7.web.app/v1/accounts \
  -H "Authorization: Bearer $PFY_KEY"

curl -X POST https://post-for-you-67a7.web.app/v1/posts \
  -H "Authorization: Bearer $PFY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": 12,
    "kind": "video",
    "caption": "Leg day, no excuses #gym",
    "scheduled_at": "2026-11-20T18:30:00Z",
    "media_urls": ["https://example.com/videos/leg-day.mp4"]
  }'

The same in Python and JavaScript:

import requests

r = requests.post("https://post-for-you-67a7.web.app/v1/posts",
    headers={"Authorization": f"Bearer {PFY_KEY}"},
    json={"account_id": 12, "kind": "video", "caption": "Leg day #gym",
          "scheduled_at": "2026-11-20T18:30:00Z",
          "media_urls": ["https://example.com/videos/leg-day.mp4"]})
r.raise_for_status()
print(r.json()["id"], r.json()["status"])   # 345 reviewing
const r = await fetch("https://post-for-you-67a7.web.app/v1/posts", {
  method: "POST",
  headers: { Authorization: `Bearer ${PFY_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ account_id: 12, kind: "photos", caption: "Week 4 progress",
    scheduled_at: "2026-11-20T18:30:00Z",
    media_urls: ["https://example.com/a.jpg", "https://example.com/b.jpg"] }),
});
const post = await r.json();

Errors and limits

Errors come back with an HTTP status and a message you can show as is:

{ "error": "Another post on this account is within 60 minutes of that time." }
StatusMeaning
400Something in the request is wrong or missing (the message says what).
401No key, a wrong key, or a revoked key.
404No such account or post (or it isn’t yours).
409Not allowed right now: the account isn’t live, the time clashes with another post, the post was already sent…
413The file is too large.
415The file type isn’t accepted for this kind of post.
429Too many requests. Wait for the number of seconds in Retry-After.
5xxA problem on our side. Try again a little later.

The account object

FieldTypeMeaning
idintegerThe account’s ID.
handlestringIts TikTok @username, without the @ (empty while it’s being set up).
statestringsetup, warming, live, banned, bought_out or closed.
can_postbooleanTrue when posts can be scheduled on it now (live, paid up, not being handed over).
pausedbooleanLive but an invoice is overdue: posts wait until it is paid.
nichestringThe niche it was warmed up for.
keywordsstring[]Niche keywords it searches and watches during warmup.
countrystringThe country it targets (ISO code, e.g. US), picked when you ordered.
warmup_done, warmup_daysintegerWarmup progress.
live_at, period_endinteger | nullWhen it went live, and when the paid month ends.
profile_statestringprofile_pending, profile_submitted or profile_done.

GET /v1/accounts

All your accounts, oldest first.

{ "accounts": [ { "id": 12, "handle": "your.account1", "state": "live", "can_post": true, … } ] }

GET /v1/accounts/{id}

One account.

GET /v1/accounts/{id}/warmup

Warm-up progress: day done of days, and what each daily session on the phone did.

{ "id": 12, "state": "warming", "done": 2, "days": 4, "keywords": ["pilates at home"],
  "totals": { "videos": 262, "niche": 92, "niche_pct": 35, "likes": 12, "follows": 2, "searches": 2, "seconds": 3300 },
  "sessions": [ { "day": 1, "at": 1794720000, "videos": 131, "niche": 46, "likes": 6, "follows": 1, "comments": 4, "searches": 1, "seconds": 1678 }, … ] }

POST /v1/accounts/{id}/keywords

Replaces the niche keywords the account warms up on (up to 20, 40 characters each). The phone searches them during warm-up sessions.

{ "keywords": ["pilates at home", "wall pilates", "beginner workout"] }

The post object

FieldTypeMeaning
idintegerThe post’s ID.
account_idintegerThe account it goes out on.
kindstringvideo (one file) or photos (a slideshow, up to 35 photos).
captionstringUp to 2,200 characters, hashtags included.
scheduled_atintegerWhen it goes out (Unix seconds).
statusstringSee post statuses.
reasonstringWhy it was rejected, failed or cancelled.
mediaarrayIts files: name, bytes, w, h, seconds (videos) and a private url. Files are deleted once the post is out.
post_url, posted_atstring, integer | nullSet once posted.
created_atintegerWhen it was made.

POST /v1/posts

Makes a post. With media_urls it is done in one call: files downloaded, checked, and the post sent for review. Without them you get a draft to add files to.

FieldType
account_idintegerRequired. A live account (can_post: true).
kindstringRequired. video or photos.
scheduled_atinteger | stringRequired. Unix seconds or ISO 8601 with a timezone. At least 4 hours from now, within 90 days.
captionstringOptional.
media_urlsarrayOptional. Public https:// links, in order: one for a video, up to 35 for photos.
submitbooleanOptional. Defaults to true when media_urls is given. Set false to keep a draft.

Returns 201 and the post. If any file can’t be used, nothing is kept and the error names the link, for example "media_urls[1]: The media link answered HTTP 404."

POST /v1/posts/{id}/media

Adds one file to a draft. Photos keep the order you add them in. Two ways:

curl -X POST https://post-for-you-67a7.web.app/v1/posts/345/media \
  -H "Authorization: Bearer $PFY_KEY" \
  -H "Content-Type: video/mp4" \
  --data-binary @leg-day.mp4
{ "url": "https://example.com/videos/leg-day.mp4" }

Accepted: MP4 or MOV for videos (up to 10 minutes), JPG, PNG or WebP for photos (up to 20 MB each). Every file is opened and checked; a file that isn’t what it claims is refused. Links must be public https:// addresses. Returns the post’s files.

POST /v1/posts/{id}/submit

Sends a draft with its files for review. Returns the post, now reviewing.

GET /v1/posts

Your posts, latest scheduled time first.

Query
statusOnly posts in this status.
account_idOnly posts on this account.
limit1–100, default 50.
beforePaging cursor. For the next page, pass the next_before of the last answer as it is.
{ "posts": [ … ], "next_before": "1795199400.812" }

GET /v1/posts/{id}

One post. Poll it to follow a post through review and posting; once posted, post_url links to it.

POST /v1/posts/{id}/cancel  or  DELETE /v1/posts/{id}

Cancels a post that hasn’t gone out yet and deletes its files. A draft can be cancelled any time; a post in review or scheduled until 2 hours before its time, after that it answers 409. Returns the post, now cancelled; it stays in your list with that status.

Webhooks

Get a POST on your own server the moment something happens: a post goes live or fails, an account finishes warm-up, an invoice is paid. Add an endpoint in the dashboard (API Docs › Webhooks) or with the API. Up to 5 endpoints, https only.

post.approvedA post passed review and is scheduled
post.rejectedA post was rejected in review (reason says why)
post.postedA post went live (post_url links to it)
post.failedA post could not be published (reason says why)
account.warmup_dayAn account finished a day of warm-up
account.liveAn account finished warm-up and can post
account.profile_readyAn account’s name, @username and photo are set up
account.bannedAn account was banned (replacement_id is its fresh replacement)
account.closedAn account closed: cancelled, unpaid or replaced (reason)
invoice.createdA new invoice
invoice.paidAn invoice was paid

Each delivery is JSON. data is the same post or account object the API returns.

POST https://your.server/hooks/toktopus
Toktopus-Event: post.posted
Toktopus-Signature: t=1794726036,v1=5f2b…

{ "id": "evt_9c1e…", "type": "post.posted", "created": 1794726036,
  "data": { "id": 345, "account_id": 12, "status": "posted", "post_url": "https://www.tiktok.com/@your.account1/video/77…", … } }
import hashlib, hmac, time

def verify(secret, header, raw_body):
    parts = dict(p.split("=", 1) for p in header.split(","))
    expected = hmac.new(secret.encode(), f"{parts['t']}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, parts["v1"]) and abs(time.time() - int(parts["t"])) < 300

GET /v1/webhooks

Your endpoints, and every event name.

POST /v1/webhooks

{"url": "https://your.server/hooks/toktopus", "events": ["post.posted", "post.failed"]}. Leave out events (or send ["*"]) for all of them. The answer includes the secret, once.

POST /v1/webhooks/{id}/test

Sends a ping event to the endpoint, to check it works.

DELETE /v1/webhooks/{id}

Stops deliveries at once.

MCP server (Claude, Cursor and other AI assistants)

Toktopus is also an MCP server, so an AI assistant can list your accounts, schedule posts and check their review. It uses your API key and follows the same rules as the API.

URLhttps://toktopus.com/mcp (Streamable HTTP)
AuthAuthorization: Bearer pfy_…, or put the key in the URL for apps that only take a URL: https://toktopus.com/mcp/pfy_… (keep that URL secret)
Toolslist_accounts, get_account, get_limits, schedule_post, list_posts, get_post, cancel_post, get_warmup, set_keywords

Claude Code

claude mcp add --transport http toktopus https://toktopus.com/mcp \
  --header "Authorization: Bearer pfy_your_key"

Cursor, Claude Desktop and others (mcp.json / config file)

{ "mcpServers": { "toktopus": { "url": "https://toktopus.com/mcp",
    "headers": { "Authorization": "Bearer pfy_your_key" } } } }

Then ask, for example: “Schedule this video on @your.account1 tomorrow at 6 pm: https://…/clip.mp4, caption ‘3 moves for a flat belly #pilates’.”

Scheduling rules

The same as in the dashboard. A request that breaks one gets a 400 or 409 saying which.

Post statuses

draftMade, not sent yet. Add files, then submit.
reviewingBeing checked against the content rules.
needs_reviewWaiting for a person.
approvedScheduled: it goes out around scheduled_at.
postingGoing out now.
postedOut. post_url links to it.
rejectedBreaks a rule; reason says which. Fix it and make a new post.
failedCouldn’t be posted; reason says why.
cancelledCancelled before it went out.

GET /v1/me

Checks a key: who it belongs to, its name, and the limits that apply.

{ "user": { "id": 4, "email": "you@example.com", "name": "Amy" },
  "key": { "id": 2, "name": "Zapier" },
  "limits": { "lead_minutes": 240, "cancel_cutoff_minutes": 120, "min_gap_minutes": 60, "max_posts_per_day": null, … } }