Postpone Logo
Platforms

X/Twitter

Schedule tweets and threads with media attachments

Mutation

Use the scheduleTweet mutation to schedule tweets to X/Twitter:

Mutation
mutation ScheduleTweet($input: ScheduleTweetInput!) {
  scheduleTweet(input: $input) {
    success
    errors {
      field
      message
    }
    post {
      id
      socialAccount {
        id
        username
      }
      publishingStatus
      submissions {
        id
        text
        order
        postAt
        gallery {
          id
          galleryMediaSet {
            id
            media {
              id
              url
              mimeType
            }
          }
        }
      }
    }
  }
}

Input Parameters

ScheduleTweetInput

username
String! required
The username of the connected X/Twitter account to post from
postAt
DateTime! required
When to publish the tweet (must be in the future)
thread
[TweetInputType!]! required
Array of tweets that make up the thread (minimum 1 tweet)
forSuperFollowersOnly
Boolean
Whether the tweet should only be visible to Super Followers (default: false)
replySettings
TwitterReplySettingsType
Who can reply to the tweet. Options: EVERYONE, FOLLOWING, MENTIONED
publishingStatus
PublishingStatusType
Publishing status. Options: READY_TO_PUBLISH, DRAFT (default: READY_TO_PUBLISH)
postTags
[ID!]
Array of post tag IDs to organize your content
communityId
ID
The ID of the X/Twitter community to post in (optional)
id
ID
ID of existing post when updating (only for updates)

TweetInputType

Each tweet in the thread supports these parameters:

text
String! required
The tweet text content (max 280 characters, 25,000 for verified accounts)
order
Int! required
Position of this tweet in the thread (0-based)
gallery
GalleryInput
Media attachments (images, videos, GIFs)
poll
PollInputType
Poll configuration (cannot be combined with media)
gifUrl
String
URL of a GIF to attach (cannot be combined with gallery or poll)
mediaName
String
Name of a file from your Content Library (case-insensitive)
mediaUrl
String
URL of media to upload and attach to the tweet
repostAtAmount
Int
Number of time units before auto-retweeting
repostAtUnit
String
Time unit for auto-retweet. Options: hour, day
repostRepeatDays
Int
How many days to repeat the auto-retweet (max 365)
repostFromSocialAccount
SocialAccountInputType
Account to retweet from (must be connected to your Postpone account)
removeAtAmount
Int
Number of time units before auto-deleting the tweet
removeAtUnit
String
Time unit for auto-deletion. Options: hour, day
removeMinLikes
Int
Minimum likes required to prevent auto-deletion
final
Boolean
Whether this is the final tweet in the thread (default: false)
contentWarningNudity
Boolean
Mark content as containing nudity (default: false)
contentWarningViolence
Boolean
Mark content as containing violence (default: false)
contentWarningSensitive
Boolean
Mark content as sensitive (default: false)
id
ID
ID of existing tweet when updating (only for updates)

Examples

Simple Tweet

Schedule a basic tweet with text only.

{
  "input": {
    "username": "myhandle",
    "postAt": "2025-12-01T15:30:00Z",
    "thread": [
      {
        "text": "Hello world! This is my first scheduled tweet 🚀",
        "order": 0
      }
    ]
  }
}

Tweet with Media URL

Schedule a tweet by uploading media from an external URL. Use this when you have a direct link to an image, video, or GIF that you want to attach. The media will be automatically downloaded and added to your Content Library.

{
  "input": {
    "username": "myhandle",
    "postAt": "2025-12-01T15:30:00Z",
    "thread": [
      {
        "text": "Check out this amazing sunset! 🌅",
        "order": 0,
        "mediaUrl": "https://picsum.photos/seed/socialmedia/900/1600"
      }
    ]
  }
}

Tweet with Content Library Media

Schedule a tweet using media already in your Content Library. Use this when you want to reuse media you've previously uploaded. The search is case-insensitive and will use the first matching file based on its name.

{
  "input": {
    "username": "myhandle",
    "postAt": "2025-12-01T15:30:00Z",
    "thread": [
      {
        "text": "Sharing our company logo! 🏢",
        "order": 0,
        "mediaName": "company-logo.png"
      }
    ]
  }
}

