createTweet abstract method

Future<TwitterResponse<TweetData, void>> createTweet({
  1. required String text,
  2. String? quoteTweetId,
  3. bool? forSuperFollowersOnly,
  4. ReplySetting? replySetting,
  5. String? directMessageDeepLink,
  6. TweetMediaParam? media,
  7. TweetGeoParam? geo,
  8. TweetPollParam? poll,
  9. TweetReplyParam? reply,
})

Creates a Tweet on behalf of an authenticated user.

Parameters

  • text: Text of the Tweet being created. This field is required if media.media_ids is not present.

  • quoteTweetId: Link to the Tweet being quoted.

  • forSuperFollowersOnly: Allows you to Tweet exclusively for Super Followers.

  • replySetting: Settings to indicate who can reply to the Tweet. Options include mentionedUsers and following. The default to everyone.

  • directMessageDeepLink: Tweets a link directly to a Direct Message conversation with an account.

  • media: The object that contains media information being attached to created Tweet. This is mutually exclusive from Quote Tweet ID and Poll.

  • geo: A JSON object that contains location information for a Tweet. You can only add a location to Tweets if you have geo enabled in your profile settings. If you don't have geo enabled, you can still add a location parameter in your request body, but it won't get attached to your Tweet

  • poll: The object that contains options for a Tweet with a poll. This is mutually exclusive from Media and Quote Tweet ID.

  • reply: The object that contains information of the Tweet being replied to.

Endpoint Url

Authentication Methods

  • OAuth 2.0 Authorization Code with PKCE
  • OAuth 1.0a

Required Scopes

  • tweet.read
  • tweet.write
  • users.read

Rate Limits

  • User rate limit (OAuth 2.0 user Access Token): 200 requests per 15-minute window per each authenticated user

Reference

Implementation

Future<TwitterResponse<TweetData, void>> createTweet({
  required String text,
  String? quoteTweetId,
  bool? forSuperFollowersOnly,
  ReplySetting? replySetting,
  String? directMessageDeepLink,
  TweetMediaParam? media,
  TweetGeoParam? geo,
  TweetPollParam? poll,
  TweetReplyParam? reply,
});