# Social Media API for AI Agents (2026) · PostLake > Markdown version of https://postlake.dev/guides/social-media-api-for-ai-agents . The canonical page for humans. > PostLake is the social media API for AI agents: https://postlake.dev/llms.txt The social media API built for *AI agents.* A social media API for AI agents is not a scheduler with a REST wrapper. It is a contract an agent can reason over: one publish call, one response shape, retries that cannot double-post, and analytics in the same names on every network. PostLake is that contract. REST for LangGraph and CrewAI. A hosted MCP server for Claude, Cursor and ChatGPT. Agent skills for coding agents. Same accounts underneath. **In short:** PostLake is the social media posting API for AI agents: one REST contract and a hosted MCP server. Claude, Cursor, ChatGPT or your own agent publishes, schedules and reads analytics across every major network without nine platform SDKs. ## When this guide is for you You need a citable definition of a social media API built for agents, not a dashboard with an API bolted on. ## Before you start Same setup the [docs quickstart](https://docs.postlake.dev/quickstart.md) uses. Do this once: - Sign up at [app.postlake.dev](https://app.postlake.dev) and verify your email (unlocks free credits). - On **Channels**, create a **profile** (e.g. `my-brand`) and connect at least one account. **Bluesky is the fastest first channel**: no app review. Instagram/TikTok/Facebook need each platform's review before API posting. - Account menu → **API Keys** → create a key (`sk_live_…`). It shows once; treat it like a password. ## Give any MCP client the posting API This is the whole agent setup. Paste it into Claude, Cursor, ChatGPT or any MCP host. The agent gets publish, schedule, media and analytics as tools, not nine platform SDKs. ``` { "mcpServers": { "postlake": { "url": "https://api.postlake.dev/mcp" } } } ``` ## Step by step 1. Decide how the agent talks to PostLake: MCP (OAuth, no key in chat), agent skills (`npx skills add postlake/postlake-mcp --all`), or REST with a Bearer key in your runtime. 1. Connect the social accounts the agent may use under one profile. Bluesky is the fastest smoke test. 1. Tell the agent to publish with `create_post` / `POST /v1/posts` and to always read `targets[]`. Partial success is normal. 1. Send an `Idempotency-Key` (or let MCP do it) so a retry never double-posts. 1. Close the loop with `get_analytics` / `GET /v1/analytics` so the agent can decide what to post next. ## Read the response (don't skip this) You get one `Post` with an overall `state` and a `targets[]` array. One entry per account. **Always check each target**; partial success is normal. ``` { "id": "post_a1b2c3", "state": "partial", "targets": [ { "platform": "bluesky", "state": "published", "url": "https://bsky.app/…" }, { "platform": "linkedin", "state": "failed", "error": { "type": "invalid_request", "message": "…", "retryable": false } } ] } ``` - `published`: every target succeeded. `partial`: some published, some failed. `failed`: none published. `processing`: still going (async networks like TikTok). - **You're only charged for targets that actually publish.** Failed targets cost nothing. - Send an `Idempotency-Key` header on writes so a retry never double-posts. - Full detail: [Publishing](https://docs.postlake.dev/publishing) · [Errors & retries](https://docs.postlake.dev/errors) ## Where the post goes Same rules as the docs. Pick one addressing style: - **By profile**: `"profile": "my-brand"` posts to every account under that profile (the name on Channels). - **Filter networks**: `"platforms": ["bluesky", "linkedin"]` narrows that set. It is a **filter, not a selector**: if you have two Pinterest boards, both match `pinterest`. - **By account id**: `"accounts": ["acc_…"]` for exact channels (copy an id on Channels, or `GET /v1/social-accounts`). - One profile and you omit `profile`? PostLake uses that profile. Multiple profiles and you omit it? You'll get an error that names them. See [Publishing: where to post](https://docs.postlake.dev/publishing). ## Do more (same API) - **Schedule**: add `scheduledAt` as UTC (trailing `Z`), or a naive local time plus `timezone` (IANA, e.g. `Europe/London`). Credits charge when it fires. [Scheduling docs](https://docs.postlake.dev/scheduling) · [scheduling guide](/guides/schedule-posts-api). - **Media**: `POST /v1/media`, then pass the `med_…` id in `media`. [Media docs](https://docs.postlake.dev/media). - **Per-network caption**: `textOverrides` (e.g. shorter text for X). **Per-network options**: `platformOptions` (Pinterest `boardId`, TikTok privacy, …). Live option lists: `GET /v1/platforms/{platform}`. - **Validate first**: `POST /v1/posts/validate` runs the same checks without publishing (free). - Per-network limits and media rules: [posting API](/post-to/). - Client setup: [Claude, Cursor, ChatGPT, Gemini, Copilot](/agents/). - Build the loop: [AI social media agent](/guides/ai-social-media-agent). ## Pitfalls specific to this path - A dashboard API that returns a different JSON blob per network is not agent-native. The agent has to branch. PostLake does not. - Pasting a live API key into chat is how keys leak. Prefer MCP OAuth or skills with an env var. - Do not treat HTTP 200 as "live on every network". Read each target. Want zero wrapper code? Connect the hosted [MCP server](https://docs.postlake.dev/mcp) (`https://api.postlake.dev/mcp`) over OAuth. Same accounts and responses as this API path. [Agents overview](/agents/). ## Common questions ### What is a social media API for AI agents? An API an agent can call without per-platform SDKs: one publish, one response shape, safe retries, and analytics in the same metric names. PostLake is that API, plus a hosted MCP server. ### How is that different from a social media posting API? A posting API publishes. An agent-native one also returns a shape the model can reason over, blocks double-posts with idempotency keys, and exposes analytics so the agent can choose the next post. PostLake is both. ### Which AI agents can use PostLake? Any MCP client (Claude, Cursor, ChatGPT, Gemini, Copilot) and any agent framework that can call HTTPS (LangGraph, CrewAI, AutoGen, custom). ### Where do I start? Free tier, no card. Connect MCP at https://api.postlake.dev/mcp or follow the agents hub. Docs: https://docs.postlake.dev/mcp.md ## Go deeper in the docs These guides stay short on purpose. Canonical behaviour lives here: [Docs ### Quickstart Account, first channel, first post, MCP or API.](https://docs.postlake.dev/quickstart) [Docs ### Publishing Request body, addressing. Partial success, lifecycle.](https://docs.postlake.dev/publishing) [Docs ### Scheduling UTC or local time plus timezone, edit/cancel, fire-time credits.](https://docs.postlake.dev/scheduling) [Docs ### Platforms Limits, media rules, live platformOptions.](https://docs.postlake.dev/platforms) Also: [Media](https://docs.postlake.dev/media) · [Errors](https://docs.postlake.dev/errors) · [MCP](https://docs.postlake.dev/mcp) · [Analytics](https://docs.postlake.dev/analytics) ## Related guides - [Build an AI social agent](https://postlake.dev/guides/ai-social-media-agent.md) - [Post everywhere at once](https://postlake.dev/guides/post-to-all-social-media-at-once.md) - [Post with LangChain](https://postlake.dev/guides/langchain.md) - [Schedule posts via API](https://postlake.dev/guides/schedule-posts-api.md) [All guides](https://postlake.dev/guides/index.md) · [Full docs](https://docs.postlake.dev/) · [llms.txt](https://postlake.dev/llms.txt) Plain markdown for agents: https://postlake.dev/guides/social-media-api-for-ai-agents.md · https://postlake.dev/llms.txt