X (Twitter) Chat API

The Chat API from X (Twitter) — 15 operation(s) for chat.

Operations 16

GET /2/chat/conversations X Get Chat Conversations #
POST /2/chat/conversations/group X Create Chat Group Conversation #
POST /2/chat/conversations/group/initialize X Initialize Chat Group #
GET /2/chat/conversations/{id} X Get Chat Conversation #
POST /2/chat/conversations/{id}/keys X Initialize Conversation Keys #
POST /2/chat/conversations/{id}/members X Add Members to a Chat Group Conversation #
POST /2/chat/conversations/{id}/messages X Send Chat Message #
POST /2/chat/conversations/{id}/read X Mark Conversation as Read #
POST /2/chat/conversations/{id}/typing X Send Typing Indicator #
POST /2/chat/media/upload/initialize X Initialize Chat Media Upload #
POST /2/chat/media/upload/{id}/append X Append Chat Media Upload #
POST /2/chat/media/upload/{id}/finalize X Finalize Chat Media Upload #
GET /2/chat/media/{id}/{media_hash_key} X Download Chat Media #
GET /2/users/public_keys X Get Public Keys for Multiple Users #
GET /2/users/{id}/public_keys X Get User Public Keys #
POST /2/users/{id}/public_keys X Add Public Key #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/twitter-chat-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

twitter-chat-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: X API v2 available endpoints
  version: '2.161'
  title: X API v2 Account Activity Chat API
  termsOfService: https://developer.x.com/en/developer-terms/agreement-and-policy.html
  contact:
    name: X Developers
    url: https://developer.x.com/
  license:
    name: X Developer Agreement and Policy
    url: https://developer.x.com/en/developer-terms/agreement-and-policy.html
servers:
- description: X API
  url: https://api.x.com
