> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postploy.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Postploy's MCP server for posting is https://api.postploy.com/mcp and signs in with OAuth. The REST API base URL is https://api.postploy.com/public/v1 and takes an API key as a Bearer token. The API calls channels accounts.

# Quickstart

> Make your first post in a few minutes, with your AI or with the API.

Pick how you want to work. You can do both.

> [tab] With your AI
>
> **1. Add Postploy to your AI app**
>
> Give your app this server URL. There's a short guide for [Claude](https://docs.postploy.com/ai/claude.md), [ChatGPT](https://docs.postploy.com/ai/chatgpt.md), [Claude Code](https://docs.postploy.com/ai/claude-code.md), [Cursor](https://docs.postploy.com/ai/cursor.md) and [Codex](https://docs.postploy.com/ai/codex.md).
>
> ```text theme={null}
> https://api.postploy.com/mcp
> ```
>
> **2. Sign in and allow**
>
> Your app opens Postploy. Sign in, pick your team and click **Allow**.
>
> **3. Ask for a post**
>
> Try this:
>
> > Write a LinkedIn post about our new opening hours and save it as a draft on Postploy.
>
> Your app checks LinkedIn's rules, writes the post and saves it. Open your Postploy calendar to see it.

> [tab] With the API
>
> **1. Create an API key**
>
> In Postploy, open **Settings › AI apps & API** and click **Create key**. Copy the key now, because it's shown only once. Then keep it in your terminal:
>
> ```bash theme={null}
> export POSTPLOY_API_KEY="ppk_your_key"
> ```
>
> **2. Find your channel**
>
> List the social accounts connected to your team:
>
> ```bash curl theme={null}
> curl https://api.postploy.com/public/v1/accounts \
>   -H "Authorization: Bearer $POSTPLOY_API_KEY"
> ```
>
> ```js JavaScript theme={null}
> const res = await fetch("https://api.postploy.com/public/v1/accounts", {
>   headers: { Authorization: `Bearer ${process.env.POSTPLOY_API_KEY}` },
> });
> const { data } = await res.json();
> console.log(data);
> ```
>
> ```python Python theme={null}
> import os
> import requests
>
> res = requests.get(
>     "https://api.postploy.com/public/v1/accounts",
>     headers={"Authorization": f"Bearer {os.environ['POSTPLOY_API_KEY']}"},
> )
> print(res.json()["data"])
> ```
>
> Copy the `id` of the channel you want to post to.
>
> ```json Response theme={null}
> {
>   "data": [
>     {
>       "id": "5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d",
>       "platform": "linkedin",
>       "name": "Halo Coffee",
>       "username": "halo-coffee",
>       "profileImage": "https://cdn.example.com/halo.png",
>       "needsReconnect": false,
>       "lastError": null
>     }
>   ]
> }
> ```
>
> **3. Save a draft**
>
> Drafts never go out, so this is safe to try. Put your channel's `id` in `socialAccountId`:
>
> ```bash curl theme={null}
> curl https://api.postploy.com/public/v1/posts \
>   -H "Authorization: Bearer $POSTPLOY_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "posts": [
>       {
>         "socialAccountId": "5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d",
>         "text": "Hello from the Postploy API",
>         "status": "draft"
>       }
>     ]
>   }'
> ```
>
> ```js JavaScript theme={null}
> const res = await fetch("https://api.postploy.com/public/v1/posts", {
>   method: "POST",
>   headers: {
>     Authorization: `Bearer ${process.env.POSTPLOY_API_KEY}`,
>     "Content-Type": "application/json",
>   },
>   body: JSON.stringify({
>     posts: [
>       {
>         socialAccountId: "5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d",
>         text: "Hello from the Postploy API",
>         status: "draft",
>       },
>     ],
>   }),
> });
> const { data } = await res.json();
> console.log(data[0].id);
> ```
>
> ```python Python theme={null}
> import os
> import requests
>
> res = requests.post(
>     "https://api.postploy.com/public/v1/posts",
>     headers={"Authorization": f"Bearer {os.environ['POSTPLOY_API_KEY']}"},
>     json={
>         "posts": [
>             {
>                 "socialAccountId": "5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d",
>                 "text": "Hello from the Postploy API",
>                 "status": "draft",
>             }
>         ]
>     },
> )
> print(res.json()["data"][0]["id"])
> ```
>
> The response is the post you made. Copy its `id`. It's on today's page of your Postploy calendar, marked as a draft.
>
> **4. Schedule it**
>
> Give the post a time and set its status to `scheduled`. Use any time in the future, as ISO 8601 with an offset, such as `Z` for UTC:
>
> ```bash curl theme={null}
> curl -X PATCH https://api.postploy.com/public/v1/posts/POST_ID \
>   -H "Authorization: Bearer $POSTPLOY_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{ "status": "scheduled", "scheduledAt": "2030-01-15T09:00:00Z" }'
> ```
>
> ```js JavaScript theme={null}
> const tomorrow = new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString();
>
> const res = await fetch(`https://api.postploy.com/public/v1/posts/${postId}`, {
>   method: "PATCH",
>   headers: {
>     Authorization: `Bearer ${process.env.POSTPLOY_API_KEY}`,
>     "Content-Type": "application/json",
>   },
>   body: JSON.stringify({ status: "scheduled", scheduledAt: tomorrow }),
> });
> console.log((await res.json()).data.status);
> ```
>
> ```python Python theme={null}
> import os
> from datetime import datetime, timedelta, timezone
>
> import requests
>
> tomorrow = (datetime.now(timezone.utc) + timedelta(days=1)).isoformat()
>
> res = requests.patch(
>     f"https://api.postploy.com/public/v1/posts/{post_id}",
>     headers={"Authorization": f"Bearer {os.environ['POSTPLOY_API_KEY']}"},
>     json={"status": "scheduled", "scheduledAt": tomorrow},
> )
> print(res.json()["data"]["status"])
> ```
>
> The post now goes out at that time. Changed your mind? Delete it with [Delete a post](https://docs.postploy.com/api-reference/posts/delete-a-post.md) before then.
>
> > [!NOTE]
> >
> > If your role can't publish, the post waits for approval instead, and its status is `pending_approval`. Someone who can approve it does so in the Inbox.

## Next steps

> [card] [Schedule posts](https://docs.postploy.com/api/posts.md)
>
> Media, threads, approvals and everything else a post can do.

> [card] [Get webhooks](https://docs.postploy.com/webhooks.md)
>
> Hear when your post goes live or fails.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.