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

# Authentication

> Authenticate REST API requests with an API key.

The Postbase REST API is authenticated with an **API key**. Generate one under
**AI & API** in the app, then send it as a bearer token.

## Base URL

```
https://www.postbase.so/api/v1
```

## Authorization header

```bash theme={null}
curl https://www.postbase.so/api/v1/channels \
  -H "Authorization: Bearer pb_live_…"
```

Every request must include `Authorization: Bearer <your key>`. Requests without
a valid key return `401 Unauthorized`. A key is scoped to the workspace it was
created in.

## Check a key

```bash theme={null}
curl https://www.postbase.so/api/v1/me \
  -H "Authorization: Bearer pb_live_…"
```

`GET /me` returns the workspace the key acts for and how many channels it has:

```json Response theme={null}
{ "workspace": { "id": "…", "name": "Acme" }, "channels": 3 }
```

<Warning>
  Keys are shown once at creation. Store yours securely; rotate or revoke it
  from **AI & API** if it leaks.
</Warning>

## Rate limits

Limits are counted per workspace, across the REST API and the MCP server
together:

| Limit | Value |
| - | - |
| Requests | 120 a minute |
| Posts created (drafts and scheduled) | 60 an hour |
| Files added from links (`media_urls`, `POST /media`) | 60 an hour |
| Failed authentications | 30 a minute per IP address |

Over a limit, the API returns `429 Too Many Requests` with a `Retry-After`
header (in seconds) and a JSON body:

```json theme={null}
{ "error": "rate_limited", "message": "Rate limit: 120 requests a minute per workspace. Try again in a minute.", "retry_after": 60 }
```

Through MCP, a `create_post` call over the hourly limit returns a tool error
with the same message.

<Card title="Endpoints" icon="code" href="/api/posts">
  See the available endpoints for posts and channels.
</Card>


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