Options for posting using the X API
isVideo
parameter. See the /post endpoint for details.post: ""
.twitterOptions
parameter.
allowCountries
. See Geo Restrictions for more information.blockCountries
. See Geo Restrictions for more information.duration
(number in minutes), options
(array of strings).See Polls for more information.following
, mentioned
, subscribers
, or verified
.See Reply Settings for more information..srt
.See Subtitles / Captions for Videos for more information.thread: true
.null
to skip media for a specific thread. Use objects with multiple URLs for multiple media per thread.altText
in the twitterOptions
object.
mediaUrls
array. The alt text will be applied to each image in order.
mediaUrls
with altText
,
the video will not be posted. Alt text must be 1,000 characters or less.blockCountries
and allowCountries
parameters with country codes.
The post will still show in all countries, but the media will not be available in the countries specified.
blockCountries
: An array of country codes to block. See country codes.allowCountries
: An array of country codes to allow. See country codes.blockCountries
or allowCountries
at a time.
If both parameters are used or a country is not supported by X, the geo restrictions will be ignored.
longPost
body parameter. This can be done by including the following JSON in your request:
code: 111
error.
longVideo
parameter. If your user’s X account is not authorized to post long
videos, the system will return an error.longVideo
twitterOptions parameter when posting a long video:
@handle
in the post text. For example:
twitterOptions
poll
parameter.
duration
: A number of minutes specifying the duration the poll will be conducted.options
: An array of strings of the poll options./post
response in the postIds
field, get history, or directly from the Tweet URL: https://twitter.com/Ayrshare/status/1651601430669664256
replySettings
parameter can be one of the following values:
following
: Only users who the X account is following can reply.mentioned
: Only users who are mentioned in the post can reply.subscribers
: Only users who are subscribers to the X account who posted the post can reply.verified
: Only users who are verified on X can reply to the post.subscribersOnly
parameter.
subTitleUrl
field in the twitterOptions
object to specify the URL to your SRT file.
subTitleUrl
: A valid SRT file. The URL must start with https://
and end in .srt
and be a
valid SRT file.subTitleLanguage
: Optional: The language of the subtitles. Must be a valid language
code. Default: “en”.subTitleName
: Optional: The name of the caption track. The name is intended to be visible to
the user as an option during playback. The maximum name length supported is 150 characters.
Default: “English”.thread: true
to automatically break apart the post text into threads based on line breaks.threadNumber: true
to automatically add numbers at the end of threads in the format of 1/n.
For example the 2nd of 5 threads will have appended: 2/5mediaUrls: [array of urls]
to add each media object, an image or video, to a thread in order.
Only one media object will be added to a thread in order."twitter": []
. See Post Analytics 200 Response for more information.
null
in the array. For example:
["https://site.com/image1.png", null, "https://site.com/image2.png"]
This will place image1 on the first Tweet, no image on the second Tweet, and image2 on the third Tweet.
{}
with the media URLs in the mediaUrls
array. Any unique object keys can be used. For example:
\n\n
to the post text to indicate a unique thread should be created.
If you have \n\n
in the post text, we will not automatically break the post into threads.
For example:
\u2063\n\u2063\n
"file is currently unsupported"
Please check your video software for compatibility. For example, Adobe Media Encoder has an export preset for Twitter 1080p Full HD.
subscribersOnly
parameter.
replySettings
parameter can be one of the following values:
following
: Only users who the X account is following can reply.mentioned
: Only users who are mentioned in the post can reply.subscribers
: Only users who are subscribers to the X account who posted the post can reply.verified
: Only users who are verified on X can reply to the post.