POST account/update_profile_banner

Updated on Tue, 2012-10-02 12:24

Uploads a profile banner on behalf of the authenticating user. For best results, upload an <5MB image that is exactly 1252px by 626px. Images will be resized for a number of display options. Users with an uploaded profile banner will have a profile_banner_url node in their Users objects. More information about sizing variations can be found in User Profile Images and Banners.

Profile banner images are processed asynchronously. The profile_banner_url and its variant sizes will not necessary be available directly after upload.

This method does not yet have a v1.1 equivalent, but will soon.

Resource URL

https://api.twitter.com/1/account/update_profile_banner.json

Parameters

banner required

The Base64-encoded or raw image data being uploaded as the user's new profile banner.

width optional

The width of the preferred section of the image being uploaded in pixels. Use with height, offset_left, and offset_top to select the desired region of the image to use.

height optional

The height of the preferred section of the image being uploaded in pixels. Use with width, offset_left, and offset_top to select the desired region of the image to use.

offset_left optional

The number of pixels by which to offset the uploaded image from the left. Use with height, width, and offset_top to select the desired region of the image to use.

offset_top optional

The number of pixels by which to offset the uploaded image from the top. Use with height, width, and offset_left to select the desired region of the image to use.

Note: If providing any one of the height, width, offset_left, or offset_top parameters, you must provide all of the sizing parameters.

Extended description

HTTP Response Codes

Code(s)Meaning
200, 201, 202Profile banner image succesfully uploaded
400Either an image was not provided or the image data could not be processed
422The image could not be resized or is too large.

Example Request

POST

https://api.twitter.com/1/account/update_profile_banner.json

POST Data

width=1040&height=520&offset_top=0&offset_left=0&banner=FILE_DATA