> ## Documentation Index
> Fetch the complete documentation index at: https://docs.posttu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List X conversation messages

> Lists messages in a direct-message conversation, paginated via Posttu's Twitter REST API (POST /api/v1/twitter/conversations/messages) and MCP server.

> [!NOTE]
>
> Looking for a unified API across all platforms? Posttu also provides a centralized [Inbox API](https://docs.posttu.com/api-reference/inbox/overview.md) (`/api/v1/inbox/*`) supporting comments, direct messages, replies, likes, and moderation in a single endpoint.


## OpenAPI

````yaml openapi.json POST /api/v1/twitter/conversations/messages
openapi: 3.1.0
info:
  title: Posttu API
  version: 1.0.0
  description: >-
    Posttu V1 REST API — Workflow automation, social-media post management,
    inbox, tags, and calendar.
servers:
  - url: https://posttu.com
    description: Production
security: []
paths:
  /api/v1/twitter/conversations/messages:
    post:
      tags:
        - Twitter
      summary: List X conversation messages
      description: |-
        Lists messages in a direct-message conversation, paginated.
        Requires API key scope: `twitter:read`.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TwitterConversationMessagesInput'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TwitterMessagesResponse'
        '401':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    TwitterConversationMessagesInput:
      type: object
      properties:
        channelId:
          type: string
          description: Twitter channel ID
          example: ch_tw123
        chatId:
          type: string
          description: Conversation (DM) ID
        paginationToken:
          type: string
      required:
        - channelId
        - chatId
    TwitterMessagesResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Success status
        data:
          type:
            - object
            - 'null'
          properties:
            data:
              $ref: '#/components/schemas/TwitterDmMessagesResult'
            success:
              type: boolean
          required:
            - data
            - success
          description: 'The { data: TwitterDmMessagesResult; success: boolean; }.'
      required:
        - success
        - data
    TwitterDmMessagesResult:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/TwitterDmEventsPayload'
        unifiedMessages:
          type: array
          items:
            $ref: '#/components/schemas/TwitterUnifiedMessage'
        message:
          type: string
        status:
          type: number
    TwitterDmEventsPayload:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TwitterDmEvent'
        includes:
          type: object
          properties:
            media:
              type: array
              items:
                type: object
                additionalProperties: {}
            users:
              type: array
              items:
                $ref: '#/components/schemas/TwitterUser'
            tweets:
              type: array
              items:
                $ref: '#/components/schemas/TwitterTweet'
          additionalProperties: {}
        meta:
          type: object
          properties:
            result_count:
              type: number
            next_token:
              type: string
            previous_token:
              type: string
          additionalProperties: {}
      additionalProperties: {}
    TwitterUnifiedMessage:
      type: object
      additionalProperties: {}
    TwitterDmEvent:
      type: object
      properties:
        id:
          type: string
        text:
          type: string
        created_at:
          type: string
        sender_id:
          type: string
        dm_conversation_id:
          type: string
        participant_ids:
          type: array
          items:
            type: string
        attachments:
          type: object
          properties:
            media_keys:
              type: array
              items:
                type: string
      required:
        - id
      additionalProperties: {}
    TwitterUser:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        username:
          type: string
        created_at:
          type: string
        description:
          type: string
        profile_image_url:
          type: string
        url:
          type: string
        verified:
          type: boolean
        protected:
          type: boolean
        public_metrics:
          type: object
          properties:
            followers_count:
              type: number
            following_count:
              type: number
            tweet_count:
              type: number
            listed_count:
              type: number
            like_count:
              type: number
      required:
        - id
      additionalProperties: {}
    TwitterTweet:
      type: object
      properties:
        id:
          type: string
        text:
          type: string
        author_id:
          type: string
        created_at:
          type: string
        attachments:
          type: object
          properties:
            media_keys:
              type: array
              items:
                type: string
            poll_ids:
              type: array
              items:
                type: string
        public_metrics:
          type: object
          properties:
            retweet_count:
              type: number
            reply_count:
              type: number
            like_count:
              type: number
            quote_count:
              type: number
            impression_count:
              type: number
        organic_metrics:
          type: object
          additionalProperties:
            type: number
        entities:
          type: object
          additionalProperties: {}
      required:
        - id
      additionalProperties: {}
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: 'Pass your API key via the Authorization header: `Bearer <api-key>`'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.