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

# Scheduling posts

> Schedule LinkedIn posts through Pekto.

Pekto publishes scheduled posts through the social accounts you connected in the app (**Schedule** in the Pekto dashboard). Connect an account there first; the API can list and use accounts but not connect them.

## 1. Find the account

```bash theme={null}
curl "$PEKTO_API/social-accounts" -H "Authorization: Bearer $PEKTO_API_KEY"
```

Use the `id` of the account you want to post from.

## 2. Schedule the post

```bash theme={null}
curl -X POST "$PEKTO_API/scheduled-posts" \
  -H "Authorization: Bearer $PEKTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "social_account_id": "a1b2…",
    "post_type": "text",
    "caption": "Five personal branding mistakes I see every week. Which one are you fixing first?",
    "scheduled_for": "2026-11-03T09:00:00Z",
    "project_id": "6f1c…"
  }'
```

| Field | Notes |
| - | - |
| `post_type` | `text` (default), `image` or `document`. |
| `caption` | Up to 3,000 characters. |
| `scheduled_for` | A future ISO 8601 time with a time zone. |
| `project_id` | Optional: links the post to a project you own. |
| `media_urls` | Required for `image` and `document` posts. See below. |

## Image and document posts

`media_urls` must be files in your own Pekto media folder: a storage path such as `<your-user-id>/carousel.pdf`, or that file's public URL. Files you schedule from the Pekto app are stored there. Other URLs are refused with `400 invalid_media`.

To post a carousel as a LinkedIn document, open the project in Pekto and use **Publish and Schedule** in the editor: it builds the PDF and schedules the post for you.

## Manage posts

```bash theme={null}
# scheduled and published posts
curl "$PEKTO_API/scheduled-posts?limit=25" -H "Authorization: Bearer $PEKTO_API_KEY"

# delete a post that hasn't been published (draft, pending or failed)
curl -X DELETE "$PEKTO_API/scheduled-posts/$POST_ID" -H "Authorization: Bearer $PEKTO_API_KEY"
```

Published posts can't be deleted through Pekto; remove them on the platform.

Scheduling needs `social:write`; listing needs `social:read`.


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