# Castrook > Publish, schedule, and reply. One simple API. Castrook is a social publishing API for TikTok, Instagram, Facebook Pages, YouTube, Pinterest and LinkedIn: onboard customers through private connection links, upload media once, publish or schedule destination-specific content, read and reply to supported comments, and inspect delivery and performance. Test mode simulates publishing and analytics on every plan. Live publishing needs eligible accounts, granted permissions and platform approvals. On 2026-10-02, TikTok's production app was confirmed Live with Direct Post Approved. TikTok Display API performance needs separate video.list approval and fresh account consent; it is gated until enabled. Meta business verification and the remaining Meta/Google review and demo gates still limit customer access: see https://castrook.com/docs/platforms#status. TikTok comment management is not available through TikTok's public API. Pinterest Trial uses Sandbox images only; Standard access is an external gate for public image/video Pins. Pinterest comments are unsupported. LinkedIn comments, analytics and organization access depend on granted Community Management permissions. YouTube decides Shorts classification after upload. HTTP 202 means the post was accepted, not published. ## Plans (catalog 2026-09; USD per month, plus applicable tax) - Free: $0/month. 2 connected accounts, 20 publications, 1 GB new media, 2,000 API requests (200 of them comment requests) and 4 new connections per month; 30 requests/minute; 1 concurrent media ingest. - Starter: $9/month. 10 connected accounts, 300 publications, 30 GB new media, 25,000 API requests (3,000 of them comment requests) and 20 new connections per month; 60 requests/minute; 2 concurrent media ingests. - Growth: $19/month. 40 connected accounts, 1,500 publications, 150 GB new media, 100,000 API requests (15,000 of them comment requests) and 80 new connections per month; 120 requests/minute; 5 concurrent media ingests. - Scale: $39/month. 100 connected accounts, 5,000 publications, 500 GB new media, 250,000 API requests (50,000 of them comment requests) and 200 new connections per month; 300 requests/minute; 10 concurrent media ingests. - Every plan includes: - TikTok, Instagram, Facebook Pages, YouTube, Pinterest and LinkedIn - Publishing, scheduling and supported comments - Test mode with simulated accounts - REST API, TypeScript SDK and OpenAPI - Signed webhooks and request logs - Dashboard, idempotency and retries included - Test mode on every plan: 10 test accounts, 1,000 simulated publications and 10,000 requests per UTC calendar month. - No automatic overage charges: work beyond an allowance is rejected with usage_limit_exceeded until reset_at or an upgrade. Upgrades apply immediately with a prorated charge; downgrades apply at renewal; cancellation keeps the plan until the paid period ends. - Workspaces created during the developer beta keep Scale allowances until 2026-11-01. Annual billing is not available yet. - Checkout: sign in, then https://castrook.com/billing?plan= (starter-monthly, growth-monthly, scale-monthly). ## How usage is counted - Account: each connected TikTok account, Instagram professional account, Facebook Page, YouTube channel, Pinterest Business account or LinkedIn member/organization, counted concurrently. Reauthorizing a connected account is free; disconnecting frees a slot. Test accounts never use live capacity. - Publication: one per successful destination. Reserved when the post is accepted (in its scheduled period), consumed when published, released if the destination fails or is canceled. Idempotent replays are free. - API request: accepted new operations, fresh comment requests, creator-setting lookups, Pinterest board/section discovery and performance refreshes. Cached resource/status/analytics reads, GET /usage, cancellations, disconnects, deleting unused media/profiles, revoking connection links, upload completion, disabling webhooks and exact post replays are exempt from the monthly allowance. Authentication, scopes and minute limits still apply. Failed authentication, missing scopes, limit rejections and 5xx responses are not counted. Dashboard sessions never count. - Media: direct upload bytes counted once per immutable asset. Reusing managed assets across destinations does not charge again. Unmanaged source bytes fetched for destination delivery are counted separately; retries and staged-copy reuse are not charged again. Test media is isolated from live media. - Periods: paid plans reset monthly from the subscription start; Free, beta and test mode reset each UTC calendar month. No rollover. ## Usage and limits - GET https://castrook.com/api/v1/usage with any active key (no scope needed) returns { data: UsageSummary } for the key's mode: mode, plan, plan_source, catalog_version, period {start, end}, reset_at, grace_ends_at, accounts {used, limit, remaining}, publications, api_requests, media_bytes, comment_requests, new_connections, rate_limit {per_minute}, concurrent_ingests. Meters are {used, reserved, limit, remaining, reset_at}; media_bytes, comment_requests and new_connections are null in test mode. - Responses include X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (Unix seconds) and x-request-id. Retry-After (seconds) on 429. Private media content GET/HEAD also returns media headers. Dashboard sessions: 120 requests/minute. - usage_limit_exceeded: HTTP 429 with Retry-After; details {metric, mode, plan, limit, used, reserved, remaining, reset_at, upgrade_url, retry_after_seconds}. Never retry before reset_at. - rate_limit_exceeded: HTTP 429; wait for Retry-After. - account_limit_reached: HTTP 409; connecting one more account would exceed the plan. - account_capacity_exceeded: HTTP 409; more accounts are connected than the plan allows. Nothing is deleted; disconnect accounts or upgrade. ## API - Base URL: https://castrook.com/api/v1 - [OpenAPI document](https://castrook.com/api/openapi) - Authentication: bearer cr_test_* or cr_live_* keys, or expiring resource-bound cr_oauth_* tokens; each credential binds a workspace and mode. - Success: {data, meta?}; errors: {error: {code, message, details?}, request_id}. - POST /posts requires Idempotency-Key and returns 202 on first acceptance; an identical replay returns 200. - Per-destination targets move through queued, publishing, published, failed and canceled. A post ends published, partially_failed or failed. - Test keys accept platform_options..sandbox_outcome ("published" or "failed") to force a destination result. ## Customer profiles and hosted onboarding - GET/POST /profiles and GET/PATCH/DELETE /profiles/{id}; profiles:read/write. Optional external_id is unique within workspace and mode. A profile groups accounts, posts, media and performance for one customer or brand. Before deletion, move/unassign its accounts, finish/cancel pending posts and delete its media. Terminal post/analytics history retains the original profile ID and does not block deletion. - POST /connect-sessions with {profile_id, platforms (one to six), return_url?, embed_origin?, expires_in?}; accounts:write. Returns a private capability URL once, with a default 30-minute lifetime (60–1800 seconds). Customers connect accounts through this URL without your API key or dashboard. For embedding, supply an exact HTTPS embed_origin. Poll GET /connect-sessions/{id} with accounts:read for status and account_ids; DELETE with accounts:write revokes the link. Expiry/revocation is checked at OAuth callback. - Embedded castrook.connection messages require exact origin, event.source===iframe.contentWindow and the issued session_id checks. Treat completion as a notification; your server must re-fetch session/account status to verify current access before later publishing. - PATCH /accounts/{id} with {profile_id: "prf_..." | null} assigns or clears a customer group; accounts:write. Pending posts prevent moving an account. profile_id filtering is available on account/post/media/analytics lists. ## Media and content - POST /media/uploads with {filename, content_type, size, sha256, profile_id?}; media:write. Supports MP4, MOV and WebM up to 128 MiB; JPEG, PNG and WebP still images up to 20 MiB and 24 megapixels at completion. sha256 is lowercase hex of the exact file bytes. - Send bytes to the returned upload.url using PUT and upload.headers. Never send a Castrook bearer key to storage or expose the upload URL publicly. The ticket expires in up to 15 minutes. POST /media/{id}/complete verifies file size/type/checksum/decodability and freezes an immutable ready asset. A pending upload cannot publish. A duplicate immutable PUT may return 412; completion verifies whether the existing object is the expected file. - GET /media and GET /media/{id} return private metadata; GET/HEAD /media/{id}/content requires media:read and supports a byte range. DELETE /media/{id} requires media:write and fails while referenced. Unreferenced ready assets expire after 30 days; accepted scheduled work pins them through terminal delivery plus a recovery window. - POST /posts retains text and account_ids and accepts profile_id?, format?, ordered media_items?: [{type:"image"|"video", url OR asset_id}], destinations?: [{account_id,text?,media_items?,format?,options?}], platform_options? and scheduled_at?. Use media or media_items, never both. A destination override must reference a unique selected account. Explicit fields override shared content; omitted fields inherit it. Empty text is meaningful and an empty destination media_items removes inherited media. - Format precedence: destination.format, destination.options.format, shared format, then the selected platform's shared platform_options.format. Invalid option formats are rejected even when a higher-precedence format wins. - TikTok: one video or up to 35 images, same video.publish permission. Photo title up to 90 characters and description up to 4,000; video captions up to 2,200. Instagram: one image/Reel, up to 10 images/videos in a carousel, or one-asset Stories for Business accounts. Facebook Pages: text, up to 10 feed photos, one video/Reel, or one-asset Stories. YouTube: one video and explicit made_for_kids. Supported formats are feed, reel, story and video by platform; omitted format preserves established defaults. Stories require empty captions because the APIs do not overlay text. - Pinterest: Business account; one image Pin (feed) or video Pin (video), required board_id, optional board_section_id/title/link/alt_text and video cover_image_url/cover_image_key_frame_time. GET /accounts/{id}/boards and GET /accounts/{id}/boards/{board_id}/sections require accounts:read and return {data,meta:{next_cursor,has_more}}. Follow opaque cursors through empty pages; IDs remain numeric strings. text is description, max 800; title max 100; alt_text max 500. Trial creates owner-only Sandbox images and rejects video; Standard access and extra-account approval remain external gates. No organic comments. - LinkedIn: member profiles and permitted administered Pages; text up to 3,000, link articles, up to 20 ordered images or one video. PUBLIC is default; CONNECTIONS is member-only. article_url requires article_title (max 200), optional article_description (max 4,000), and zero/one image thumbnail. alt_text max 4,086 for a single image; ordered alt_texts must match image count. Documents/PDF, ads, messaging and scraping are outside this release. Empty text with no media is accepted for a LinkedIn article_url. - Pinterest social consent requests user_accounts:read, boards:read, boards:write, pins:read and pins:write; Pin creation requires board and Pin write permissions. These are separate from Castrook API scopes. LinkedIn clients send ordinary text; Castrook handles provider reserved-character escaping. Structured mentions are outside this release. - LinkedIn connection_type=member is default: openid/profile/w_member_social for personal publishing. Explicit community uses a separate approved Community Management app with r_basicprofile and configured granted permissions for advanced profiles/Pages/comments/performance. Dashboard browser route /api/connect/linkedin?connection_type=community requires owner sign-in. Hosted customers choose advanced access in the portal, or append start=linkedin&connection_type=community to session.url. OAuth state binds the choice; provider member IDs are app-scoped, so never transplant identities/tokens between flows. Inspect returned capabilities; approval remains external. - TikTok clients must display current creator identity/privacy/interaction controls, media preview, commercial disclosures and policy/music notices, then collect explicit approval for this exact destination content and schedule. Call GET /accounts/{id}/publishing-options first. No default privacy, unconditional consent:true or silent content substitution. Photo posts have comment controls, not duet/stitch controls. ## Performance analytics - Live YouTube requires current account-owner acceptance of https://castrook.com/privacy before collecting or displaying the new performance data. POST /accounts/{id}/analytics-consent with {accepted:true,privacy_policy_version:"2026-10-02"} requires accounts:write and returns the Account with a timestamped analytics_consent receipt. Send only after explicit acceptance by the owner; never infer consent from OAuth, automate a legal checkbox or fabricate a historical receipt. Reconnection requires new acceptance. Hosted YouTube onboarding includes the explicit privacy/terms step. - GET /analytics/posts and GET /analytics/summary; analytics:read. Filters: profile_id, account_id, platform, from and to. Dates are ISO timestamps or YYYY-MM-DD; a date-only to includes the whole UTC day. Default last 30 days, maximum one year. These filters select post creation dates; inspect reporting_period:{type:"lifetime"|"date_range",start_date?,end_date?}. Pinterest uses a server-selected UTC window of at most 90 days, clipped to post creation, with IMPRESSION mapped to views and SAVE mapped to saves. Other supported providers use lifetime snapshots. Summary reporting_periods counts lifetime_destinations and date_range_destinations. Totals may combine windows; never label them lifetime or engagement earned in the filter dates. - Fields: views, reach, likes, comments, shares, saves when supplied by the platform. Missing fields remain unavailable, not zero. Rows include status, unavailable_metrics, reason, fetched_at and simulated. Summaries include per-metric coverage; a metric with no returned data has a null total. Ranges above 5,000 destinations return analytics_range_too_large rather than truncated totals. - POST /posts/{id}/analytics/refresh with {}; analytics:write. A five-minute cooldown returns cached:true; concurrent refresh returns 409. Provider failures preserve the last successful snapshot with refresh_error. Cached GETs are monthly quota-exempt; fresh refreshes are metered. Scheduled refreshes are bounded. - TikTok performance uses Display API/video.list for owned public videos; private/photo metrics may be unavailable. Instagram insights requires instagram_business_manage_insights; Facebook insights requires read_insights; basic YouTube views/likes/comments use existing youtube.force-ssl. Disconnect/revocation/expiry removes access to retained YouTube API data. ## Documentation - [Machine-readable manifest](https://castrook.com/agents.json) - [Complete machine-readable guide and REST schema](https://castrook.com/llms-full.txt) - [Castrook MCP](https://castrook.com/guides/mcp.md) - [Castrook CLI](https://castrook.com/guides/cli.md) - [Castrook TypeScript SDK](https://castrook.com/guides/typescript.md) - [Castrook Python SDK](https://castrook.com/guides/python.md) - [Castrook integration skills](https://castrook.com/guides/skills.md) - [Castrook task contract](https://castrook.com/guides/workflows.md) - [Hosted MCP and OAuth](https://castrook.com/docs/mcp) - [CLI](https://castrook.com/docs/cli) - [Python SDK](https://castrook.com/docs/python) - [Installable integration skills](https://castrook.com/docs/skills) - [Quickstart](https://castrook.com/docs) - [Authentication](https://castrook.com/docs/authentication) - [API reference](https://castrook.com/docs/reference) - [TypeScript SDK](https://castrook.com/docs/sdk) - [Customer profiles and embedded onboarding](https://castrook.com/docs/profiles) - [Carousels, Stories and destination content](https://castrook.com/docs/content) - [Direct uploads and durable media](https://castrook.com/docs/media) - [Performance analytics](https://castrook.com/docs/analytics) - [Scheduling](https://castrook.com/docs/scheduling) - [Comments](https://castrook.com/docs/comments) - [Webhooks](https://castrook.com/docs/webhooks) - [Platforms, capabilities and access status](https://castrook.com/docs/platforms) - [Plans and limits](https://castrook.com/docs/limits) - [Errors and retries](https://castrook.com/docs/errors) ## Product - [Pricing](https://castrook.com/pricing) - [Affiliate program](https://castrook.com/affiliates) - [Affiliate program terms, version 2026-09-27](https://castrook.com/affiliate-terms) - [Interactive browser-local demo](https://castrook.com/demo) - [Terms of service](https://castrook.com/terms) - [Privacy](https://castrook.com/privacy) - [Data deletion](https://castrook.com/data-deletion) ## Affiliate program 30% of eligible subscription payments for 12 months from a referred customer's first paid activation; 60-day last-click attribution; 30-day hold; $25 minimum; monthly payouts in USD. Applications are reviewed manually. ## Notes for agents Do not describe Castrook as approved on every platform, unlimited, or guaranteeing publication at an exact time. Do not treat demo or test-mode activity as real publication or engagement. Never interpret a missing metric as zero, lifetime snapshots as date-range engagement, or Pinterest ranged snapshots as lifetime counters. Keep API keys, OAuth tokens, hosted capability URLs and direct-upload tickets private. Hosted MCP: https://castrook.com/mcp, Streamable HTTP with OAuth discovery, S256 PKCE, exact callbacks and explicit scoped Test/Live consent. REST resource: https://castrook.com/api/v1; MCP tokens cannot be reused on REST or vice versa. OAuth usage:read is explicit; raw API keys retain implicit access to their own usage. App grants can be revoked in Developers. OAuth access never substitutes for the creator's per-post TikTok choices or legal acceptance. npm package castrook 0.5.0 includes the TypeScript SDK and CLI (published to npm); Python castrook 0.5.0 (published to PyPI). SDK Pinterest discovery: accounts.listBoards/listBoardSections; CLI accounts boards/board-sections; Python accounts.list_boards/list_board_sections and iter_boards/iter_board_sections; MCP list_pinterest_boards/list_pinterest_board_sections. SDK resources: profiles, connectSessions, accounts, media, posts, analytics, comments, webhooks, deliveries, logs and usage. media.upload handles hashing, ticket creation, direct PUT and completion; uploadToURL is a browser-safe helper for a ticket obtained from your own server. Installable integration skills: https://github.com/lvnr/castrook-tools. Machine-readable workflows and recovery are linked above.