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

# Platforms

> Five platforms, one API — X, LinkedIn, Instagram, Threads, and YouTube with native OAuth, automatic token refresh, and per-platform content rules.

Connect X, LinkedIn, Instagram, Threads, and YouTube to any brand. Platform accounts are managed at the brand level — one brand can hold multiple accounts on the same platform.

## Platform Capabilities

| Platform    | Text         | Images        | Video    | GIF | Threads | Character Limit   |
| ----------- | ------------ | ------------- | -------- | --- | ------- | ----------------- |
| X (Twitter) | Yes          | Up to 4       | Yes      | Yes | Yes     | 280 (25K Premium) |
| LinkedIn    | Yes          | Up to 20      | No       | No  | No      | 3,000 / 700 org   |
| Instagram   | Yes          | Carousel (10) | Reels    | No  | No      | 2,200             |
| Threads     | Yes          | Up to 10      | No       | No  | No      | 500               |
| YouTube     | Title + desc | No            | Required | No  | No      | 5,000 desc        |

<Info>
  LinkedIn uses separate OAuth credentials for **personal profiles** vs **company pages**. Both can be connected to the same brand simultaneously.
</Info>

## Connect a Platform Account

<Steps>
  <Step title="Initiate OAuth">
    Click a platform tile in **Brand Settings → Connected Accounts**. Autoposting generates a PKCE code verifier and redirects to the platform's authorization page.
  </Step>

  <Step title="Grant permissions">
    Approve the requested scopes on the platform's login page. You are redirected back to Autoposting with an authorization code.
  </Step>

  <Step title="Token stored securely">
    Autoposting exchanges the code for access and refresh tokens, fetches your profile info, and encrypts all credentials at rest. Tokens are never stored in plaintext.
  </Step>
</Steps>

<Warning>
  Instagram requires a **Business or Creator account** linked to a Facebook Page. Personal Instagram accounts cannot be connected.
</Warning>

## Token Refresh

Tokens are refreshed automatically 10 minutes before expiry — no manual action needed.

| Platform  | Refresh Method                         |
| --------- | -------------------------------------- |
| X         | `refresh_token` via client credentials |
| LinkedIn  | `refresh_token` via client credentials |
| YouTube   | `refresh_token` via client credentials |
| Instagram | Long-lived token exchange              |
| Threads   | Long-lived token exchange              |

<Warning>
  When a refresh fails (revoked access, password change), connected posts fail at `validating`. Reconnect the account from **Brand Settings → Connected Accounts** to clear the error.
</Warning>

## Error Types

| Error                    | Cause                           | Resolution                                                |
| ------------------------ | ------------------------------- | --------------------------------------------------------- |
| `PlatformAuthError`      | Token expired or revoked        | Reconnect account; Autoposting auto-retries after refresh |
| `PlatformRateLimitError` | HTTP 429 from platform          | Auto-retried after `retryAfter` delay — no action needed  |
| `PlatformContentError`   | Content violates platform rules | Edit post content and retry                               |
| `PlatformMediaError`     | Invalid media format or size    | Re-upload compliant media                                 |

## Platform-Specific Notes

**X** — Supports threads, polls (2–4 options, 5–10080 minute duration), and auto-repost scheduling. X Premium accounts get 25K character limit and extended media.

**LinkedIn** — Separate OAuth apps for personal profiles (`personal`) and organization pages (`organization`). No programmatic repost via API.

**Instagram** — Feed posts (single image or 10-image carousel) and Reels (video with optional thumbnail, cover, and up to 3 collaborators). No Stories or DMs via API.

**Threads** — Up to 10 images per post. Control reply access with `replyControl`: `everyone`, `accounts_you_follow`, or `mentioned_only`.

**YouTube** — Every post requires exactly one video. Metadata: `title` (required), `description`, `tags`, `privacyStatus`, `madeForKids`, `categoryId`.

<CardGroup cols={2}>
  <Card title="Brands" icon="building" href="/concepts/brands">
    Platform accounts are connected and managed at the brand level.
  </Card>

  <Card title="Posts" icon="paper-plane" href="/concepts/posts">
    Per-platform options, media rules, and multi-platform fan-out.
  </Card>

  <Card title="Clips" icon="scissors" href="/concepts/clips">
    Publish video clips to YouTube, Instagram Reels, and more.
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/overview">
    OAuth initiation, token management, and platform endpoints.
  </Card>
</CardGroup>
