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

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# List messages

> Inbox. Read only; needs social:read. Ids are yours: accounts acc_..., profiles prf_..., posts pst_...; every other object id is checked against your accounts before the call.

Fetch messages for a specific conversation, with cursor-based pagination and ordering control.

### Pagination

Pass `pagination.nextCursor` from a prior response back as the `cursor` query param to fetch the next page. The cursor is opaque; do not parse or construct it client-side.

### Sort order

Defaults to `asc` (oldest first, chat style). For the "show me the latest messages" pattern, pass `?sortOrder=desc&limit=N`.

- X, Instagram, Telegram, WhatsApp and Reddit honor the requested order from the local message store.
- Facebook and Bluesky upstream APIs only return newest-first and have no order parameter. Sort order is best-effort and only reverses items within a single page (pages still walk newest→oldest).

The response field `sortOrderApplied` tells you what was actually applied.

### Platform limits

- **Reddit**: threads are paginated client-side because Reddit's API has no per-thread cursor. Very long threads may be upstream-truncated by Reddit's inbox/sent windows (~100 most-recent items each); this is a Reddit platform limitation.
- **Instagram and Facebook**: conversations include history from before the account was connected, replayed from Meta. See below.
- **X**: X's encrypted "X Chat" messages are not accessible via the API. Conversations where the other participant uses encrypted X Chat may only show your outgoing messages. See the list conversations endpoint for more details.

The Meta replay covers the 500 most recent messages per conversation: a longer thread keeps its newest 500 and older messages are not retrievable. Messages that arrived after the account was connected are unaffected. Replayed messages are stored as already read and emit no webhooks.

### Read state

This endpoint is read-only and does NOT mark messages as read or send read receipts. To mark a conversation read (and send WhatsApp blue ticks on eligible accounts), call `POST /apis/v1/social/inbox/conversations/{conversationId}/read`.

<!-- aisa-pricing:start -->
当前未提供请求参考价格；请使用接口支持的报价功能确认费用。 最终费用以账户适用价格及实际结算为准。
<!-- aisa-pricing:end -->

## 请求规范

* **方法与路径:** GET /apis/v1/social/inbox/conversations/\{conversationId}/messages
* **可用状态:** enabled
* **请求 URL 模板:** `https://api.aisa.one/apis/v1/social/inbox/conversations/{conversationId}/messages`
* **conversationId:** path; 必填
* **accountId:** query; 必填
* **limit:** query; 可选
* **cursor:** query; 可选
* **sortOrder:** query; 可选
* **Runtime 事实版本:** 99acb5bddbedc8d3352e7c4fef86c3e6d8852c14772bcd18dbcf415237a642bd