Thread with Multiple Tweets

Schedule a multi-tweet thread.

{
  "input": {
    "username": "myhandle",
    "postAt": "2025-12-01T15:30:00Z",
    "replySettings": "FOLLOWING",
    "thread": [
      {
        "text": "🧵 Thread about building great APIs (1/3)",
        "order": 0
      },
      {
        "text": "First, always design your API with the developer experience in mind. Clear documentation and consistent patterns make all the difference.",
        "order": 1
      },
      {
        "text": "Second, implement proper error handling and rate limiting. Your API consumers will thank you when things go wrong (and they will).",
        "order": 2,
        "final": true
      }
    ]
  }
}

Tweet with Poll

Schedule a tweet with an interactive poll.

{
  "input": {
    "username": "myhandle",
    "postAt": "2025-12-01T15:30:00Z",
    "thread": [
      {
        "text": "What's your favorite programming language? 💻",
        "order": 0,
        "poll": {
          "choices": ["JavaScript", "Python", "Go", "Rust"],
          "durationMinutes": 1440
        }
      }
    ]
  }
}

Auto-Retweet Configuration

Schedule a tweet with automatic retweeting.

{
  "input": {
    "username": "myhandle",
    "postAt": "2025-12-01T15:30:00Z",
    "thread": [
      {
        "text": "Don't miss our latest blog post about API best practices! 📖",
        "order": 0,
        "repostAtAmount": 2,
        "repostAtUnit": "hour",
        "repostRepeatDays": 3,
        "repostFromSocialAccount": {
          "username": "mycompany"
        }
      }
    ]
  }
}

Community Post

Schedule a tweet to a specific X/Twitter community.

{
  "input": {
    "username": "myhandle",
    "postAt": "2025-12-01T15:30:00Z",
    "communityId": "1234567890",
    "thread": [
      {
        "text": "Excited to share this with the developer community! 🎉",
        "order": 0
      }
    ]
  }
}

Response Types

Success Response

{
  "data": {
    "scheduleTweet": {
      "success": true,
      "errors": [],
      "post": {
        "id": "123",
        "socialAccount": {
          "id": "456",
          "username": "myhandle"
        },
        "publishingStatus": "READY_TO_PUBLISH",
        "submissions": [
          {
            "id": "789",
            "text": "Hello world! This is my first scheduled tweet 🚀",
            "order": 0,
            "postAt": "2025-12-01T15:30:00Z",
            "gallery": null,
            "poll": null
          }
        ]
      }
    }
  }
}

Error Response

{
  "data": {
    "scheduleTweet": {
      "success": false,
      "errors": [
        {
          "field": "text",
          "message": "You cannot schedule a Tweet longer than 280 characters."
        }
      ],
      "post": null
    }
  }
}

Updating a Post

To update an existing scheduled post, use the same input type with the corresponding update mutation and include the post id:

Mutation
mutation UpdateScheduledTweet($input: ScheduleTweetInput!) {
  updateScheduledTweet(input: $input) {
    success
    errors {
      field
      message
    }
    post {
      id
    }
  }
}

Pass the id of the post you want to update in the input, along with the fields you want to change:

{
  "input": {
    "id": "12345",
    "username": "myhandle",
    "thread": [{"text": "Updated tweet text!", "order": 0}]
  }
}
The update mutation uses the same input type as the create mutation. Include the id field to specify which post to update. Only scheduled posts that have not been published yet can be updated.

Validation Rules

The API enforces X/Twitter's content policies and technical limitations:
  • Text Length: 280 characters for regular accounts, 25,000 for verified accounts
  • Media: Maximum 4 images/videos per tweet, GIFs limited to 15MB
  • Video: Maximum 512MB file size, up to 2 minutes 20 seconds for regular accounts, up to 10 minutes for accounts with long video feature
  • Polls: 2-4 options, each max 25 characters, duration 5 minutes to 7 days. Cannot be combined with media attachments.
  • Threads: No hard limit on thread length
  • Scheduling: Posts must be scheduled for future dates only
  • Account Limits: Respects your plan's monthly tweet limits

Common Errors