> ## 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.

# REST API

> Schedule and manage posts from your own code.

The REST API lets your code do what your team does in Postploy: create, schedule, approve and track posts.

```text Base URL theme={null}
https://api.postploy.com/public/v1
```

## Authentication

Every request needs an API key.

**1. Create a key**

In Postploy, open **Settings › AI apps & API** and click **Create key**. Copy it now, because it's shown only once.

**2. Send it with every request**

Put it in the `Authorization` header:

```http theme={null}
Authorization: Bearer ppk_your_key
```

A key acts as the person who created it, in the team they created it in. It has their permissions and can use their channels. It stops working when they delete it or leave the team. Each person can have up to 10 keys in a team.

> [!WARNING]
>
> Treat a key like a password. Keep it on your server, never in a browser or app people download. If one leaks, delete it in **Settings › AI apps & API**.

## Your first request

List the channels you can post to:

```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();
```

```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']}"},
)
data = res.json()["data"]
```

## Requests

* Send JSON with `Content-Type: application/json`.
* Ids are UUIDs.
* Times are ISO 8601 with an offset, such as `2030-01-15T09:00:00Z` or `2030-01-15T10:00:00+01:00`. Postploy returns times in UTC.

## Responses

Successful responses put their result in `data`:

```json theme={null}
{
  "data": {
    "id": "3f6c2a1b-9d8e-4f7a-b6c5-d4e3f2a1b0c9",
    "status": "scheduled",
    "scheduledAt": "2030-01-15T09:00:00.000Z"
  }
}
```

Lists also say where you are. `page` starts at `0`:

```json theme={null}
{
  "data": [],
  "page": 0,
  "limit": 50,
  "total": 120
}
```

To get every post, ask for the next `page` until you've seen `total` posts.

## Limits

| Limit | Value |
| - | - |
| Requests | 120 a minute to each endpoint, per person. All your keys count together. `X-RateLimit-Remaining-caller` says how many you have left. |
| Posts per create or check | 50 |
| Posts per approve, restore or delete-for-good | 100 |
| Media per post | 35 files, within each platform's own limit |

## Next steps

> [card] [Schedule posts](https://docs.postploy.com/api/posts.md)
>
> Text, media, threads, drafts and approvals.

> [card] [Platform options](https://docs.postploy.com/api/platform-options.md)
>
> What each platform needs, and its extra options.

> [card] [Errors](https://docs.postploy.com/api/errors.md)
>
> What each error means and what to do about it.

> [card] [API reference](https://docs.postploy.com/api-reference/posts/create-posts.md)
>
> Every endpoint, with a playground to try it.


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