POST statuses/update

Updated on Mon, 2014-06-02 14:02

Updates the authenticating user's current status, also known as tweeting. To upload an image to accompany the tweet, use POST statuses/update_with_media.

For each update attempt, the update text is compared with the authenticating user's recent tweets. Any attempt that would result in duplication will be blocked, resulting in a 403 error. Therefore, a user cannot submit the same status twice in a row.

While not rate limited by the API a user is limited in the number of tweets they can create at a time. If the number of updates posted by the user reaches the current allowed limit this method will return an HTTP 403 error.

Resource URL

https://api.twitter.com/1.1/statuses/update.json

Parameters

status required

The text of your status update, typically up to 140 characters. URL encode as necessary. t.co link wrapping may effect character counts.

There are some special commands in this field to be aware of. For instance, preceding a message with "D " or "M " and following it with a screen name can create a direct message to that user if the relationship allows for it.

in_reply_to_status_id optional

The ID of an existing status that the update is in reply to.

Note:: This parameter will be ignored unless the author of the tweet this parameter references is mentioned within the status text. Therefore, you must include @username, where username is the author of the referenced tweet, within the update.

possibly_sensitive optional

If you upload Tweet media that might be considered sensitive content such as nudity, violence, or medical procedures, you should set this value to true. See Media setting and best practices for more context. Defaults to false.

Example Values: true

lat optional

The latitude of the location this tweet refers to. This parameter will be ignored unless it is inside the range -90.0 to +90.0 (North is positive) inclusive. It will also be ignored if there isn't a corresponding long parameter.

Example Values: 37.7821120598956

long optional

The longitude of the location this tweet refers to. The valid ranges for longitude is -180.0 to +180.0 (East is positive) inclusive. This parameter will be ignored if outside that range, if it is not a number, if geo_enabled is disabled, or if there not a corresponding lat parameter.

Example Values: -122.400612831116

place_id optional

A place in the world. These IDs can be retrieved from GET geo/reverse_geocode.

Example Values: df51dec6f4ee2b2c

display_coordinates optional

Whether or not to put a pin on the exact coordinates a tweet has been sent from.

Example Values: true

trim_user optional

When set to either true, t or 1, each tweet returned in a timeline will include a user object including only the status authors numerical ID. Omit this parameter to receive the complete user object.

Example Values: true

Extended description

About Geo

  • Any geo-tagging parameters in the update will be ignored if geo_enabled for the user is false (this is the default setting for all users unless the user has enabled geolocation in their settings)
  • The number of digits passed the decimal separator passed to lat, up to 8, will be tracked so that the lat is returned in a status object it will have the same number of digits after the decimal separator.
  • Please make sure to use to use a decimal point as the separator (and not the decimal comma) for the latitude and the longitude - usage of the decimal comma will cause the geo-tagged portion of the status update to be dropped.
  • For JSON, the response mostly uses conventions described in GeoJSON. Unfortunately, the geo object has coordinates that Twitter renderers are reversed from the GeoJSON specification (GeoJSON specifies a longitude then a latitude, whereas we are currently representing it as a latitude then a longitude. Our JSON renders as: "geo": { "type":"Point", "coordinates":[37.78217, -122.40062] }
  • The coordinates object is replacing the geo object (no deprecation date has been set for the geo object yet) -- the difference is that the coordinates object, in JSON, is now rendered correctly in GeoJSON.
  • If a place_id is passed into the status update, then that place will be attached to the status. If no place_id was explicitly provided, but latitude and longitude are, we attempt to implicitly provide a place by calling geo/reverse_geocode.
  • Users will have the ability, from their settings page, to remove all the geotags from all their tweets en masse. Currently we are not doing any automatic scrubbing nor providing a method to remove geotags from individual tweets.

Example Request

POST

https://api.twitter.com/1.1/statuses/update.json

POST Data

status=Maybe%20he%27ll%20finally%20find%20his%20keys.%20%23peterfalk

  1. {
  2.   "coordinates": null,
  3.   "favorited": false,
  4.   "created_at": "Wed Sep 05 00:37:15 +0000 2012",
  5.   "truncated": false,
  6.   "id_str": "243145735212777472",
  7.   "entities": {
  8.     "urls": [
  9.  
  10.     ],
  11.     "hashtags": [
  12.       {
  13.         "text": "peterfalk",
  14.         "indices": [
  15.           35,
  16.           45
  17.         ]
  18.       }
  19.     ],
  20.     "user_mentions": [
  21.  
  22.     ]
  23.   },
  24.   "in_reply_to_user_id_str": null,
  25.   "text": "Maybe he'll finally find his keys. #peterfalk",
  26.   "contributors": null,
  27.   "retweet_count": 0,
  28.   "id": 243145735212777472,
  29.   "in_reply_to_status_id_str": null,
  30.   "geo": null,
  31.   "retweeted": false,
  32.   "in_reply_to_user_id": null,
  33.   "place": null,
  34.   "user": {
  35.     "name": "Jason Costa",
  36.     "profile_sidebar_border_color": "86A4A6",
  37.     "profile_sidebar_fill_color": "A0C5C7",
  38.     "profile_background_tile": false,
  39.     "profile_image_url": "http://a0.twimg.com/profile_images/1751674923/new_york_beard_normal.jpg",
  40.     "created_at": "Wed May 28 00:20:15 +0000 2008",
  41.     "location": "",
  42.     "is_translator": true,
  43.     "follow_request_sent": false,
  44.     "id_str": "14927800",
  45.     "profile_link_color": "FF3300",
  46.     "entities": {
  47.       "url": {
  48.         "urls": [
  49.           {
  50.             "expanded_url": "http://www.jason-costa.blogspot.com/",
  51.             "url": "http://t.co/YCA3ZKY",
  52.             "indices": [
  53.               0,
  54.               19
  55.             ],
  56.             "display_url": "jason-costa.blogspot.com"
  57.           }
  58.         ]
  59.       },
  60.       "description": {
  61.         "urls": [
  62.  
  63.         ]
  64.       }
  65.     },
  66.     "default_profile": false,
  67.     "contributors_enabled": false,
  68.     "url": "http://t.co/YCA3ZKY",
  69.     "favourites_count": 883,
  70.     "utc_offset": -28800,
  71.     "id": 14927800,
  72.     "profile_image_url_https": "https://si0.twimg.com/profile_images/1751674923/new_york_beard_normal.jpg",
  73.     "profile_use_background_image": true,
  74.     "listed_count": 150,
  75.     "profile_text_color": "333333",
  76.     "protected": false,
  77.     "lang": "en",
  78.     "followers_count": 8760,
  79.     "time_zone": "Pacific Time (US & Canada)",
  80.     "profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme6/bg.gif",
  81.     "verified": false,
  82.     "profile_background_color": "709397",
  83.     "notifications": false,
  84.     "description": "Platform at Twitter",
  85.     "geo_enabled": true,
  86.     "statuses_count": 5532,
  87.     "default_profile_image": false,
  88.     "friends_count": 166,
  89.     "profile_background_image_url": "http://a0.twimg.com/images/themes/theme6/bg.gif",
  90.     "show_all_inline_media": true,
  91.     "screen_name": "jasoncosta",
  92.     "following": false
  93.   },
  94.   "source": "<a href=\"http://jason-costa.blogspot.com\" rel=\"nofollow\">My Shiny App</a>",
  95.   "in_reply_to_screen_name": null,
  96.   "in_reply_to_status_id": null
  97. }