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
- Base URL:
https://post-for-you-67a7.web.app/v1 - Requests and responses are JSON (
Content-Type: application/json), except file uploads, which send the file itself. - Times are Unix seconds (UTC) in responses. In requests you may also send an ISO 8601 time with a timezone, such as
"2026-11-20T18:30:00Z". - IDs are integers. Accounts are created and set up by us from the dashboard; the API works with the accounts you already have.
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
- A key acts as you: it can see your accounts and schedule or cancel posts. Keep it on a server, never in a public web page or app.
- You can have up to 10 keys. Revoke one at any time from the same page; it stops working at once.
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." }
| Status | Meaning |
|---|---|
400 | Something in the request is wrong or missing (the message says what). |
401 | No key, a wrong key, or a revoked key. |
404 | No such account or post (or it isn’t yours). |
409 | Not allowed right now: the account isn’t live, the time clashes with another post, the post was already sent… |
413 | The file is too large. |
415 | The file type isn’t accepted for this kind of post. |
429 | Too many requests. Wait for the number of seconds in Retry-After. |
5xx | A problem on our side. Try again a little later. |
- Rate limit: about 120 requests a minute per key.
- Retrying a create is safe in practice: two posts on the same account can’t be within 60 minutes of each other, so a duplicate is refused with
409. If the gap has been lowered for you, checkGET /v1/postsbefore retrying.
The account object
| Field | Type | Meaning |
|---|---|---|
id | integer | The account’s ID. |
handle | string | Its TikTok @username, without the @ (empty while it’s being set up). |
state | string | setup, warming, live, banned, bought_out or closed. |
can_post | boolean | True when posts can be scheduled on it now (live, paid up, not being handed over). |
paused | boolean | Live but an invoice is overdue: posts wait until it is paid. |
niche | string | The niche it was warmed up for. |
keywords | string[] | Niche keywords it searches and watches during warmup. |
country | string | The country it targets (ISO code, e.g. US), picked when you ordered. |
warmup_done, warmup_days | integer | Warmup progress. |
live_at, period_end | integer | null | When it went live, and when the paid month ends. |
profile_state | string | profile_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
| Field | Type | Meaning |
|---|---|---|
id | integer | The post’s ID. |
account_id | integer | The account it goes out on. |
kind | string | video (one file) or photos (a slideshow, up to 35 photos). |
caption | string | Up to 2,200 characters, hashtags included. |
scheduled_at | integer | When it goes out (Unix seconds). |
status | string | See post statuses. |
reason | string | Why it was rejected, failed or cancelled. |
media | array | Its files: name, bytes, w, h, seconds (videos) and a private url. Files are deleted once the post is out. |
post_url, posted_at | string, integer | null | Set once posted. |
created_at | integer | When 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.
| Field | Type | |
|---|---|---|
account_id | integer | Required. A live account (can_post: true). |
kind | string | Required. video or photos. |
scheduled_at | integer | string | Required. Unix seconds or ISO 8601 with a timezone. At least 4 hours from now, within 90 days. |
caption | string | Optional. |
media_urls | array | Optional. Public https:// links, in order: one for a video, up to 35 for photos. |
submit | boolean | Optional. 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:
- The file itself as the request body, with its type, up to 32 MB:
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
- A link the server downloads, up to 300 MB for a video:
{ "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 | |
|---|---|
status | Only posts in this status. |
account_id | Only posts on this account. |
limit | 1–100, default 50. |
before | Paging 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.approved | A post passed review and is scheduled |
post.rejected | A post was rejected in review (reason says why) |
post.posted | A post went live (post_url links to it) |
post.failed | A post could not be published (reason says why) |
account.warmup_day | An account finished a day of warm-up |
account.live | An account finished warm-up and can post |
account.profile_ready | An account’s name, @username and photo are set up |
account.banned | An account was banned (replacement_id is its fresh replacement) |
account.closed | An account closed: cancelled, unpaid or replaced (reason) |
invoice.created | A new invoice |
invoice.paid | An 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…", … } }
- Answer with any
2xxwithin 10 seconds. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours, then dropped. - Check the signature:
v1is the hex HMAC-SHA256 of"<t>.<raw body>"with your endpoint’s secret (whsec_…, shown once when you add it). Refuse oldtvalues to stop replays. - The same event can arrive twice: use
idto ignore repeats.
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.
| URL | https://toktopus.com/mcp (Streamable HTTP) |
| Auth | Authorization: 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) |
| Tools | list_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.
- At least 4 hours from now (every post is reviewed and prepared on its phone first), and within 90 days.
- A post can be cancelled until 2 hours before its time (a draft any time).
- No daily limit on posts; posts on one account go out at least 60 minutes apart.
- Live accounts only. Posts wait while an invoice is overdue.
- Every post is checked against the content rules. Clear posts are approved in minutes; unclear ones wait for a person.
- At most 20 drafts at a time.
Post statuses
draft | Made, not sent yet. Add files, then submit. |
reviewing | Being checked against the content rules. |
needs_review | Waiting for a person. |
approved | Scheduled: it goes out around scheduled_at. |
posting | Going out now. |
posted | Out. post_url links to it. |
rejected | Breaks a rule; reason says which. Fix it and make a new post. |
failed | Couldn’t be posted; reason says why. |
cancelled | Cancelled 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, … } }