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
| Type | Supported | Max media | Notes |
|---|---|---|---|
| Text only | ✅ | 0 | 280 characters (free) or 25,000 (Premium) |
| Photos | ✅ | 4 | JPEG, PNG, WebP. Max 5 MB each |
| Video | ✅ | 1 | MP4, MOV. Max 512 MB, 0.5–140 seconds |
| GIF | ✅ | 1 | Max 15 MB |
| Poll | ✅ | 0 | 2–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
| Field | Type | Description |
|---|---|---|
communityId | string (optional) | Post to a specific X Community. The authenticated user must be a member of the community. |
shareWithFollowers | boolean (optional) | When posting to a community, also share the post with your followers. Only applies when `communityId` is set. |
forSuperFollowersOnly | boolean (optional) | Make this post exclusive to your subscribers (super followers). |
replySettings | enum (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. |
quoteTweetId | string (optional) | ID of an existing tweet to quote. Mutually exclusive with poll and media. |
replyToTweetId | string (optional) | ID of an existing tweet to reply to. Your post will appear as a reply in that tweet's thread. |
poll | object (optional) | Create a poll. Mutually exclusive with media and `quoteTweetId`. |
Poll object
The poll field inside platformSpecificSettings accepts the following:
| Field | Type | Required | Description |
|---|---|---|---|
options | string[] | Yes | 2–4 poll choices. Each option max 25 characters. |
durationMinutes | number | Yes | How long the poll stays open. Min 5 minutes, max 10,080 (7 days). |
Media specs
Photos
| Spec | Value |
|---|---|
| Formats | JPEG, PNG, WebP |
| Max file size | 5 MB |
| Max per post | 4 (alone — no video or GIF) |
Videos
| Spec | Value |
|---|---|
| Formats | MP4, MOV |
| Max file size | 512 MB |
| Duration | 0.5–140 seconds |
| Max per post | 1 (alone — no photos or GIF) |
| Codec | H.264 High Profile recommended |
| Resolution | 1280x720 (landscape), 720x1280 (portrait), 720x720 (square) |
| Frame rate | 30 or 60 FPS |
| Aspect ratio | Between 1:3 and 3:1 |
GIFs
| Spec | Value |
|---|---|
| Max file size | 15 MB |
| Max per post | 1 (alone — no photos or video) |
| Max resolution | 1280x1080 |
| Max frames | 350 |
Not yet supported
- Threads — Posting a chain of replies as a thread (coming soon)
- Video subtitles
- Location / geo tagging