tags:
- name: Chat
paths:
  /2/chat/conversations:
    get:
      security:
      - OAuth2UserToken:
        - dm.read
        - users.read
      - UserToken: []
      tags:
      - Chat
      summary: X Get Chat Conversations
      description: Retrieves a list of Chat conversations for the authenticated user's inbox.
      externalDocs:
        url: https://developer.x.com/
      operationId: getChatConversations
      parameters:
      - name: max_results
        in: query
        description: Maximum number of conversations to return.
        required: false
        schema:
          type: integer
          minimum: 1
          maximum: 100
          format: int32
          default: 10
        style: form
        example: 10
      - name: pagination_token
        in: query
        description: Token for pagination to retrieve the next page of results.
        required: false
        schema:
          type: string
        style: form
        example: next_token_abc123
      - $ref: '#/components/parameters/ChatConversationFieldsParameter'
      - $ref: '#/components/parameters/ChatConversationExpansionsParameter'
      - $ref: '#/components/parameters/UserFieldsParameter'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatGetConversationsResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /2/chat/conversations/group:
    post:
      security:
      - OAuth2UserToken:
        - dm.write
        - tweet.read
        - users.read
      - UserToken: []
      tags:
      - Chat
      summary: X Create Chat Group Conversation
      description: Creates a new encrypted Chat group conversation on behalf of the authenticated user.
      externalDocs:
        url: https://developer.x.com/
      operationId: createChatConversation
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCreateConversationRequest'
        required: true
      responses:
        '201':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCreateConversationResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /2/chat/conversations/group/initialize:
    post:
      security:
      - OAuth2UserToken:
        - dm.write
      - UserToken: []
      tags:
      - Chat
      summary: X Initialize Chat Group
      description: "Initializes a new XChat group conversation and returns a unique conversation ID.\n\nThis endpoint is the first step in creating a group chat. The returned conversation_id \nshould be used in subsequent calls to POST /chat/conversations/group to fully create and \nconfigure the group with members, admins, encryption keys, and other settings.\n\n**Workflow:**\n1. Call this endpoint to get a `conversation_id`\n2. Use that `conversation_id` when calling `POST /chat/conversations/group` to create the group\n\n**Authentication:**\n- Requires OAuth 1.0a User Context or OAuth 2.0 User Context\n- Required scope: `dm.write`\n"
      externalDocs:
        url: https://developer.x.com/
      operationId: initializeChatGroup
      parameters: []
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatInitializeGroupResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /2/chat/conversations/{id}:
    get:
      security:
      - OAuth2UserToken:
        - dm.read
        - tweet.read
        - users.read
      - UserToken: []
      tags:
      - Chat
      summary: X Get Chat Conversation
      description: Retrieves messages and key change events for a specific Chat conversation with pagination support. For 1:1 conversations, provide the recipient's user ID; the server constructs the canonical conversation ID from the authenticated user and recipient.
      externalDocs:
        url: https://developer.x.com/
      operationId: getChatConversation
      parameters:
      - name: id
        in: path
        description: The recipient's user ID for a 1:1 conversation, or a group conversation ID (prefixed with 'g').
        required: true
        schema:
          $ref: '#/components/schemas/ChatConversationOrRecipientId'
        style: simple
        example: '1234567890'
      - name: max_results
        in: query
        description: Maximum number of message events to return.
        required: false
        schema:
          type: integer
          minimum: 1
          maximum: 100
          format: int32
          default: 10
        style: form
        example: 10
      - name: pagination_token
        in: query
        description: Token for pagination to retrieve the next page of results.
        required: false
        schema:
          type: string
        style: form
        example: next_token_abc123
      - $ref: '#/components/parameters/ChatMessageEventFieldsParameter'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatGetConversationResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /2/chat/conversations/{id}/keys:
    post:
      security:
      - OAuth2UserToken:
        - dm.write
        - tweet.read
        - users.read
      - UserToken: []
      tags:
      - Chat
      summary: X Initialize Conversation Keys
      description: 'Initializes encryption keys for a Chat conversation. This is the first step

        before sending messages in a new 1:1 conversation.


        For 1:1 conversations, provide the recipient''s user ID as the conversation_id.

        The server constructs the canonical conversation ID from the authenticated user

        and recipient.


        The request body must contain the conversation key version and participant keys

        (the conversation key encrypted for each participant using their public key).


        **Workflow (1:1 conversation):**

        1. Generate a conversation key using the SDK

        2. Encrypt the key for both participants using their public keys

        3. Call this endpoint to register the keys

        4. Send messages using `POST /chat/conversations/{id}/messages`


        **Authentication:**

        - Requires OAuth 1.0a User Context or OAuth 2.0 User Context

        - Required scopes: `tweet.read`, `users.read`, `dm.write`

        '
      externalDocs:
        url: https://developer.x.com/
      operationId: initializeChatConversationKeys
      parameters:
      - name: id
        in: path
        description: The recipient's user ID for a 1:1 conversation, or a group conversation ID (prefixed with 'g').
        required: true
        schema:
          $ref: '#/components/schemas/ChatConversationOrRecipientId'
        style: simple
        example: '1234567890'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatInitializeConversationKeysRequest'
        required: true
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatInitializeConversationKeysResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /2/chat/conversations/{id}/members:
    post:
      security:
      - OAuth2UserToken:
        - dm.write
        - tweet.read
        - users.read
      - UserToken: []
      tags:
      - Chat
      summary: X Add Members to a Chat Group Conversation
      description: Adds one or more members to an existing encrypted Chat group conversation, rotating the conversation key.
      externalDocs:
        url: https://developer.x.com/
      operationId: addChatGroupMembers
      parameters:
      - name: id
        in: path
        description: The Chat group conversation ID.
        required: true
        schema:
          $ref: '#/components/schemas/ChatConversationOrRecipientId'
        style: simple
        example: '1234567890'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatAddGroupMembersRequest'
        required: true
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatAddGroupMembersResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /2/chat/conversations/{id}/messages:
    post:
      security:
      - OAuth2UserToken:
        - dm.write
        - tweet.read
        - users.read
      - UserToken: []
      tags:
      - Chat
      summary: X Send Chat Message
      description: Sends an encrypted message to a specific Chat conversation. For 1:1 conversations, provide the recipient's user ID; the server constructs the canonical conversation ID from the authenticated user and recipient.
      externalDocs:
        url: https://developer.x.com/
      operationId: sendChatMessage
      parameters:
      - name: id
        in: path
        description: The recipient's user ID for a 1:1 conversation, or a group conversation ID (prefixed with 'g').
        required: true
        schema:
          $ref: '#/components/schemas/ChatConversationOrRecipientId'
        style: simple
        example: '1234567890'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatSendMessageRequest'
        required: true
      responses:
        '201':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSendMessageResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /2/chat/conversations/{id}/read:
    post:
      security:
      - OAuth2UserToken:
        - dm.write
        - tweet.read
        - users.read
      - UserToken: []
      tags:
      - Chat
      summary: X Mark Conversation as Read
      description: Marks a specific Chat conversation as read on behalf of the authenticated user. For 1:1 conversations, provide the recipient's user ID; the server constructs the canonical conversation ID from the authenticated user and recipient.
      externalDocs:
        url: https://developer.x.com/
      operationId: markChatConversationRead
      parameters:
      - name: id
        in: path
        description: The recipient's user ID for a 1:1 conversation, or a group conversation ID (prefixed with 'g').
        required: true
        schema:
          $ref: '#/components/schemas/ChatConversationOrRecipientId'
        style: simple
        example: '1234567890'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatMarkConversationReadRequest'
        required: true
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatMarkConversationReadResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /2/chat/conversations/{id}/typing:
    post:
      security:
      - OAuth2UserToken:
        - dm.write
        - tweet.read
        - users.read
      - UserToken: []
      tags:
      - Chat
      summary: X Send Typing Indicator
      description: Sends a typing indicator to a specific Chat conversation on behalf of the authenticated user. For 1:1 conversations, provide the recipient's user ID; the server constructs the canonical conversation ID from the authenticated user and recipient.
      externalDocs:
        url: https://developer.x.com/
      operationId: sendChatTypingIndicator
      parameters:
      - name: id
        in: path
        description: The recipient's user ID for a 1:1 conversation, or a group conversation ID (prefixed with 'g').
        required: true
        schema:
          $ref: '#/components/schemas/ChatConversationOrRecipientId'
        style: simple
        example: '1234567890'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSendTypingIndicatorResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /2/chat/media/upload/initialize:
    post:
      security:
      - OAuth2UserToken:
        - media.write
      - UserToken: []
      tags:
      - Chat
      summary: X Initialize Chat Media Upload
      description: Initializes an XChat media upload session.
      externalDocs:
        url: https://docs.x.com/x-api/media/media-upload
      operationId: chatMediaUploadInitialize
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatMediaUploadInitializeRequest'
        required: true
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatMediaUploadInitializeResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /2/chat/media/upload/{id}/append:
    post:
      security:
      - OAuth2UserToken:
        - media.write
      - UserToken: []
      tags:
      - Chat
      summary: X Append Chat Media Upload
      description: Appends media data to an XChat upload session.
      externalDocs:
        url: https://docs.x.com/x-api/media/media-upload
      operationId: chatMediaUploadAppend
      parameters:
      - name: id
        in: path
        description: The session/resume id from initialize.
        required: true
        schema:
          type: string
        style: simple
        example: '1234567890'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatMediaUploadAppendRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ChatMediaUploadAppendRequest'
        required: true
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaUploadAppendResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /2/chat/media/upload/{id}/finalize:
    post:
      security:
      - OAuth2UserToken:
        - media.write
      - UserToken: []
      tags:
      - Chat
      summary: X Finalize Chat Media Upload
      description: Finalizes an XChat media upload session.
      externalDocs:
        url: https://docs.x.com/x-api/media/media-upload
      operationId: chatMediaUploadFinalize
      parameters:
      - name: id
        in: path
        description: The session/resume id from initialize.
        required: true
        schema:
          type: string
        style: simple
        example: '1234567890'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatMediaUploadFinalizeRequest'
        required: true
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatMediaUploadFinalizeResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /2/chat/media/{id}/{media_hash_key}:
    get:
      security:
      - OAuth2UserToken:
        - media.write
      - UserToken: []
      tags:
      - Chat
      summary: X Download Chat Media
      description: Downloads encrypted media bytes from an XChat conversation. The response body contains raw binary bytes. For 1:1 conversations, provide the recipient's user ID; the server constructs the canonical conversation ID from the authenticated user and recipient.
      externalDocs:
        url: https://developer.x.com/
      operationId: chatMediaDownload
      parameters:
      - name: id
        in: path
        description: The recipient's user ID for a 1:1 conversation, or a group conversation ID (prefixed with 'g').
        required: true
        schema:
          $ref: '#/components/schemas/ChatConversationOrRecipientId'
        style: simple
        example: '1234567890'
      - name: media_hash_key
        in: path
        description: The media hash key returned from the upload initialize step.
        required: true
        schema:
          $ref: '#/components/schemas/MediaHashKey'
        style: simple
        example: example_value
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/octet-stream:
              schema:
                $ref: '#/components/schemas/BinaryPayload'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /2/users/public_keys:
    get:
      security:
      - OAuth2UserToken:
        - dm.read
        - tweet.read
        - users.read
      - UserToken: []
      tags:
      - Chat
      summary: X Get Public Keys for Multiple Users
      description: Returns the public keys and Juicebox configuration for the specified users.
      externalDocs:
        url: https://developer.x.com/
      operationId: getUsersPublicKeys
      parameters:
      - name: ids
        in: query
        description: A list of User IDs, comma-separated. You can specify up to 100 IDs.
        required: true
        example: 2244994945,6253282,12
        schema:
          type: array
          minItems: 1
          maxItems: 100
          items:
            $ref: '#/components/schemas/UserId'
        explode: false
        style: form
      - $ref: '#/components/parameters/PublicKeyFieldsParameter'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Get2UsersPublicKeysResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /2/users/{id}/public_keys:
    get:
      security:
      - OAuth2UserToken:
        - dm.read
        - tweet.read
        - users.read
      - UserToken: []
      tags:
      - Chat
      summary: X Get User Public Keys
      description: Returns the public keys and Juicebox configuration for the specified user.
      externalDocs:
        url: https://developer.x.com/
      operationId: getUsersPublicKey
      parameters:
      - name: id
        in: path
        description: The ID of the User to lookup.
        required: true
        example: '2244994945'
        schema:
          $ref: '#/components/schemas/UserId'
        style: simple
      - $ref: '#/components/parameters/PublicKeyFieldsParameter'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Get2UsersIdPublicKeysResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      security:
      - OAuth2UserToken:
        - dm.write
        - tweet.read
        - users.read
      - UserToken: []
      tags:
      - Chat
      summary: X Add Public Key
      description: Registers a user's public key for X Chat encryption.
      externalDocs:
        url: https://developer.x.com/
      operationId: addUserPublicKey
      parameters:
      - name: id
        in: path
        description: The ID of the requesting user.
        required: true
        schema:
          $ref: '#/components/schemas/UserId'
        style: simple
        example: '1234567890'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatAddPublicKeyRequest'
        required: true
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatAddPublicKeyResponse'
        default:
          description: The request has failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    ChatInitializeConversationKeysResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            sequence_id:
              type: string
              description: Sequence ID of the conversation key change event. Use this to track key changes in the conversation event stream.
        errors:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Problem'
          example: []
    CashtagFields:
      type: object
      description: Represent the portion of text recognized as a Cashtag, and its start and end position within the text.
      required:
      - tag
      properties:
        tag:
          type: string
          example: TWTR
    ChatMessageEventSignature:
      type: object
      description: Message event signature for verification.
      properties:
        message_signing_key_info_list:
          type: array
          description: List of signing key information for message verification.
          items:
            $ref: '#/components/schemas/ChatMessageSigningKeyInfo'
          example: []
        public_key_version:
          type: string
          description: The version of the public key used for signing.
          example: example_value
        signature:
          type: string
          description: The signature of the message event.
          example: example_value
        signature_version:
          type: string
          description: The version of the signature algorithm.
          example: example_value
        signing_public_key:
          type: string
          description: The public key used for signing.
          example: example_value
    NoteTweetText:
      type: string
      description: The note content of the Tweet.
      example: Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\u2026 https:\/\/t.co\/56a0vZUx7i
    ChatMessageSigningKeyInfo:
      type: object
      description: Signing key information for message verification.
      properties:
        member_id:
          type: string
          description: The member ID associated with this signing key.
          example: '1234567890'
        public_key_version:
          type: string
          description: The version of the public key.
          example: example_value
        signing_public_key:
          type: string
          description: The signing public key.
          example: example_value
    MediaPayloadBinary:
      type: string
      description: The file to upload.
      format: binary
    PlaceId:
      type: string
      description: The identifier for this place.
      example: f7eb2fa2fea288b1
    ChatMediaUploadInitializeResponse:
      type: object
      description: Response from initializing a Chat media upload.
      properties:
        data:
          type: object
          required:
          - session_id
          - media_hash_key
          - conversation_id
          properties:
            conversation_id:
              type: string
              description: Conversation id associated with the upload.
              example: 1603419216513746946:1603419216513746946
            media_hash_key:
              type: string
              description: Media hash key returned by XChat.
              example: rByqeHiVlD
            session_id:
              type: string
              description: Resume/session id for the upload.
              example: '735401'
    Poll:
      type: object
      description: Represent a Poll attached to a Tweet.
      required:
      - id
      - options
      properties:
        duration_minutes:
          type: integer
          minimum: 5
          maximum: 10080
          format: int32
        end_datetime:
          type: string
          format: date-time
        id:
          $ref: '#/components/schemas/PollId'
        options:
          type: array
          minItems: 2
          maxItems: 4
          items:
            $ref: '#/components/schemas/PollOption'
        voting_status:
          type: string
          enum:
          - open
          - closed
    ChatGetConversationsResponse:
      type: object
      properties:
        data:
          type: array
          description: List of conversations in the user's inbox.
          items:
            $ref: '#/components/schemas/ChatConversation'
          example: []
        errors:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Problem'
          example: []
        includes:
          $ref: '#/components/schemas/Expansions'
        meta:
          type: object
          properties:
            has_message_requests:
              type: boolean
              description: Whether the user has pending message requests.
            has_more:
              type: boolean
              description: Whether there are more conversations to fetch.
            next_token:
              type: string
              description: Token to retrieve the next page of results.
            result_count:
              type: integer
              description: The number of conversations returned.
    ChatSendMessageResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            encoded_message_event:
              type: string
              description: Base64-encoded response message event.
        errors:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Problem'
          example: []
    Media:
      type: object
      required:
      - type
      properties:
        height:
          $ref: '#/components/schemas/MediaHeight'
        media_key:
          $ref: '#/components/schemas/MediaKey'
        type:
          type: string
        width:
          $ref: '#/components/schemas/MediaWidth'
      discriminator:
        propertyName: type
        mapping:
          animated_gif: '#/components/schemas/AnimatedGif'
          photo: '#/components/schemas/Photo'
          video: '#/components/schemas/Video'
    DisplayTextRange:
      type: array
      description: Represent a boundary range (start and end zero-based indices) for the portion of text that is displayed for a post. `start` must be smaller than `end`. The start index is inclusive, the end index is exclusive.
      minItems: 2
      maxItems: 2
      items:
        type: integer
        minimum: 0
    ChatMessageEvent:
      type: object
      description: An Chat message event with extracted envelope fields and the original encoded 

# --- truncated at 32 KB (95 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/twitter/refs/heads/main/openapi/twitter-chat-api-openapi.yml