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

# Schedule a post

> Write a post once and send it to several accounts at a set time.

**1. Find your accounts**

```bash cURL theme={"system"}
curl https://api.postinger.dev/v1/accounts \
  -H "Authorization: Bearer $POSTINGER_API_KEY"
```

```bash CLI theme={"system"}
postinger accounts list
```

**2. Check the workspace's clock**

Times are written on the workspace's clock. `GET /v1/me` (or `postinger whoami`) shows its time zone.

**3. Add an image**

Instagram needs at least one attachment: a JPEG between 4:5 portrait and 1.91:1 landscape.

```bash cURL theme={"system"}
curl https://api.postinger.dev/v1/media/from-url \
  -H "Authorization: Bearer $POSTINGER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/launch.jpg", "fileName": "launch.jpg" }'
```

```bash CLI theme={"system"}
postinger media upload launch.jpg
```

Keep the media `id` for the next step. See [Upload media](https://docs.postinger.dev/guides/upload-media.md) for files on your machine.

**4. Create the post**

```bash cURL theme={"system"}
curl https://api.postinger.dev/v1/posts \
  -H "Authorization: Bearer $POSTINGER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: launch-2026-11-01" \
  -d '{
    "content": "We are live! 🚀",
    "mediaIds": ["MEDIA_ID"],
    "targets": [
      { "socialAccountId": "FACEBOOK_ID", "content": null, "options": { "link": "https://example.com" } },
      { "socialAccountId": "INSTAGRAM_ID", "content": null, "options": null }
    ],
    "schedule": { "mode": "at", "at": "2026-11-01T09:00" }
  }'
```

```bash CLI theme={"system"}
postinger posts create \
  --content "We are live! 🚀" \
  --account FACEBOOK_ID --account INSTAGRAM_ID \
  --media MEDIA_ID \
  --at 2026-11-01T09:00
```

```text MCP prompt theme={"system"}
Schedule "We are live! 🚀" with https://example.com/launch.jpg
on our Facebook Page and Instagram for November 1st at 9am.
```

The CLI's flags cover the common case. For per-target text and options, pass the whole request with `--file post.json`.

## Drafts and posting now

* Leave out `schedule` (or send `"mode": "draft"`) to save a draft. With the CLI, leave out `--at` and `--now`. A draft can keep the time it is planned for (`"mode": "draft", "at": "2026-06-01T09:00"`, or `--draft --at` with the CLI): it shows on the calendar, but nothing publishes it until you schedule it.
* Send `"mode": "now"` (or `--now`) to publish right away.

## If the post doesn't pass

Scheduling checks every target against its [platform's rules](https://docs.postinger.dev/concepts/platform-rules.md). A post that doesn't pass is a `400` that names each field:

```json theme={"system"}
{
  "title": "One or more validation errors occurred.",
  "status": 400,
  "errors": {
    "targets[1].content": ["An Instagram post needs a caption."]
  }
}
```

## Changing it later

Read the post, change it and send it back whole with `PUT /v1/posts/{id}`, including the `version` you read. Published posts can't be changed. See [Editing safely](https://docs.postinger.dev/concepts/posts.md#editing-safely).


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