{"openapi":"3.1.0","info":{"title":"SleekPost API","version":"1.0.0","summary":"Publish and schedule social media posts from AI agents and code.","description":"Publish now, schedule, or draft posts to X (Twitter), LinkedIn, Instagram, Facebook, Threads, Bluesky, TikTok, YouTube, Pinterest, Telegram with one request.\n\nAuthenticate with an API key from https://sleekpost.com/dashboard/api, sent as `Authorization: Bearer sp_live_...` (or `X-API-Key`).\nSocial accounts are connected by the account owner in the dashboard (https://sleekpost.com/dashboard/connections); the API addresses them by id.\nThe same operations are available as a remote MCP server at https://sleekpost.com/mcp.\n\nSend an `Idempotency-Key` header with POST /posts so retries never publish twice.","contact":{"name":"SleekPost support","email":"support@sleekpost.com","url":"https://sleekpost.com/agents"},"termsOfService":"https://sleekpost.com/terms-of-service"},"externalDocs":{"description":"Agent quickstart","url":"https://sleekpost.com/agents"},"servers":[{"url":"https://sleekpost.com/api/v1"}],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"tags":[{"name":"Accounts","description":"Connected social media accounts."},{"name":"Posts","description":"Publish, schedule and manage posts."},{"name":"Media","description":"Images and videos to attach to posts."}],"paths":{"/me":{"get":{"tags":["Accounts"],"operationId":"getWorkspace","summary":"Check the API key, plan and connected account count","responses":{"200":{"description":"Workspace summary.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Workspace"}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The workspace has no active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/accounts":{"get":{"tags":["Accounts"],"operationId":"listAccounts","summary":"List connected social accounts","description":"Returns every connected account. Use the `id` values as `account_ids` when creating posts.","responses":{"200":{"description":"Connected accounts.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Account"}},"connect_url":{"type":"string","format":"uri","description":"Where the owner connects more accounts."},"hint":{"type":"string"}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The workspace has no active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/posts":{"get":{"tags":["Posts"],"operationId":"listPosts","summary":"List posts","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["scheduled","published","failed","draft","processing"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}}],"responses":{"200":{"description":"A page of posts. Scheduled posts are ordered soonest first, others newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Post"}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"has_more":{"type":"boolean"}}}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The workspace has no active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Posts"],"operationId":"createPost","summary":"Publish now, schedule, or save a draft","description":"Set exactly one of `publish_now`, `scheduled_at` or `draft`. Content is checked against every network's rules before anything is published; violations return 400 with `details.problems` (drafts are saved anyway and get the problems as `warnings`). Publishing waits up to ~40s for results: 201 means finished, 202 means still publishing (poll GET /posts/{id}).","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key (e.g. a UUID). Retrying with the same key returns the original response instead of posting twice. Remembered for 24 hours.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePostRequest"},"examples":{"publishNow":{"summary":"Publish now to two accounts","value":{"text":"We just shipped dark mode 🌙","account_ids":["<account id>","<account id>"],"publish_now":true}},"schedule":{"summary":"Schedule with an image","value":{"text":"Launch day is here!","account_ids":["<account id>"],"media_urls":["https://example.com/launch.jpg"],"scheduled_at":"2026-12-01T15:00:00Z"}}}}}},"responses":{"200":{"description":"Dry run result (nothing was saved).","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Post created (and published, for publish_now).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"202":{"description":"Publishing is still in progress; poll GET /posts/{id}.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"400":{"description":"Invalid request or content that a network would reject.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The workspace has no active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A request with this Idempotency-Key is still in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Idempotency-Key reused with a different body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/posts/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Posts"],"operationId":"getPost","summary":"Get a post with per-account results","responses":{"200":{"description":"The post.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The workspace has no active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such post.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Posts"],"operationId":"deletePost","summary":"Delete a post (cancels it if scheduled)","description":"Removes the post from SleekPost. Content already published stays live on the networks.","responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The workspace has no active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such post.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The post is being published right now.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/media":{"post":{"tags":["Media"],"operationId":"uploadMedia","summary":"Import an image or video","description":"Send JSON `{\"url\": \"https://...\"}` to import a public file, or multipart/form-data with a `file` field (request bodies are capped at 4.5 MB, so import larger files by URL). By URL: images up to 30 MB, videos up to 200 MB.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri"},"name":{"type":"string","maxLength":120}}}},"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"name":{"type":"string"}}}}}},"responses":{"201":{"description":"Imported.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Media"}}}}}},"400":{"description":"Could not download the URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The workspace has no active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"File too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Not a supported image or video.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; see the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key from the SleekPost dashboard (sp_live_...)."},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","examples":["invalid_request","invalid_api_key","subscription_required","rate_limited"]},"message":{"type":"string"},"hint":{"type":"string","description":"What to do next."},"details":{"type":"object"}}}}},"Workspace":{"type":"object","properties":{"email":{"type":"string"},"plan":{"type":"string"},"subscription_status":{"type":"string"},"connected_accounts":{"type":"integer"},"accounts_by_platform":{"type":"object","additionalProperties":{"type":"integer"}},"supported_platforms":{"type":"array","items":{"type":"string"}},"links":{"type":"object","additionalProperties":{"type":"string","format":"uri"}}}},"Account":{"type":"object","properties":{"id":{"type":"string","description":"Use in account_ids."},"platform":{"type":"string","enum":["twitter","linkedin","instagram","facebook","threads","bluesky","tiktok","youtube","pinterest","telegram"]},"platform_label":{"type":"string"},"name":{"type":["string","null"]},"username":{"type":["string","null"]},"profile_image_url":{"type":["string","null"]},"connected_at":{"type":["string","null"],"format":"date-time"},"needs_reconnect":{"type":"boolean","description":"If true the owner must reconnect it before posting."}}},"Media":{"type":"object","properties":{"id":{"type":"string","description":"Use in media_ids."},"type":{"type":"string","enum":["image","video"]},"url":{"type":"string","format":"uri"},"thumbnail_url":{"type":["string","null"]},"name":{"type":"string"},"width":{"type":["integer","null"]},"height":{"type":["integer","null"]},"size_bytes":{"type":"integer"},"duration_seconds":{"type":["number","null"]}}},"CreatePostRequest":{"type":"object","required":["account_ids"],"additionalProperties":false,"properties":{"text":{"type":"string","maxLength":10000,"description":"The post text. Used for every account unless text_overrides gives that account its own text."},"account_ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":25,"description":"IDs of the connected accounts to post to, from list_accounts / GET /api/v1/accounts."},"media_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10,"description":"Public http(s) URLs of images (JPEG/PNG/WebP/GIF) or videos (MP4/MOV/WebM) to attach. SleekPost downloads and re-hosts them."},"media_ids":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"IDs of media already uploaded with upload_media / POST /api/v1/media."},"text_overrides":{"type":"object","additionalProperties":{"type":"string"},"description":"Per-account text, keyed by account ID. Use it to fit stricter limits, e.g. a shorter version for Bluesky (300) or a title for YouTube (100)."},"publish_now":{"type":"boolean","description":"true = publish immediately. Set exactly one of publish_now, scheduled_at or draft."},"scheduled_at":{"type":"string","format":"date-time","description":"When to publish, as ISO 8601 with a timezone, e.g. 2026-12-01T15:00:00Z or 2026-12-01T09:00:00-05:00. Must be at least 2 minutes ahead."},"draft":{"type":"boolean","description":"true = save as a draft in the SleekPost dashboard without publishing."},"dry_run":{"type":"boolean","description":"true = validate everything and report what would happen, without saving or publishing anything."}}},"PostTarget":{"type":"object","properties":{"account_id":{"type":["string","null"]},"platform":{"type":"string"},"username":{"type":["string","null"]},"status":{"type":"string","enum":["pending","published","failed"]},"url":{"type":["string","null"],"description":"Live URL once published."},"platform_post_id":{"type":["string","null"]},"error":{"type":["string","null"]},"text_override":{"type":["string","null"]}}},"Post":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["processing","scheduled","published","failed","draft"]},"text":{"type":"string"},"scheduled_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"media":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"targets":{"type":"array","items":{"$ref":"#/components/schemas/PostTarget"}},"review_url":{"type":"string","format":"uri","description":"Dashboard link for drafts and scheduled posts."}}},"PostResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Post"},"warnings":{"type":"array","items":{"type":"string"}}}}}}}