[完整 OpenAPI 定义](https://aisa.one/docs/reference-contracts/zh/aisa-social.json)

有效请求与价格声明（包括认证和引用的 schema）：

```json theme={null}
{
  "operationId": "get_aisa_social_apis_v1_social_inbox_conversation_3ceefe",
  "method": "GET",
  "path": "/apis/v1/social/inbox/conversations/{conversationId}/messages",
  "servers": [
    {
      "url": "https://api.aisa.one"
    }
  ],
  "parameters": [
    {
      "description": "Opaque conversation identifier, accepted verbatim from the list endpoint or from the conversationId on inbox webhooks. Format not to be assumed.",
      "in": "path",
      "name": "conversationId",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "One of your social accounts (acc_...).",
      "in": "query",
      "name": "accountId",
      "required": true,
      "schema": {
        "pattern": "^acc_[0-9A-Za-z]{22}$",
        "type": "string"
      }
    },
    {
      "description": "Number of messages to return per page. Default 100, max 100.",
      "in": "query",
      "name": "limit",
      "required": false,
      "schema": {
        "default": 100,
        "maximum": 100,
        "minimum": 1,
        "type": "integer"
      }
    },
    {
      "description": "Opaque pagination cursor. Pass `pagination.nextCursor` from a prior response verbatim: a cursor we cannot parse returns 400 rather than silently restarting from the first page.",
      "in": "query",
      "name": "cursor",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Order of returned messages. Default `asc` (oldest first, chat style).\nX, Instagram, Telegram, WhatsApp and Reddit honor this order\nacross cursor pages. For Facebook and Bluesky, only intra-page\nordering is affected. Pages always walk newest→oldest. See\n`sortOrderApplied` in the response.",
      "in": "query",
      "name": "sortOrder",
      "required": false,
      "schema": {
        "default": "asc",
        "enum": [
          "asc",
          "desc"
        ],
        "type": "string"
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "x-aisa-status": "enabled",
  "x-aisa-pricing": {
    "description": "Included with your connected social accounts: AIsa does not charge per call.",
    "kind": "no_customer_charge"
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```

## 费用与请求规则

当前未提供请求参考价格；请使用接口支持的报价功能确认费用。 最终费用以账户适用价格及实际结算为准。

公开参考值不是你的账户报价或最终扣费。对于支持 X-AISA-Cost-Mode: quote 的接口，执行前请针对完整请求获取免费报价；执行后通过响应费用元数据和 Usage Logs 核对结算费用。1 USD 等于 1,000,000 个整数 micro-USD。


## OpenAPI

````yaml reference-contracts/zh/aisa-social.json GET /apis/v1/social/inbox/conversations/{conversationId}/messages
openapi: 3.1.0
info:
  description: ''
  title: AIsa Social
  version: '1'
  x-aisa-capabilities:
    idempotency: Idempotency-Key
    max_price: X-AISA-Max-Price-USD
    quote:
      header: X-AISA-Cost-Mode
      value: quote
  x-aisa-configured-paths: []
  x-aisa-document:
    facts_hash: 99acb5bddbedc8d3352e7c4fef86c3e6d8852c14772bcd18dbcf415237a642bd
    generator_version: '3'
    protocol_version: '1'
    schema_version: '1'
    composer_version: '27'
    response_pending: []
    document_hash: sha256:7f9742cb1ea233c648dcb290fdfbf24e53a27dcf900ec1386f83a8ef2e6b1bf9
  x-aisa-plans:
    builder: 1
    display_plan: payg
    payg: 1
    similarweb_payg: 1
    team: 1
    version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-provider: aisa-social
  x-aisa-catalogs:
    aisa-social:
      title: AIsa Social
      description: ''
      x-aisa-document:
        facts_hash: 99acb5bddbedc8d3352e7c4fef86c3e6d8852c14772bcd18dbcf415237a642bd
        generator_version: '3'
        protocol_version: '1'
        schema_version: '1'
      x-aisa-plans:
        builder: 1
        display_plan: payg
        payg: 1
        similarweb_payg: 1
        team: 1
        version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
      x-aisa-capabilities:
        idempotency: Idempotency-Key
        max_price: X-AISA-Max-Price-USD
        quote:
          header: X-AISA-Cost-Mode
          value: quote
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
paths:
  /apis/v1/social/inbox/conversations/{conversationId}/messages:
    get:
      summary: List messages
      description: >-
        Inbox. Read only; needs social:read. Ids are yours: accounts acc_...,
        profiles prf_..., posts pst_...; every other object id is checked
        against your accounts before the call.


        Fetch messages for a specific conversation, with cursor-based pagination
        and ordering control.


        ### Pagination


        Pass `pagination.nextCursor` from a prior response back as the `cursor`
        query param to fetch the next page. The cursor is opaque; do not parse
        or construct it client-side.


        ### Sort order


        Defaults to `asc` (oldest first, chat style). For the "show me the
        latest messages" pattern, pass `?sortOrder=desc&limit=N`.


        - X, Instagram, Telegram, WhatsApp and Reddit honor the requested order
        from the local message store.

        - Facebook and Bluesky upstream APIs only return newest-first and have
        no order parameter. Sort order is best-effort and only reverses items
        within a single page (pages still walk newest→oldest).


        The response field `sortOrderApplied` tells you what was actually
        applied.


        ### Platform limits


        - **Reddit**: threads are paginated client-side because Reddit's API has
        no per-thread cursor. Very long threads may be upstream-truncated by
        Reddit's inbox/sent windows (~100 most-recent items each); this is a
        Reddit platform limitation.

        - **Instagram and Facebook**: conversations include history from before
        the account was connected, replayed from Meta. See below.

        - **X**: X's encrypted "X Chat" messages are not accessible via the API.
        Conversations where the other participant uses encrypted X Chat may only
        show your outgoing messages. See the list conversations endpoint for
        more details.


        The Meta replay covers the 500 most recent messages per conversation: a
        longer thread keeps its newest 500 and older messages are not
        retrievable. Messages that arrived after the account was connected are
        unaffected. Replayed messages are stored as already read and emit no
        webhooks.


        ### Read state


        This endpoint is read-only and does NOT mark messages as read or send
        read receipts. To mark a conversation read (and send WhatsApp blue ticks
        on eligible accounts), call `POST
        /apis/v1/social/inbox/conversations/{conversationId}/read`.


        <!-- aisa-pricing:start -->

        当前未提供请求参考价格；请使用接口支持的报价功能确认费用。 最终费用以账户适用价格及实际结算为准。

        <!-- aisa-pricing:end -->
      operationId: get_aisa_social_apis_v1_social_inbox_conversation_3ceefe
      parameters:
        - description: >-
            Opaque conversation identifier, accepted verbatim from the list
            endpoint or from the conversationId on inbox webhooks. Format not to
            be assumed.
          in: path
          name: conversationId
          required: true
          schema:
            type: string
        - description: One of your social accounts (acc_...).
          in: query
          name: accountId
          required: true
          schema:
            pattern: ^acc_[0-9A-Za-z]{22}$
            type: string
        - description: Number of messages to return per page. Default 100, max 100.
          in: query
          name: limit
          required: false
          schema:
            default: 100
            maximum: 100
            minimum: 1
            type: integer
        - description: >-
            Opaque pagination cursor. Pass `pagination.nextCursor` from a prior
            response verbatim: a cursor we cannot parse returns 400 rather than
            silently restarting from the first page.
          in: query
          name: cursor
          required: false
          schema:
            type: string
        - description: >-
            Order of returned messages. Default `asc` (oldest first, chat
            style).

            X, Instagram, Telegram, WhatsApp and Reddit honor this order

            across cursor pages. For Facebook and Bluesky, only intra-page

            ordering is affected. Pages always walk newest→oldest. See

            `sortOrderApplied` in the response.
          in: query
          name: sortOrder
          required: false
          schema:
            default: asc
            enum:
              - asc
              - desc
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  lastUpdated:
                    format: date-time
                    type: string
                  messages:
                    items:
                      properties:
                        accountId:
                          description: One of your social accounts (acc_...).
                          pattern: ^acc_[0-9A-Za-z]{22}$
                          type: string
                        attachments:
                          items:
                            properties:
                              filename:
                                type:
                                  - string
                                  - 'null'
                              id:
                                type: string
                              mimeType:
                                description: >-
                                  MIME type of the media when AIsa knows it. On
                                  Instagram and Facebook it is set for shares
                                  resolved by content type (`originalType:
                                  "unsupported_type"`).
                                type: string
                              originalType:
                                description: >-
                                  Instagram and Facebook only, and present only
                                  when it differs from `type`. Meta's own type
                                  before normalization:


                                  - `ig_reel` and `reel` become `video`.

                                  - `ig_post`, `post`, `ig_story` and
                                  `story_mention` become `share`.


                                  A story mention is `type: "share"` with
                                  `originalType: "story_mention"`. Render on
                                  this field, since `share` alone is ambiguous.


                                  `originalType: "unsupported_type"` marks a
                                  share Meta did not classify, resolved by
                                  content type. `refreshUrl` cannot re-mint it
                                  (Meta answers `is_unsupported` with no
                                  attachments for the message node), so download
                                  it when the `message.received` webhook
                                  arrives.
                                type: string
                              payload:
                                additionalProperties: true
                                description: >-
                                  Template content (title, subtitle, image,
                                  buttons) when type is template
                                type: object
                              previewUrl:
                                type:
                                  - string
                                  - 'null'
                              refreshUrl:
                                description: >-
                                  Instagram and Facebook only. Endpoint that
                                  resolves this attachment to a working url
                                  every time, re-minting it from Meta when the
                                  stored one has expired. Safe to store and
                                  render indefinitely.


                                  Exception: an attachment with `originalType:
                                  "unsupported_type"`. Meta cannot re-serve
                                  those, so the endpoint answers 404 once the
                                  url has expired.
                                type:
                                  - string
                                  - 'null'
                              type:
                                description: >-
                                  On Instagram and Facebook a shared reel, post
                                  or ad reaches AIsa with no type of its own
                                  (Meta's `unsupported_type`) and is resolved
                                  from the media's Content-Type at ingest into
                                  `image`, `video`, `audio` or `file` with
                                  `originalType: "unsupported_type"`.
                                  `unsupported_type` is returned only when the
                                  CDN could not be classified in time.
                                enum:
                                  - image
                                  - video
                                  - audio
                                  - file
                                  - sticker
                                  - share
                                  - template
                                  - unsupported_type
                                type: string
                              url:
                                description: >-
                                  Direct media link. On Instagram and Facebook
                                  this is a signed Meta CDN url that EXPIRES:
                                  use it now, do not store it. Persist
                                  `refreshUrl` instead.
                                type: string
                            type: object
                          type: array
                        conversationId:
                          type: string
                        createdAt:
                          format: date-time
                          type: string
                        deletedAt:
                          format: date-time
                          type:
                            - string
                            - 'null'
                        deliveredAt:
                          format: date-time
                          type:
                            - string
                            - 'null'
                        deliveryError:
                          description: Populated when deliveryStatus === "failed".
                          properties:
                            code:
                              type: integer
                            details:
                              description: >-
                                Platform's extended detail for `code` (WhatsApp:
                                Meta's `error_data.details`), when the platform
                                sent one. Absent on SMS.
                              type: string
                            href:
                              description: >-
                                Link to the platform's documentation for `code`,
                                when the platform sent one.
                              format: uri
                              type: string
                            message:
                              type: string
                            title:
                              type: string
                          type:
                            - object
                            - 'null'
                        deliveryStatus:
                          description: >-
                            Lifecycle status for outgoing messages. Not all
                            platforms emit every state (see webhook support
                            matrix).
                          enum:
                            - sent
                            - delivered
                            - read
                            - played
                            - failed
                            - deleted
                          type:
                            - string
                            - 'null'
                        direction:
                          enum:
                            - incoming
                            - outgoing
                          type: string
                        editCount:
                          description: Total number of edits applied.
                          type: integer
                        editHistory:
                          description: Every prior version of the message, oldest first.
                          items:
                            description: One prior version of an edited message.
                            properties:
                              attachments:
                                items:
                                  description: >-
                                    Attachment snapshot inside an edit-history
                                    entry.
                                  properties:
                                    payload:
                                      type: object
                                    type:
                                      type: string
                                    url:
                                      type: string
                                  type: object
                                type: array
                              editedAt:
                                format: date-time
                                type: string
                              text:
                                type:
                                  - string
                                  - 'null'
                            required:
                              - attachments
                              - editedAt
                              - text
                            type: object
                          type: array
                        editedAt:
                          description: When the most recent edit happened.
                          format: date-time
                          type:
                            - string
                            - 'null'
                        id:
                          description: >-
                            The platform's own message id: the `wamid` on
                            WhatsApp, the `mid` on Instagram and Facebook
                            Messenger.


                            It is what `metadata.quotedMessageId` points at, the
                            value to pass as `replyTo` on platforms that support
                            quote-replies, and the `{messageId}` segment of the
                            attachment-resolve URL.


                            Webhooks deliver the same value as
                            `message.platformMessageId`; this response has no
                            field by that name.
                          type: string
                        isDeleted:
                          description: >-
                            True if the sender has deleted (unsent) this
                            message. The original message and attachments fields
                            remain populated.
                          type: boolean
                        isEdited:
                          description: >-
                            True if the sender has edited this message at least
                            once.
                          type: boolean
                        isStoryMention:
                          description: >-
                            Instagram only. True when the message is the user
                            mentioning the account in their own story. The story
                            itself is the `share` attachment with `originalType:
                            "story_mention"`. Also set on imported history, read
                            off Meta's `story.mention`.
                          type: boolean
                        message:
                          type: string
                        metadata:
                          additionalProperties: true
                          description: >-
                            Platform-specific extras. Free-form, but commonly
                            includes:


                            - `quotedMessageId`: the `id` of the message this
                            one replies to (delivered as
                            `message.platformMessageId` on webhooks).

                            - `waInteractive`: a compact descriptor of WhatsApp
                            interactive content sent (buttons / list / cta_url /
                            flow / location_request).

                            - `metaInteractive`: outgoing Instagram/Facebook
                            buttons, quickReplies and template, as sent.

                            - `interactiveType` / `interactiveId`: for inbound
                            interactive taps.

                            - `source`: where the message reached us from, not
                            who produced it (read `sentVia` for that).
                            `whatsapp_business_app` / `coexistence_history` on a
                            WhatsApp Coexistence number, `bulk-api` on a POST
                            /apis/v1/social/whatsapp/bulk send.
                          type: object
                        noRenderableContent:
                          description: >-
                            Instagram and Facebook Messenger only; absent on
                            other platforms. True when Meta withholds the
                            content of this message from the API (its
                            `is_unsupported` flag): `message` is empty,
                            `attachments` is empty, and there is nothing to
                            fetch, now or later.


                            Distinguishes such a message from an ordinary empty
                            one, such as a story reply with no text.
                          type: boolean
                        platform:
                          type: string
                        reactions:
                          description: >-
                            Emoji reactions on this message (WhatsApp /
                            Telegram). At most one per party in a 1:1 thread.
                          items:
                            properties:
                              emoji:
                                type: string
                              fromMe:
                                description: >-
                                  true if the connected account reacted, false
                                  if the contact did.
                                type: boolean
                              reactedAt:
                                format: date-time
                                type: string
                            type: object
                          type: array
                        readAt:
                          format: date-time
                          type:
                            - string
                            - 'null'
                        senderId:
                          type: string
                        senderName:
                          type:
                            - string
                            - 'null'
                        senderVerifiedType:
                          description: X verified badge type. Only present for X messages.
                          enum:
                            - blue
                            - government
                            - business
                            - none
                          type:
                            - string
                            - 'null'
                        sentAt:
                          description: >-
                            Original send time for outgoing messages (used for
                            Messenger watermark queries).
                          format: date-time
                          type:
                            - string
                            - 'null'
                        sentVia:
                          description: >-
                            Which AIsa surface produced this outgoing message:
                            `human` (an

                            operator in the AIsa inbox), `api` (a call to this
                            API),

                            `broadcast`, `sequence`, `workflow`,
                            `comment_automation`, or

                            `bulk-api` (POST /apis/v1/social/whatsapp/bulk).
                            Same vocabulary as the `source`

                            filter on the inbox analytics endpoints.


                            Always present, and `null` whenever the lineage is
                            unknown: every

                            incoming message, any outgoing message sent from the
                            platform's own

                            app, and every message stored before this field
                            shipped

                            (2026-08). Existing messages are NOT backfilled, so
                            treat `null`

                            as "unknown", never as "sent by a human".
                          enum:
                            - human
                            - api
                            - broadcast
                            - sequence
                            - workflow
                            - comment_automation
                            - bulk-api
                            - null
                          type:
                            - string
                            - 'null'
                        storyReply:
                          description: >-
                            Instagram only. Present when the message replies to
                            one of the account's stories. Also set on history
                            imported after connecting, read off Meta's
                            `story.reply_to`.
                          properties:
                            storyId:
                              description: The Instagram story ID the user replied to.
                              type: string
                            storyUrl:
                              description: >-
                                Meta CDN URL for the story media. Expires
                                roughly 24 hours after the story posted; fetch
                                promptly or treat 404s as expected.
                              type: string
                          type: object
                        subject:
                          description: Reddit message subject
                          type:
                            - string
                            - 'null'
                      type: object
                    type: array
                  pagination:
                    properties:
                      hasMore:
                        description: Whether more messages are available beyond this page.
                        type: boolean
                      nextCursor:
                        description: >-
                          Opaque cursor to fetch the next page. `null` on the
                          last page.
                        type:
                          - string
                          - 'null'
                    type: object
                  sortOrderApplied:
                    description: |-
                      Sort order actually applied to the returned page. May
                      differ from the requested `sortOrder` for Facebook and
                      Bluesky (always `desc` regardless of request).
                    enum:
                      - asc
                      - desc
                    type: string
                  status:
                    type: string
                type: object
          description: Messages in conversation
        default:
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        type:
                          - string
                          - 'null'
                      details:
                        additionalProperties: {}
                        type:
                          - object
                          - 'null'
                      message:
                        type:
                          - string
                          - 'null'
                      param:
                        type:
                          - string
                          - 'null'
                      retryHint:
                        enum:
                          - never
                          - after_delay
                          - after_reconnect
                          - reconcile_first
                          - null
                        type:
                          - string
                          - 'null'
                      retryable:
                        type:
                          - boolean
                          - 'null'
                      type:
                        type:
                          - string
                          - 'null'
                    type:
                      - object
                      - 'null'
                type: object
          description: Error. The code field is stable; see the error catalog.
components:
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````

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