Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent
with a free APIs.io key —
sign in with
GitHub,
Google or
LinkedIn.
No form to fill in; signing in shares your email address with us (Privacy).
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
# generated: '2026-11-28'
# method: generated -- from the vendor's own documentation, endpoints only as documented (never-fabricate bar)
# source: https://docs.x.com/resources/fundamentals/authentication/api-reference
openapi: 3.1.0
info:
title: X OAuth 1.0a API
description: 'The three-legged OAuth 1.0a flow for acting on behalf of an X user: obtain a request token, send the user
to authorize, and exchange the verifier for an access token. Documented at https://docs.x.com/resources/fundamentals/authentication/api-reference
.'
version: '1.0'
x-generated-from: https://docs.x.com/resources/fundamentals/authentication/api-reference
x-generated-by: stacks-gap-pass-2026-11-28
servers:
- url: https://api.x.com
tags:
- name: OAuth 1.0a
paths:
/oauth/request_token:
post:
operationId: oauthRequestToken
summary: Obtain a request token
tags:
- OAuth 1.0a
parameters:
- name: oauth_callback
in: query
required: true
description: The URL the user is redirected to after authorizing, or oob for PIN-based flow.
schema:
type: string
- name: x_auth_access_type
in: query
required: false
description: 'Overrides the access level the app requests: read or write.'
schema:
type: string
responses:
'200':
description: oauth_token, oauth_token_secret and oauth_callback_confirmed, form-encoded.
/oauth/authorize:
get:
operationId: oauthAuthorize
summary: Ask the user to authorize the app
tags:
- OAuth 1.0a
parameters:
- name: oauth_token
in: query
required: true
description: The request token obtained from POST oauth/request_token.
schema:
type: string
- name: force_login
in: query
required: false
description: Forces the user to enter their credentials.
schema:
type: string
- name: screen_name
in: query
required: false
description: Prefills the username input box.
schema:
type: string
responses: &id001
'302':
description: Redirects the user to the provider sign-in and authorization page.
/oauth/authenticate:
get:
operationId: oauthAuthenticate
summary: Sign in with X
tags:
- OAuth 1.0a
parameters:
- name: oauth_token
in: query
required: true
description: The request token obtained from POST oauth/request_token.
schema:
type: string
- name: force_login
in: query
required: false
description: Forces the user to enter their credentials.
schema:
type: string
- name: screen_name
in: query
required: false
description: Prefills the username input box.
schema:
type: string
responses: *id001
/oauth/access_token:
post:
operationId: oauthAccessToken
summary: Exchange the verifier for an access token
tags:
- OAuth 1.0a
parameters:
- name: oauth_token
in: query
required: true
description: The request token returned with the callback.
schema:
type: string
- name: oauth_verifier
in: query
required: true
description: The verifier returned with the callback.
schema:
type: string
responses:
'200':
description: oauth_token, oauth_token_secret, user_id and screen_name, form-encoded.
components:
securitySchemes:
oauth1:
type: apiKey
in: header
name: Authorization
description: OAuth 1.0a signed Authorization header.