在Twitter/X、Facebook、Instagram、LinkedIn、TikTok和YouTube上发布、预约和管理社交媒体帖子。内容日历具备缺口分析、A/B测试和效果分析。
Social media publishing API. Publish to Twitter/X, Facebook, Instagram, LinkedIn, TikTok, and YouTube from one API with scheduling, analytics, A/B testing, and AI-powered features.
Base URL: https://socialcannon.app
Several operations act on live social accounts and cannot be undone. In an agent workflow, get explicit human approval before any of these:
scheduledAt) — goes live at once.post mode — adapts and publishes to the target platforms.Safer defaults for agents: prefer read-only listing and draft/ scheduled posts, and use preview-mode repurpose before post mode. Keep your Client Secret in an environment variable — never paste it into a chat.
Before making API calls, you need credentials and at least one connected social account.
Sign up at socialcannon.app (Google or GitHub sign-in, free tier included — no card required). Your Client Secret is shown once, right after signup — copy it then. If you miss it, open Settings → API Keys and click Generate API Secret. Your Client ID is always available on that page. Use these as SOCIALCANNON_CLIENT_ID and SOCIALCANNON_CLIENT_SECRET.
Social accounts are connected via OAuth in the browser. Open the connect URL for each platform you want to use — you'll authorize SocialCannon and get redirected back:
PlatformConnect URLTwitter/Xhttps://socialcannon.app/api/connect/twitter?client_id=YOUR_CLIENT_IDFacebookhttps://socialcannon.app/api/connect/facebook?client_id=YOUR_CLIENT_IDInstagramhttps://socialcannon.app/api/connect/instagram?client_id=YOUR_CLIENT_IDLinkedInhttps://socialcannon.app/api/connect/linkedin?client_id=YOUR_CLIENT_IDTikTokhttps://socialcannon.app/api/connect/tiktok?client_id=YOUR_CLIENT_IDYouTubehttps://socialcannon.app/api/connect/youtube?client_id=YOUR_CLIENT_ID
You can also connect accounts from the dashboard at Settings → Accounts. Instagram uses Facebook's OAuth flow — make sure you select the Facebook Page linked to your Instagram Business account.
Once you have credentials and at least one connected account, authenticate and create your first post:
bash
# Get a token
TOKEN=$(curl -s -X POST https://socialcannon.app/api/v1/auth/token \
-H "Content-Type: application/json" \
-d "{\"grant_type\": \"client_credentials\", \"client_id\": \"$SOCIALCANNON_CLIENT_ID\", \"client_secret\": \"$SOCIALCANNON_CLIENT_SECRET\"}" \
| jq -r '.data.access_token')
# List your connected accounts
curl -s https://socialcannon.app/api/v1/accounts \
-H "Authorization: Bearer $TOKEN" | jq '.data'
# Publish a post (replace <account_id> with an ID from the list above)
curl -X POST https://socialcannon.app/api/v1/posts \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"accountId": "<account_id>", "content": "Hello from SocialCannon!"}'
Instead of raw HTTP, you can expose SocialCannon's 23 tools to any MCP-compatible agent with the @socialcannon/mcp package. Use the same SOCIALCANNON_CLIENT_ID / SOCIALCANNON_CLIENT_SECRET from your dashboard.
Run the exact version shown below ( @socialcannon/mcp@1.0.2). The package runs with your credentials, so pinning means a later npm release is never picked up until you have reviewed it and changed the version yourself.
Keep the Client Secret out of config files. Store it in your OS keychain or secret manager and expose it as the SOCIALCANNON_CLIENT_SECRET environment variable of the process that starts your agent.
Hermes Agent — add to ~/.hermes/config.yaml. Hermes replaces ${VAR} references with values from its environment, so the file holds no secret:
yaml
mcp_servers:
socialcannon:
command: "npx"
args: ["-y", "@socialcannon/mcp@1.0.2"]
env:
SOCIALCANNON_CLIENT_ID: "${SOCIALCANNON_CLIENT_ID}"
SOCIALCANNON_CLIENT_SECRET: "${SOCIALCANNON_CLIENT_SECRET}"
Claude Desktop — add an entry under mcpServers in claude_desktop_config.json with the same pinned command/ args. If your MCP client can only take the secret as a literal value in its config file, make that file readable only by you ( chmod 600), never commit or sync it, and click Generate API Secret under Settings → API Keys to replace the secret if the file is ever exposed.
The REST API documented below remains fully available; MCP is an optional convenience layer over the same endpoints.
All requests require a JWT Bearer token. Get one by exchanging your client credentials:
bash
curl -X POST https://socialcannon.app/api/v1/auth/token \
-H "Content-Type: application/json" \
-d "{
\"grant_type\": \"client_credentials\",
\"client_id\": \"$SOCIALCANNON_CLIENT_ID\",
\"client_secret\": \"$SOCIALCANNON_CLIENT_SECRET\"
}"
Response:
json
{
"success": true,
"data": {
"access_token": "<jwt-token>",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "posts:read posts:write ..."
}
}
Use response.data.access_token as a Bearer token in all subsequent requests. Tokens expire after 1 hour — request a new one when you get a 401.
All requests below require this header:
text
Authorization: Bearer <access_token>
Content-Type: application/json
IMPORTANT: ALL responses are wrapped in a standard envelope. This includes the token endpoint.
{ "success": true, "data": { ... } }{ "success": false, "error": "message", "code": "ERROR_CODE" }When extracting data from any response, always read from response.data, not from the response root. For example, the access token is at response.data.access_token — not response.access_token.
Accounts represent social media profiles connected via OAuth (see Getting Started above). You need at least one connected account before you can create posts.
bash
curl https://socialcannon.app/api/v1/accounts \
-H "Authorization: Bearer $TOKEN"
Returns all connected social accounts with their platform, username, and status. Use the account id field when creating posts. Filter by platform with ?platform=twitter.
bash
curl https://socialcannon.app/api/v1/accounts/<account_id> \
-H "Authorization: Bearer $TOKEN"
bash
curl -X DELETE https://socialcannon.app/api/v1/accounts/<account_id> \
-H "Authorization: Bearer $TOKEN"
Publish immediately (omit scheduledAt) or schedule for later:
bash
curl -X POST https://socialcannon.app/api/v1/posts \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"accountId": "<account_id>",
"content": "Your post text here",
"mediaUrls": ["https://example.com/image.jpg"],
"scheduledAt": "2026-04-15T10:00:00Z",
"platformOptions": {
"autoUtm": true
}
}'
Fields:
accountId (required) — ID from the accounts list
content (required) — post text
mediaUrls (optional) — array of public image/video URLs
scheduledAt (optional) — ISO 8601 datetime, "optimal" (auto-pick best time based on engagement data, Pro), or omit for immediate publish
platformOptions.autoUtm (optional) — auto-tag URLs with UTM parameters
platformOptions.aiGenerated (optional) — set true when requesting the platform's native AI-content label. TikTok and YouTube support it directly. Instagram fails closed unless the SocialCannon deployment has explicitly enabled verified native-disclosure access; do not omit the flag and publish unlabeled content as a workaround. See AI-content disclosure.
platformOptions.mediaType (optional) — controls content type:
"reel" — Facebook/Instagram Reel (vertical 9:16 video)"story" — Facebook/Instagram/TikTok Story (24h ephemeral)"short" — YouTube Short (vertical video ≤60s)"community" — YouTube Community post (text/image)platformOptions TikTok fields — TikTok posts require privacyLevel and support disableComment / disableDuet / disableStitch, commercialContent, brandOrganic, brandedContent. See the TikTok section under Platform-Specific Notes.
bash
curl "https://socialcannon.app/api/v1/posts?status=published&platform=twitter&limit=20" \
-H "Authorization: Bearer $TOKEN"
Query params: status (draft/scheduled/published/failed), platform, accountId, limit, cursor
bash
curl https://socialcannon.app/api/v1/posts/<post_id> \
-H "Authorization: Bearer $TOKEN"
bash
curl -X PATCH https://socialcannon.app/api/v1/posts/<post_id> \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "Updated text",
"scheduledAt": "2026-04-16T14:00:00Z",
"platformOptions": { "autoUtm": true }
}'
Fields: content, scheduledAt, platformOptions — all optional.
bash
curl -X DELETE https://socialcannon.app/api/v1/posts/<post_id> \
-H "Authorization: Bearer $TOKEN"
If the post is published, this also attempts to delete it from the social platform.
bash
curl -X POST https://socialcannon.app/api/v1/posts/<post_id>/retry \
-H "Authorization: Bearer $TOKEN"
Resets the failed post and attempts to publish immediately. No body needed. If it fails again, the post returns to failed status with the new error.
Create multi-part threads (Twitter reply chains or Instagram carousels):
bash
curl -X POST https://socialcannon.app/api/v1/posts/thread \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"accountId": "<account_id>",
"items": [
{ "content": "Thread part 1 — the hook" },
{ "content": "Thread part 2 — the detail" },
{ "content": "Thread part 3 — the CTA", "mediaUrls": ["https://..."] }
],
"scheduledAt": "2026-04-15T10:00:00Z",
"platformOptions": { "autoUtm": true }
}'
Fields: accountId (required), items (required, min 2, max 25), scheduledAt (optional), platformOptions (optional — e.g. aiGenerated: true to request the AI-content label). Instagram requires media on each item and rejects aiGenerated: true before publishing unless verified native-disclosure access is enabled for the deployment.
When a post's media is AI-generated, set platformOptions.aiGenerated: true to request the native label. SocialCannon maps it as follows:
PlatformAPI fieldUser-facing labelInstagramDefault unavailable; is_ai_generated only after deployment capability enablement"AI info" label (on carousels, parent only)TikTokis_aigc"AI-generated" labelYouTubecontainsSyntheticMedia"Altered content" disclosure
Instagram is intentionally fail-closed by default: aiGenerated: true is rejected before any Meta request unless the deployment has explicitly enabled its separately verified native-disclosure capability. Never silently remove the flag to force publication; report the block instead. Facebook, X, and LinkedIn have no API disclosure field — the flag is accepted but ignored there. The request is also supported on threads ( platformOptions), per-post in auto-schedule ( posts[].platformOptions), and as a test-level aiGenerated flag on A/B tests (applies to every variant, with the same Instagram gate).
Upload images/videos before creating posts. Three-step direct-to-GCS flow — bytes go straight to Google Cloud Storage via a signed URL, never through SocialCannon's server, so our API never buffers the file. Each destination still has a per-file limit: the smaller of what the network accepts and what our publishing pipeline can fetch. Pass the destination accountId on step 1 so an unpublishable file is rejected before any signed URL is issued; without accountId the pipeline-wide ceiling of 140 MiB applies.
PlatformPost typeFile kindMax per fileX (Twitter)Feed, ThreadsImages5 MBX (Twitter)Feed, ThreadsGIFs5 MBX (Twitter)Feed, ThreadsVideo (MP4, MOV)140 MiBInstagramFeed, Stories, CarouselsImages (JPEG only)8 MBInstagramFeed, Reels, CarouselsVideo (MP4, MOV)100 MiBInstagramStoriesVideo (MP4, MOV)100 MBFacebookFeed, StoriesImages (JPEG, PNG, WebP, GIF)10 MBFacebookFeed, Reels, StoriesVideo100 MiBLinkedInFeed, ThreadsImages (JPEG, PNG, GIF)20 MiBTikTokFeed, CarouselsPhoto images20 MBTikTokFeedVideo100 MiBYouTubeFeed, ShortsVideo100 MiB
TikTok Story, YouTube Community posts, LinkedIn video, and all Reddit media cannot be uploaded through this flow. LinkedIn video and YouTube Community media cannot be published through SocialCannon at all. A Reddit link post can point at a file you host yourself: pass its URL in mediaUrls. Over-limit or unsupported requests fail with 400 and code "MEDIA_LIMIT_EXCEEDED" or "UNSUPPORTED_MEDIA", and cost no upload quota.
X's video upload takes MP4 and MOV only: a WebM destined for an X account is refused at upload-init. WebM stays accepted for Facebook, TikTok and YouTube.
X documents a 15 MB GIF allowance for its tweet_gif media category, which this pipeline does not use: every GIF goes up as tweet_image, so 5 MB is the real cap for a GIF here.
Accepted types: image/jpeg, image/png, image/gif, image/webp, video/mp4, video/quicktime, video/webm.
bash
curl -X POST https://socialcannon.app/api/v1/media/upload-init \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"filename": "photo.jpg",
"contentType": "image/jpeg",
"size": 1048576,
"accountId": "<connected account id>",
"postType": "feed"
}'
Send accountId — the account that will publish the media — plus optionally postType, one of feed, reel, story, short, carousel, thread (default feed), so the size and format are validated against that destination's real limit.
Response:
json
{
"success": true,
"data": {
"uploadUrl": "https://storage.googleapis.com/...?X-Goog-Signature=...",
"publicUrl": "https://storage.googleapis.com/<bucket>/media/<clientId>/<uuid>.jpg",
"requiredHeaders": {
"Content-Type": "image/jpeg",
"x-goog-acl": "public-read",
"x-goog-content-length-range": "0,5000000"
},
"limit": { "maxBytes": 5000000, "maxBytesDisplay": "5 MB", "platform": "twitter", "postType": "feed" }
}
}
uploadUrl is a V4 signed PUT URL valid for 15 minutes. size must be the exact byte size of the file you're about to upload. limit.maxBytes echoes the cap that was applied, and limit.platform is null when no accountId was given.
bash
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: image/jpeg" \
-H "x-goog-acl: public-read" \
-H "x-goog-content-length-range: 0,5000000" \
--data-binary @photo.jpg
You must send the exact headers returned in requiredHeaders, including the x-goog-content-length-range value from step 1 — it pins the size cap into the signature, so GCS itself refuses a file that is too large. Do not send the Authorization header — the signed URL carries its own auth. A successful PUT returns HTTP 200 with an empty body.
bash
curl -X POST https://socialcannon.app/api/v1/media/upload-complete \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "publicUrl": "https://storage.googleapis.com/<bucket>/media/<clientId>/<uuid>.jpg" }'
Pass the publicUrl you got from step 1 verbatim. The server verifies the object exists, stamps customTime (starting the 30-day retention window), and increments your upload quota.
Response: { "success": true, "data": { "url": "https://...", "filename": "media/<clientId>/<uuid>.jpg", "contentType": "image/jpeg", "size": 1048576 } }
Use the returned url in the mediaUrls field when creating posts. SocialCannon does not convert or resize uploads: the finalize response reports the file exactly as uploaded, and that same file is what the network receives. Upload a format and size the destination accepts — for example a JPEG for Instagram.
403 on step 1 with code set → your tier has hit its upload quota. Inspect limit in the response body.400 on step 1 with code: "MEDIA_LIMIT_EXCEEDED" → the file is larger than the destination's per-file limit; the message names the actual size, the limit and the platform. Nothing was uploaded and no quota was spent.400 on step 1 with code: "UNSUPPORTED_MEDIA" → that platform / post type / file format cannot be published through SocialCannon (for example LinkedIn video, a TikTok Story, or a PNG on Instagram). Convert the file to a format the destination accepts (Instagram images must be JPEG) or pick a supported destination.404 on step 1 → accountId is not one of your connected accounts. 409 → that account is disconnected; reconnect it before uploading.404 on step 3 → the PUT didn't actually land. Retry from step 2.403 on step 3 → publicUrl doesn't belong to your client. Use the exact URL returned by step 1, do not construct it yourself.See posts grouped by date with gap analysis:
bash
curl "https://socialcannon.app/api/v1/calendar?startDate=2026-04-01&endDate=2026-04-30" \
-H "Authorization: Bearer $TOKEN"
Returns posts and summary (totals by status/platform/day, plus summary.gaps = dates with no posts). Note the gap analysis is nested at response.data.summary.gaps.
Query params: startDate (required), endDate (required), accountId, platform
bash
curl "https://socialcannon.app/api/v1/calendar/slots?startDate=2026-04-01&endDate=2026-04-07&slotDurationMinutes=60" \
-H "Authorization: Bearer $TOKEN"
Query params: startDate (required), endDate (required, max 14-day range), slotDurationMinutes (optional, 30-1440, default 60).
Returns { slots[], totalSlots, availableSlots, occupiedSlots }.
Fetch live engagement metrics from the platform:
bash
curl https://socialcannon.app/api/v1/posts/<post_id>/analytics \
-H "Authorization: Bearer $TOKEN"
Returns: likes, comments, shares, impressions, reach, clicks, engagementRate, plus historical snapshots.
Availability: live per-post analytics is not available for Facebook or LinkedIn yet — both need a platform approval (Meta App Review / LinkedIn Community Management) we don't hold, so the endpoint returns
400withcode: "PLATFORM_UNSUPPORTED". Twitter, Instagram, TikTok, and YouTube work. CheckGET /api/v1/platforms→capabilities.supportsAnalyticsfor the authoritative per-platform list.
bash
curl "https://socialcannon.app/api/v1/analytics/summary?startDate=2026-04-01&endDate=2026-04-30" \
-H "Authorization: Bearer $TOKEN"
Returns totals across all posts for the date range.
bash
curl -X POST https://socialcannon.app/api/v1/analytics/refresh \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "platform": "twitter", "limit": 20 }'
Fields: postIds (optional, array of up to 50 post IDs to refresh), platform (optional, filter), limit (optional, default 20, max 50). If postIds is provided, those specific posts are refreshed; otherwise recent published posts are refreshed.
bash
curl "https://socialcannon.app/api/v1/engagements?isRead=false&limit=20" \
-H "Authorization: Bearer $TOKEN"
Query params: postId, isRead (true/false), limit, cursor
bash
curl "https://socialcannon.app/api/v1/posts/<post_id>/engagements?cursor=<next_cursor>" \
-H "Authorization: Bearer $TOKEN"
Fetches fresh comments from the platform and stores them. Supports cursor for pagination.
Availability: not available for Facebook or LinkedIn yet (same platform-approval gate as analytics) — returns
400withcode: "PLATFORM_UNSUPPORTED". Replying to an engagement is likewise gated for those two. Seecapabilities.supportsEngagements/supportsReplyinGET /api/v1/platforms.
bash
curl -X PATCH https://socialcannon.app/api/v1/engagements/<engagement_id> \
-H "Authorization: Bearer $TOKEN"
Marks the engagement as read. No request body needed — the endpoint auto-marks on PATCH.
bash
curl -X POST https://socialcannon.app/api/v1/engagements/<engagement_id>/reply \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "content": "Thanks for the feedback!" }'
Posts the reply directly on the social platform.
Adapt content for multiple platforms using AI. Two modes available:
bash
curl -X POST https://socialcannon.app/api/v1/posts/repurpose \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sourceContent": "Your long-form content here...",
"targetPlatforms": ["twitter", "facebook", "tiktok"],
"mode": "preview",
"tone": "professional"
}'
Returns { "variants": [{ "platform", "content", "validation", "characterCount" }], "allValid" }.
bash
curl -X POST https://socialcannon.app/api/v1/posts/repurpose \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sourceContent": "Your content here...",
"targetPlatforms": ["twitter", "facebook"],
"mode": "post",
"accountIds": { "twitter": "acc_123", "facebook": "acc_456" },
"mediaUrls": { "twitter": ["https://example.com/video.mp4"] },
"appendContent": { "twitter": "Links or extra text for Twitter only" },
"appendToAll": "Text appended to all platforms"
}'
Returns { "results": [{ "platform", "success", "postUrl?", "error?" }] }.
All content is humanized automatically to remove AI writing patterns. Trusted clients bypass tier limits.
Not available for TikTok. A/B-test variants carry only content + media, so they can't set the per-post privacy level TikTok requires. A TikTok account is rejected with
400andcode: "PLATFORM_UNSUPPORTED"— publish individual posts to TikTok instead.
Not available for LinkedIn or Facebook. Both are publish-only for analytics right now (LinkedIn needs Community Management approval; Facebook needs Meta App Review for
pages_read_engagement), so a winner could never be determined. Those accounts are rejected with400andcode: "PLATFORM_UNSUPPORTED"— publish individual posts instead.
bash
curl -X POST https://socialcannon.app/api/v1/ab-tests \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"accountId": "<account_id>",
"name": "CTA test",
"variants": [
{ "content": "Check out our new feature!", "mediaUrls": ["https://..."] },
{ "content": "You won'\''t believe this new feature..." }
],
"metric": "engagementRate",
"minDurationHours": 24,
"scheduledAt": "2026-04-20T10:00:00Z",
"aiGenerated": true
}'
Publish behavior matches POST /api/v1/posts:
scheduledAt → all variants publish immediately to the platform via the social adapterscheduledAt → all variants are scheduled for that time (must be within 30 days; cron publishes them hourly)Each variant is a separate post record. Auto-completes after minDurationHours and the winner is determined by the chosen metric. Per-variant mediaUrls is optional. The test-level aiGenerated flag (optional) requests the platform's native AI-content label for every variant; Instagram rejects the test before variant creation unless verified native-disclosure access is enabled.
Partial failure semantics: if ANY variant fails to publish during immediate mode, the endpoint returns HTTP 502 and the failed variants are marked with status: 'failed'. The A/B test record is still created, but the winner comparison at completion only considers successfully published variants. Inspect each variant's post status before relying on test results.
bash
curl https://socialcannon.app/api/v1/ab-tests/<test_id> \
-H "Authorization: Bearer $TOKEN"
Returns per-variant metrics, current winner, and confidence score.
bash
curl "https://socialcannon.app/api/v1/ab-tests?status=active" \
-H "Authorization: Bearer $TOKEN"
bash
curl -X POST https://socialcannon.app/api/v1/ab-tests/<test_id>/complete \
-H "Authorization: Bearer $TOKEN"
bash
curl "https://socialcannon.app/api/v1/accounts/<account_id>/timing?timezone=UTC-5" \
-H "Authorization: Bearer $TOKEN"
Returns top 5 time slots ranked by average engagement rate with confidence scores.
Combines engagement data with calendar availability. Unlike the other two timing endpoints, this one is available on all tiers (including Free):
bash
curl "https://socialcannon.app/api/v1/timing/optimal-slot?accountId=<account_id>&timezone=UTC-5" \
-H "Authorization: Bearer $TOKEN"
Returns the next open slot ranked by historical performance.
Distribute posts across optimal time slots for the next 7 days:
bash
curl -X POST https://socialcannon.app/api/v1/posts/auto-schedule \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"accountId": "<account_id>",
"posts": [
{ "content": "Post 1 text" },
{ "content": "Post 2 text", "mediaUrls": ["https://..."], "platformOptions": { "aiGenerated": true } },
{ "content": "Post 3 text" }
],
"timezone": "UTC-5"
}'
Max 20 posts per request. Each post gets a unique slot. Per-post platformOptions are supported (e.g. aiGenerated to request the AI-content label, title/ visibility where applicable). An Instagram item with aiGenerated: true fails closed unless verified native-disclosure access is enabled. Returns { scheduled: [...], unscheduled: [...], summary: {...} }.
Generate UTM-tagged URLs:
bash
curl -X POST https://socialcannon.app/api/v1/links/generate \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/product",
"platform": "twitter",
"campaign": "spring-launch",
"content": "hero-cta",
"postId": "<post_id>",
"save": true
}'
Fields: url (required), platform (optional — sets utm_source), campaign (optional — utm_campaign), content (optional — utm_content), term (optional — utm_term), postId (optional — link to a post), save (optional, default true — persist to tracked_links).
bash
curl "https://socialcannon.app/api/v1/links?postId=<post_id>&platform=twitter&limit=20&cursor=<cursor>" \
-H "Authorization: Bearer $TOKEN"
Query params: postId, platform, limit, cursor — all optional.
List supported platforms and their capabilities (public, no auth required):
bash
curl https://socialcannon.app/api/v1/platforms
platformOptions.mediaType to "reel". Video must be MP4/MOV, vertical (9:16). Without this, videos post as regular video posts.platformOptions.mediaType to "story". Supports one image or video. Ephemeral (24h).bash
curl -X POST https://socialcannon.app/api/v1/posts \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"accountId": "<account_id>",
"content": "Check out this tutorial!",
"mediaUrls": ["https://example.com/video.mp4"],
"platformOptions": {
"mediaType": "reel"
}
}'
platformOptions.mediaType to "story". One image or video.platformOptions.mediaType to "reel". Vertical 9:16 video.platformOptions.aiGenerated: true is rejected before any Meta request unless the deployment has explicitly enabled verified capability access. When enabled, SocialCannon sends is_ai_generated (the "AI info" label); on carousels it is applied to the parent only. Do not publish by silently removing the requested disclosure.platformOptions.privacyLevel is REQUIRED on every TikTok post — there is no default. Omitting it returns 400 with code TIKTOK_PRIVACY_REQUIRED. Use a value from the creator-info endpoint's privacyLevelOptions (e.g. PUBLIC_TO_EVERYONE, MUTUAL_FOLLOW_FRIENDS, FOLLOWER_OF_CREATOR, SELF_ONLY).disableComment, disableDuet, disableStitch (booleans). Duet/Stitch apply to video only. If the creator-info endpoint reports an interaction is disabled account-side ( commentDisabled / duetDisabled / stitchDisabled), set the matching disable* to true (the server force-disables it regardless).commercialContent: true if the post promotes a brand, product, or service, then set brandOrganic: true (your own brand) and/or brandedContent: true (paid/third-party partnership). If brandedContent is true, privacyLevel cannot be SELF_ONLY.aiGenerated: true when the media is AI-generated ( is_aigc — TikTok shows an "AI-generated" label).platformOptions.mediaType to "story". One video. Ephemeral (24h).Get a TikTok account's posting capabilities — call this before composing a TikTok post; it returns the allowed privacy levels and which interactions are disabled:
bash
curl https://socialcannon.app/api/v1/accounts/<account_id>/tiktok/creator-info \
-H "Authorization: Bearer $TOKEN"
Returns { creatorNickname, creatorUsername, creatorAvatarUrl, privacyLevelOptions, commentDisabled, duetDisabled, stitchDisabled, maxVideoPostDurationSec }. Choose privacyLevel from privacyLevelOptions and respect the *Disabled flags.
Example — publish a public TikTok video with comments on:
bash
curl -X POST https://socialcannon.app/api/v1/posts \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"accountId": "<account_id>",
"content": "New track out now!",
"mediaUrls": ["https://example.com/clip.mp4"],
"platformOptions": {
"privacyLevel": "PUBLIC_TO_EVERYONE",
"disableComment": false,
"disableDuet": false,
"disableStitch": false
}
}'
platformOptions.mediaType to "short". Vertical video ≤60s.platformOptions.mediaType to "community". Text/image post to channel's Community tab.publishAt timestamp.platformOptions.aiGenerated: true for realistic AI-generated media ( containsSyntheticMedia — YouTube's "Altered content" disclosure).429 with Retry-After header when exceededFour tiers. Twitter/X is the only platform with a per-post API cost passed through, so every tier carries an X-write quota.
sales@socialcannon.appAny tier exceeding its maxTwitterPostsPerPeriod cap returns:
json
{
"success": false,
"error": "Twitter/X post limit reached (50/50). Upgrade to Agency for 250 Twitter/X posts per month.",
"code": "LIMIT_EXCEEDED",
"limit": { "type": "twitter_posts_per_period", "current": 50, "max": 50, "tier": "pro" }
}
HTTP 403. Resets at the start of the next billing period. The upgrade hint is tier-aware — Free is pointed to Pro, Pro to Agency, and Agency/Enterprise to sales@socialcannon.app (no tier is "unlimited" for Twitter/X).
If you run into issues with the API, account connections, or integration setup, contact support@socialcannon.app.
accountId values before creating posts.autoUtm: true in platformOptions to automatically tag URLs in posts.validation field — if valid is false, adjust the content before publishing.scheduledAt: "optimal" to let SocialCannon pick the best posting time automatically (Pro).mediaType to "short" for Shorts or "community" for Community tab posts.GET /api/v1/accounts/{id}/tiktok/creator-info first — it returns the allowed privacyLevelOptions (pass one as platformOptions.privacyLevel; it is required) and which of Comment/Duet/Stitch are disabled (never enable a disabled one).platformOptions.aiGenerated: true to request the native label. TikTok and YouTube map it directly; Instagram fails closed unless verified native-disclosure access is enabled for the deployment. Report that block rather than silently removing the flag.