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

# Social publishing

> Schedule and publish organic posts across every connected platform.

Sapt publishes organic content to **Instagram, Facebook, TikTok, YouTube and
Google Business Profile** through one set of endpoints. You pick a connected
account, attach media, and either schedule the post or publish it now — the
platform-specific work happens behind the API.

## The shape of it

<Steps>
  <Step title="Find an account">
    [`GET /socials/accounts/{projectId}`](/api-reference/socials/list-connected-social-accounts)
    returns every connected account. Its `id` is the `socialAccountId` every
    other call takes.
  </Step>

  <Step title="Stage the media">
    Stream bytes to
    [`PUT /socials/media/{projectId}/stream-upload`](/api-reference/socials/stream-media-upload)
    and keep the returned handle. Small files can go inline as base64 instead.
  </Step>

  <Step title="Create the post">
    [`POST /socials/posts/{projectId}`](/api-reference/socials/create-post)
    with the account, caption, media type and either `scheduledFor` or
    `publishNow: true`.
  </Step>

  <Step title="Watch it land">
    [`GET /socials/posts/{projectId}/{postId}/status`](/api-reference/socials/get-post-status)
    until it reaches `published` — or `failed`, with a reason.
  </Step>
</Steps>

## Platforms

| Platform                | `platform` value  |
| ----------------------- | ----------------- |
| Instagram               | `instagram`       |
| Facebook                | `facebook`        |
| TikTok                  | `tiktok`          |
| YouTube                 | `youtube`         |
| Google Business Profile | `google_business` |

## Media types

`mediaType` describes the shape of the post. Not every platform accepts every
shape, and the API validates the combination before it accepts the post.

| `mediaType` | Use for                                                          |
| ----------- | ---------------------------------------------------------------- |
| `IMAGE`     | A single image post.                                             |
| `PHOTO`     | A single photo (Facebook's vocabulary for the same thing).       |
| `VIDEO`     | A standard video post.                                           |
| `REELS`     | A vertical short-form video.                                     |
| `CAROUSEL`  | Multiple images or videos in one post.                           |
| `STORIES`   | A story. Must be published immediately — it cannot be scheduled. |
| `LINK`      | A link post with no uploaded media. Pass `linkUrl`.              |

## Post lifecycle

A post's `status` moves through a small state machine:

```
scheduled ──► queued ──► publishing ──► published     (scheduled post)
draft ──────► queued ──► publishing ──► published     (publish now, async)
draft ──────► uploading ─────────────► published      (publish now, sync)
any ────────────────────────────────►  failed
```

You can still edit a post while its status is `draft`, `scheduled`, `queued` or
`failed`. Once it is `uploading` or `publishing` the platform owns it, and
`published` is live.

## Scheduling window

`scheduledFor` must be **at least 10 minutes** and **at most 75 days** in the
future. That mirrors what the upstream platforms accept, so the API rejects an
out-of-range time immediately rather than letting the platform reject it after
the media has already uploaded.

<CardGroup cols={2}>
  <Card title="Connected accounts" icon="user" href="/docs/mintlify/social/accounts" />

  <Card title="Uploading media" icon="upload" href="/docs/mintlify/social/media" />

  <Card title="Scheduling posts" icon="calendar" href="/docs/mintlify/social/scheduling" />

  <Card title="Publishing now" icon="paper-plane" href="/docs/mintlify/social/publishing" />
</CardGroup>
