# REST API

> Fuxux's REST API: API keys, the main endpoints for posts, accounts and media, signed webhooks and rate limits.
>
> For the complete documentation index, see [llms.txt](https://www.fuxux.com/docs/llms.txt). HTML version: https://www.fuxux.com/docs/api

The REST API covers what the web app does with posts: create, schedule, list, edit and delete them, upload media, read connected accounts and analytics, and generate captions. The interactive reference is at [/reference](https://www.fuxux.com/reference) and the OpenAPI document at [/openapi.json](https://www.fuxux.com/openapi.json).

> Using Cursor, Claude Code or another coding assistant with the Context7 MCP server? These docs are indexed there: add `use context7` to your prompt, or ask for the library `/llmstxt/fuxux_llms_txt` ([Fuxux on Context7](https://context7.com/llmstxt/fuxux_llms_txt)). The API reference is indexed too, as [Fuxux API](https://context7.com/openapi/fuxux_openapi_json).

Comparing posting APIs? See [Fuxux as an Ayrshare alternative](https://www.fuxux.com/ayrshare-alternative) for prices and what each one is built for.

## Base URL and authentication

```
https://www.fuxux.com/api
```

Send an API key as a bearer token. Keys need a paid plan with the API add-on ($5/month, from the Billing page). Create them on the API keys page: they start with `fx_live_`, are shown once and last until you revoke or rotate them. Use one key per integration.

```bash
curl https://www.fuxux.com/api/accounts \
  -H "Authorization: Bearer fx_live_your_key_here"
```

## Main endpoints

| Method and path | What it does |
| --- | --- |
| `GET /api/accounts` | List connected social accounts. |
| `GET /api/posts` | List posts (filter by status and month). |
| `POST /api/posts` | Create a post: publish now, schedule or save a draft. |
| `GET /api/posts/{id}` | One post with per-platform results. |
| `PATCH /api/posts/{id}` | Edit or reschedule a draft or scheduled post. |
| `DELETE /api/posts/{id}` | Delete a post. |
| `POST /api/media/upload` | Upload an image or video to attach to posts. |
| `POST /api/ai/generate` | Generate a caption for each platform from a prompt. |
| `GET /api/usage` | Your plan's limits and what you've used this month. |
| `GET /api/analytics` | Publishing analytics. |
| `GET /api/dashboard` | Summary: counts, upcoming posts, accounts needing attention. |

## Create a post

```bash
curl -X POST https://www.fuxux.com/api/posts \
  -H "Authorization: Bearer fx_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "captions": {
      "linkedin": "We just shipped RSS auto-posting: every new blog post now shares itself.",
      "bluesky": "RSS auto-posting is live."
    },
    "scheduled_at": "2026-11-02T09:00:00Z"
  }'
```

`captions` maps each platform id to its caption; the post goes to the first connected account on each platform, or to the accounts you list in `targets`. Leave out `scheduled_at` to publish now, or send `draft: true` to save a draft. Attach media with `media_urls` from `POST /api/media/upload`. All fields are in the [API reference](https://www.fuxux.com/reference).

## Webhooks

Set a webhook URL on the API keys page to get a `POST` when a post publishes or fails. Each request is signed: the `X-Fuxux-Signature` header is `sha256=` followed by the HMAC-SHA256 of the raw body with your webhook secret. Check it before trusting the payload.

## Rate limits and errors

- 120 requests a minute per key, 300 a minute per account across all keys. A `429` response says when to retry.
- Errors return JSON with an `error` message that explains what to change (for example a caption over a network's limit, or a plan limit reached).
