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
LogoLogo
CloudflareSocial Media PostingX

Refresh Token: https://api.x.com/2/oauth2/token

||View as Markdown|
POST
/2/oauth2/token
POST
/2/oauth2/token
$curl -X POST https://graph.facebook.com/2/oauth2/token \
> -H "Content-Type: application/x-www-form-urlencoded" \
> -d "grant_type=string" \
> -d "refresh_token=string"
200Social Media Posting_X_Refresh Token: https://api.x.com/2/oauth2/token_example
1{
2 "scope": "offline.access tweet.write media.write users.read tweet.read",
3 "expires_in": 7200,
4 "token_type": "bearer",
5 "access_token": "SGJYT3J6ME1CenlMLW1GSVNGblJjaFVyYUxVSGVUVl92ZWtPZ2xaX21jZjYwOjE3NzQxNDk1NTczODQ6MToxOmF0OjE",
6 "refresh_token": "dkFMTVlITVNlakNtYW41TW9ORFI0V1c2U0RyT2d6amlhVUdlSXV5NVBHZEFQOjE3NzQxNDk1NTczODQ6MTowOnJ0OjE"
7}
Was this page helpful?
Previous

Create Post: https://api.x.com/2/tweets

Next

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

Built with

Request

This endpoint expects an object.
grant_typestringRequired
refresh_tokenstringRequired
{refresh_token}

Response headers

perfstring
CF-RAYstring
pragmastring
expiresstring
x-served-bystring
Cache-Controlstring
last-modifiedstring
origin-cf-raystring
cf-cache-statusstring
x-frame-optionsstring
x-response-timestring
x-transaction-idstring
x-xss-protectionstring
content-dispositionstring
x-content-type-optionsstring
x-twitter-response-tagsstring
strict-transport-securitystring

Response

OK
scopestring
expires_ininteger
token_typestring
access_tokenstring
refresh_tokenstring

Create Post: https://api.x.com/2/tweets

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