PublishQPublishQ

X (Twitter)

Post text, images, videos, GIFs, and polls to X (Twitter) through the PublishQ API with reply controls, community posting, and quote tweets.

What you can post

TypeSupportedMax mediaNotes
Text only0280 characters (free) or 25,000 (Premium)
Photos4JPEG, PNG, WebP. Max 5 MB each
Video1MP4, MOV. Max 512 MB, 0.5–140 seconds
GIF1Max 15 MB
Poll02–4 options, 5 min to 7 days. No media allowed with polls

Limitations

  • Media types are exclusive. A post can have up to 4 photos OR 1 video OR 1 GIF — you cannot mix them.
  • Polls are exclusive. A post with a poll cannot have media or a quote tweet.
  • Quote tweets are exclusive. A post with a quote tweet cannot have media or a poll.
  • Character counting uses weighted rules. Emojis and CJK characters count as 2. URLs always count as 23 characters regardless of length.
  • Rate limit: 200 posts per 15 minutes, 300 per 3 hours (shared with retweets).

Posting to X alongside other platforms

X has a 280-character limit (25,000 for Premium), but platforms like Facebook or LinkedIn allow much longer content. Use postOverrides on the X account entry to provide shorter content just for X while keeping the full text for other platforms.

{
  "content": "Your long-form content for Facebook, LinkedIn, etc...",
  "accounts": [
    { "accountId": "facebook-account-id" },
    { "accountId": "linkedin-account-id" },
    {
      "accountId": "twitter-account-id",
      "postOverrides": {
        "content": "Short version for X 🐦"
      }
    }
  ],
  "publishNow": true
}

Quick start

Post text

curl -X POST https://publishq.com/api/v1/posts \
  -H "Authorization: Bearer pq_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Hello from the PublishQ API! 🚀",
    "accounts": [
      { "accountId": "your-twitter-account-id" }
    ],
    "publishNow": true
  }'

Post with photos, video, or GIF

Up to 4 photos, 1 video, or 1 GIF per post. These are mutually exclusive — you cannot mix them.

Get your media ready

curl -X POST https://publishq.com/api/v1/media \
  -H "Authorization: Bearer pq_live_..." \
  -F "[email protected]"
curl https://publishq.com/api/v1/media \
  -H "Authorization: Bearer pq_live_..."

Pick the id of the media you want to use.

Create the post

curl -X POST https://publishq.com/api/v1/posts \
  -H "Authorization: Bearer pq_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Photo dump 📸",
    "mediaIds": ["media-id-1", "media-id-2"],
    "accounts": [
      { "accountId": "your-twitter-account-id" }
    ],
    "publishNow": true
  }'

Post with a poll

Polls cannot have media or a quote tweet attached.

curl -X POST https://publishq.com/api/v1/posts \
  -H "Authorization: Bearer pq_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "content": "What should we build next?",
    "accounts": [
      {
        "accountId": "your-twitter-account-id",
        "platformSpecificSettings": {
          "poll": {
            "options": ["Feature A", "Feature B", "Feature C"],
            "durationMinutes": 1440
          }
        }
      }
    ],
    "publishNow": true
  }'

Reply to a tweet

curl -X POST https://publishq.com/api/v1/posts \
  -H "Authorization: Bearer pq_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Great point! Here are my thoughts...",
    "accounts": [
      {
        "accountId": "your-twitter-account-id",
        "platformSpecificSettings": {
          "replyToTweetId": "1346889436626259968"
        }
      }
    ],
    "publishNow": true
  }'

Quote a tweet

Quote tweets cannot have media or a poll.

curl -X POST https://publishq.com/api/v1/posts \
  -H "Authorization: Bearer pq_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "content": "This is worth reading 👇",
    "accounts": [
      {
        "accountId": "your-twitter-account-id",
        "platformSpecificSettings": {
          "quoteTweetId": "1346889436626259968"
        }
      }
    ],
    "publishNow": true
  }'

Post to a community

curl -X POST https://publishq.com/api/v1/posts \
  -H "Authorization: Bearer pq_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Discussion topic for the community",
    "accounts": [
      {
        "accountId": "your-twitter-account-id",
        "platformSpecificSettings": {
          "communityId": "1146654567674912769",
          "shareWithFollowers": true
        }
      }
    ],
    "publishNow": true
  }'

Platform settings

FieldTypeDescription
communityIdstring (optional)Post to a specific X Community. The authenticated user must be a member of the community.
shareWithFollowersboolean (optional)When posting to a community, also share the post with your followers. Only applies when `communityId` is set.
forSuperFollowersOnlyboolean (optional)Make this post exclusive to your subscribers (super followers).
replySettingsenum (optional)Control who can reply. `following`: only people you follow. `mentionedUsers`: only people mentioned in the post. `subscribers`: only your subscribers. `verified`: only verified users.
quoteTweetIdstring (optional)ID of an existing tweet to quote. Mutually exclusive with poll and media.
replyToTweetIdstring (optional)ID of an existing tweet to reply to. Your post will appear as a reply in that tweet's thread.
pollobject (optional)Create a poll. Mutually exclusive with media and `quoteTweetId`.

Poll object

The poll field inside platformSpecificSettings accepts the following:

FieldTypeRequiredDescription
optionsstring[]Yes2–4 poll choices. Each option max 25 characters.
durationMinutesnumberYesHow long the poll stays open. Min 5 minutes, max 10,080 (7 days).
Full schema: TwitterPlatformSpecificSettings

Media specs

Photos

SpecValue
FormatsJPEG, PNG, WebP
Max file size5 MB
Max per post4 (alone — no video or GIF)

Videos

SpecValue
FormatsMP4, MOV
Max file size512 MB
Duration0.5–140 seconds
Max per post1 (alone — no photos or GIF)
CodecH.264 High Profile recommended
Resolution1280x720 (landscape), 720x1280 (portrait), 720x720 (square)
Frame rate30 or 60 FPS
Aspect ratioBetween 1:3 and 3:1

GIFs

SpecValue
Max file size15 MB
Max per post1 (alone — no photos or video)
Max resolution1280x1080
Max frames350

Not yet supported

  • Threads — Posting a chain of replies as a thread (coming soon)
  • Video subtitles
  • Location / geo tagging

On this page