For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Cloudflare
    • GETpayload example
    • POSThttps://social-media-posting-dev.deao.workers.dev/post
        • POSTCreate Post: https://api.x.com/2/tweets
        • POSTRefresh Token: https://api.x.com/2/oauth2/token
          • GET4. Get Media upload status: https://api.x.com/2/media/upload?media_id={video_id}
          • POST1. Initialize media upload: https://api.x.com/2/media/upload/initialize
          • POST2. Append Media upload: https://api.x.com/2/media/upload/{video_id}/append
          • POST3. Finalize Media upload: https://api.x.com/2/media/upload/{video_id}/finalize
LogoLogo
CloudflareSocial Media PostingXUpload Video

  1. Initialize media upload: https://api.x.com/2/media/upload/initialize

||View as Markdown|
POST
/2/media/upload/initialize
POST
/2/media/upload/initialize
$curl -X POST https://graph.facebook.com/2/media/upload/initialize \
> -H "Content-Type: application/json" \
> -d '{
> "media_type": "video/mp4",
> "total_bytes": 62515965,
> "media_category": "tweet_video"
>}'
200Social Media Posting_X_Upload Video_1. Initialize media upload: https://api.x.com/2/media/upload/initialize_example
1{
2 "data": {
3 "id": "2035543363835793408",
4 "media_key": "7_2035543363835793408",
5 "expires_after_secs": 86400
6 }
7}
Was this page helpful?
Previous

4. Get Media upload status: https://api.x.com/2/media/upload?media_id={video_id}

Next

2. Append Media upload: https://api.x.com/2/media/upload/{video_id}/append

Built with

Request

This endpoint expects an object.
media_typestringRequired
total_bytesintegerRequired
media_categorystringRequired

Response headers

perfstring
CF-RAYstring
api-versionstring
x-served-bystring
Cache-Controlstring
origin-cf-raystring
x-access-levelstring
cf-cache-statusstring
x-frame-optionsstring
x-response-timestring
x-transaction-idstring
x-xss-protectionstring
x-rate-limit-limitstring
x-rate-limit-resetstring
content-dispositionstring
x-content-type-optionsstring
x-rate-limit-remainingstring
strict-transport-securitystring

Response

OK
dataobject
  1. Get Media upload status: https://api.x.com/2/media/upload?media_id={video_id}
  1. Append Media upload: https://api.x.com/2/media/upload/{video_id}/append