Write Actions

Upload Media

Upload a base64-encoded image as the authenticated account and receive a media_id you can attach when creating a tweet. Runs as your own logged-in account. Billed at $0.0008 per call. Cost: $0.0008 per call.

post/media/upload

Request

  • Base URL: https://api.twitterapis.com/twitter
  • URL: https://api.twitterapis.com/twitter/media/upload
  • Auth: HTTP bearer

Request body

media_datastring required

Base64-encoded image bytes, sent in the JSON request body.

Example request

{
  "media_data": "iVBORw0KGgoAAAANSUhEUgAA..."
}

Response

Upload an image and get a media_id to attach to a tweet.

okboolean

True when the upload succeeded (media_id is present).

media_idstring

The uploaded media's ID; pass it to tweet/create to attach the image.

Changes

No recorded changes to this operation across all 1 revision of this API.