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

# X (Twitter)

> Connect your X (formerly Twitter) account to TryPost

# X (Twitter)

TryPost supports posting to X (formerly Twitter) accounts.

## Connect your account

1. Go to **Accounts** in the TryPost dashboard
2. Click **Connect X**
3. Authorize TryPost on X

## Supported content types

| Type | Description |
| - | - |
| **Post** | Text with up to 4 images or 1 video |

## Media limits

| `content_type` | Image | Video | Duration | Format |
| - | - | - | - | - |
| `x_post` | 5 MB | 1 GB (Cloud cap; X allows 8 GB) | 20 minutes | JPG/PNG/GIF/WebP; video H.264 (MP4 or MOV) |

These are Post (`tweet_video`) limits — 8 GB / 20 minutes by default, 16 GB / 125 minutes on X Premium — not DM or Ads (`amplify_video`) limits. Official specs: [Media best practices](https://docs.x.com/x-api/media/quickstart/best-practices). Full catalog: [Media](/knowledge-base/media).

## Links in posts

X charges much more to deliver a post that carries a link, and shows it to fewer people. To keep a post out of that bracket, TryPost publishes the X version of a post with its links written non-clickable: `https://www.example.com/pricing` goes out as `example(.)com/pricing`.

Only the X version changes. The same post published to your other networks keeps its links exactly as you typed them, and nothing in your draft is edited — the rewrite happens on the way out.

The editor previews the X post as it will be published and counts characters against that same text, so the limit reflects what X receives. A reader reaches the page by copying the address and putting the dots back — the trade for keeping the post's reach.

<Note>
  Self-hosting TryPost? Links go out untouched there by default, since you publish through your own X app and pay your own X bill — see [link defusing on X](/self-hosting/configuration#link-defusing-on-x).
</Note>

## OAuth scopes

`tweet.read`, `tweet.write`, `users.read`, `media.write`, `offline.access`

`offline.access` is required so TryPost can refresh the access token in the background — without it, you'd have to reauthorize regularly.

## Self-hosting setup

<Accordion title="Configure X API credentials">
  1. Go to [X Developer Portal](https://developer.twitter.com/) and create a project/app
  2. Enable **OAuth 2.0** in your app settings
  3. On the User authentication settings page, enable the scopes listed above
  4. Set the redirect URL to `{APP_URL}/accounts/x/callback`
  5. Add to your `.env`:

  ```env theme={null}
  X_CLIENT_ID=your_client_id
  X_CLIENT_SECRET=your_client_secret
  X_CLIENT_REDIRECT="${APP_URL}/accounts/x/callback"
  ```
</Accordion>


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