Twitter / X
Publishing to Twitter/X with Cue
Connect your Twitter/X account to schedule and publish tweets through Cue.
Overview
Twitter (also known as X) is a social media platform where you can post short messages called tweets. Cue integrates with the Twitter API v2 to publish content on your behalf.
Sign up for a Twitter account at twitter.com.
Authentication
Twitter uses OAuth 2.0 for secure authentication. You don't need to create API credentials - Cue handles this for you.
Connecting Your Account
- Go to Profiles in your Cue dashboard
- Click Connect Account on a profile
- Select Twitter / X
- You'll be redirected to Twitter to authorize access
- Sign in and grant Cue permission to post on your behalf
- You'll be redirected back to Cue automatically
Your credentials are never shared with Cue.
Permissions
Cue requests the following permissions:
tweet.read- Read your tweetstweet.write- Post tweets on your behalfusers.read- Read your profile informationoffline.access- Maintain access when you're not using Cue
Disconnecting
To disconnect your Twitter account, go to your profile and click Disconnect next to the Twitter connection. This revokes Cue's access to your account.
Content Limits
Twitter enforces the following limits on tweets:
| Limit | Value |
|---|---|
| Characters | 280 |
| Images | Up to 4 per tweet |
| Video length | 2 minutes 20 seconds |
| GIF | 1 per tweet |
| File size | 5 MB (images), 512 MB (videos) |
Cue automatically validates your content length before publishing to prevent errors.
Publishing a Tweet
curl -X POST https://api.oncue.so/v1/posts \
-H "Authorization: Bearer cue_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"profileId": "prf_abc123",
"platforms": {
"sac_twitter1": {
"items": [{ "content": "Hello from Cue!" }]
}
},
"publishNow": true
}'const response = await fetch("https://api.oncue.so/v1/posts", {
method: "POST",
headers: {
Authorization: "Bearer cue_sk_your_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
profileId: "prf_abc123",
platforms: {
sac_twitter1: {
items: [{ content: "Hello from Cue!" }]
}
},
publishNow: true,
}),
});Schedule for Later
curl -X POST https://api.oncue.so/v1/posts \
-H "Authorization: Bearer cue_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"profileId": "prf_abc123",
"platforms": {
"sac_twitter1": {
"items": [{ "content": "Scheduled tweet content" }]
}
},
"scheduledAt": "2024-01-20T09:00:00-05:00"
}'const response = await fetch("https://api.oncue.so/v1/posts", {
method: "POST",
headers: {
Authorization: "Bearer cue_sk_your_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
profileId: "prf_abc123",
platforms: {
sac_twitter1: {
items: [{ content: "Scheduled tweet content" }]
}
},
scheduledAt: "2024-01-20T09:00:00-05:00",
}),
});Creating Threads
Create multi-post threads by including multiple items in the items array. Each item becomes a connected tweet in the thread.
Threads require a Growth plan or above.
curl -X POST https://api.oncue.so/v1/posts \
-H "Authorization: Bearer cue_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"profileId": "prf_abc123",
"platforms": {
"sac_twitter1": {
"items": [
{ "content": "1/ Here'\''s a thread about building in public..." },
{ "content": "2/ First, we identified the problem we wanted to solve..." },
{ "content": "3/ Then we built a prototype and got early feedback..." },
{ "content": "4/ The results? 10x improvement in our workflow!" }
]
}
},
"publishNow": true
}'const response = await fetch("https://api.oncue.so/v1/posts", {
method: "POST",
headers: {
Authorization: "Bearer cue_sk_your_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
profileId: "prf_abc123",
platforms: {
sac_twitter1: {
items: [
{ content: "1/ Here's a thread about building in public..." },
{ content: "2/ First, we identified the problem we wanted to solve..." },
{ content: "3/ Then we built a prototype and got early feedback..." },
{ content: "4/ The results? 10x improvement in our workflow!" }
]
}
},
publishNow: true,
}),
});Each tweet in a thread must respect the 280 character limit.
Response
{
"data": {
"id": "pst_xyz789",
"profileId": "prf_abc123",
"content": "Hello from Cue!",
"status": "queued",
"scheduledAt": null,
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:00:00Z"
},
"message": "Post queued for publishing to 1 platform(s)"
}Error Handling
Twitter API errors are translated into user-friendly messages:
| Error Code | Meaning | Solution |
|---|---|---|
401 | Authentication failed | Reconnect your Twitter account |
403 | Account suspended or restricted | Check your Twitter account status |
429 | Rate limit exceeded | Wait and retry later |
400 | Content exceeds 280 characters | Shorten your content |
Common Issues
"Reconnect required" error
- Your access token has expired or been revoked
- Go to your profile and reconnect your Twitter account
"Rate limit exceeded" error
- You've hit Twitter's posting limits
- Free tier: 500 tweets/month
- Wait until your limit resets or upgrade your Twitter API plan
"Content too long" error
- Your tweet exceeds 280 characters
- Shorten your message or split it into multiple posts
"Account restricted" error
- Your Twitter account may be suspended or have posting restrictions
- Check your account status on twitter.com
Best Practices
Content Guidelines
- Keep tweets concise and engaging
- Use hashtags strategically (2-3 is optimal)
- Include media when possible to increase engagement
- Thread longer thoughts across multiple tweets
Timing
- Schedule tweets during peak engagement hours
- Twitter analytics shows when your audience is most active
- Space out tweets to avoid appearing spammy
Security
- Never share your OAuth tokens
- Revoke access from untrusted apps in Twitter settings
- Monitor your Twitter account for unauthorized posts
Troubleshooting
Connection Issues
Cannot redirect to Twitter during OAuth
- Check your internet connection
- Try using a different browser
- Disable browser extensions that might block redirects
OAuth returns error immediately
- Your Twitter account may be restricted
- Twitter's OAuth service may be experiencing issues
- Check status.twitterapi.com for outages
Publishing Issues
Tweets not appearing
- Check if your post is still in "queued" status
- Wait a few minutes - publishing may take time
- Check the post's platform status for error details
Duplicate tweet error
- Twitter prevents posting identical content too quickly
- Wait a few minutes or modify your content slightly
- Tweets must be unique within recent posts