> ## 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 email threads

> Email. Threads of a connected Google or Microsoft mailbox, newest first. Every filter that the provider cannot apply server-side is applied to the fetched page instead and named in `meta.filteredClientSide`, so a filtered page can hold fewer than `limit` items while `pagination.hasMore` stays true.

On Google, folders are Gmail labels: `folder` takes a well-known name or a label id, `archive` means mail carrying none of the inbox, trash or spam labels, and `sortOrder=asc` reverses the fetched page (Gmail lists newest first only).

## 请求规范

* **方法与路径:** GET /apis/v1/social/messaging/email/threads
* **可用状态:** enabled
* **请求 URL 模板:** `https://api.aisa.one/apis/v1/social/messaging/email/threads`
* **connectionId:** query; 必填
* **folder:** query; 可选
* **unread:** query; 可选
* **starred:** query; 可选
* **hasAttachment:** query; 可选
* **subject:** query; 可选
* **from:** query; 可选
* **to:** query; 可选
* **cc:** query; 可选
* **bcc:** query; 可选
* **anyEmail:** query; 可选
* **after:** query; 可选
* **before:** query; 可选
* **searchQueryNative:** query; 可选
* **sortOrder:** query; 可选
* **cursor:** query; 可选
* **limit:** query; 可选

[完整 OpenAPI 定义](https://aisa.one/docs/openapi/zh/aisa-messaging.json)

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

```json theme={null}
{
  "operationId": "get_aisa_messaging_apis_v1_social_messaging_email_f221e4",
  "method": "GET",
  "path": "/apis/v1/social/messaging/email/threads",
  "servers": [
    {
      "url": "https://api.aisa.one"
    }
  ],
  "parameters": [
    {
      "description": "Your messaging connection (msc_...), from GET /apis/v1/social/messaging/connections.",
      "in": "query",
      "name": "connectionId",
      "required": true,
      "schema": {
        "pattern": "^msc_[0-9A-Za-z]+$",
        "type": "string"
      }
    },
    {
      "description": "Well-known folder (`inbox`, `sent`, `drafts`, `trash`, `spam`, `archive`) or a provider folder id from `GET /apis/v1/social/messaging/email/folders`. Default inbox.",
      "in": "query",
      "name": "folder",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "unread",
      "required": false,
      "schema": {
        "type": "boolean"
      }
    },
    {
      "in": "query",
      "name": "starred",
      "required": false,
      "schema": {
        "type": "boolean"
      }
    },
    {
      "in": "query",
      "name": "hasAttachment",
      "required": false,
      "schema": {
        "type": "boolean"
      }
    },
    {
      "description": "Substring match on the subject.",
      "in": "query",
      "name": "subject",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Sender address.",
      "in": "query",
      "name": "from",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "A recipient address.",
      "in": "query",
      "name": "to",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "cc",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Applied client-side on Microsoft.",
      "in": "query",
      "name": "bcc",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Matches from, to, cc or bcc. Applied client-side on Microsoft.",
      "in": "query",
      "name": "anyEmail",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "after",
      "required": false,
      "schema": {
        "format": "date-time",
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "before",
      "required": false,
      "schema": {
        "format": "date-time",
        "type": "string"
      }
    },
    {
      "description": "The provider's own search syntax (Gmail search operators, Microsoft KQL). On Microsoft it cannot be combined with other filters or server-side ordering; those are applied to the page.",
      "in": "query",
      "name": "searchQueryNative",
      "required": false,
      "schema": {
        "maxLength": 500,
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "sortOrder",
      "required": false,
      "schema": {
        "default": "desc",
        "enum": [
          "asc",
          "desc"
        ],
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "cursor",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "limit",
      "required": false,
      "schema": {
        "default": 50,
        "maximum": 200,
        "minimum": 1,
        "type": "integer"
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "x-aisa-status": "enabled",
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```

## 费用与请求规则

此操作不另收费。


## OpenAPI

````yaml openapi/zh/aisa-messaging.json GET /apis/v1/social/messaging/email/threads
openapi: 3.1.0
info:
  description: ''
  title: AIsa Messaging
  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-catalogs:
    aisa-messaging:
      description: ''
      title: AIsa Messaging
      x-aisa-capabilities:
        idempotency: Idempotency-Key
        max_price: X-AISA-Max-Price-USD
        quote:
          header: X-AISA-Cost-Mode
          value: quote
      x-aisa-document:
        facts_hash: 3f75dbfba86cc5ac46b20ee9310446322890eeeb034619f5c221a47d6b1064a2
        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-configured-paths: []
  x-aisa-document:
    composer_version: '31'
    document_hash: sha256:989b0c03378fa66fa7653d6c34e54850322e6be4bc7d9f0f130ac18a459676eb
    facts_hash: 3f75dbfba86cc5ac46b20ee9310446322890eeeb034619f5c221a47d6b1064a2
    generator_version: '3'
    protocol_version: '1'
    response_pending: []
    schema_version: '1'
  x-aisa-plans:
    builder: 1
    display_plan: payg
    payg: 1
    similarweb_payg: 1
    team: 1
    version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-provider: aisa-messaging
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
paths:
  /apis/v1/social/messaging/email/threads:
    get:
      summary: List email threads
      description: >-
        Email. Threads of a connected Google or Microsoft mailbox, newest first.
        Every filter that the provider cannot apply server-side is applied to
        the fetched page instead and named in `meta.filteredClientSide`, so a
        filtered page can hold fewer than `limit` items while
        `pagination.hasMore` stays true.


        On Google, folders are Gmail labels: `folder` takes a well-known name or
        a label id, `archive` means mail carrying none of the inbox, trash or
        spam labels, and `sortOrder=asc` reverses the fetched page (Gmail lists
        newest first only).
      operationId: get_aisa_messaging_apis_v1_social_messaging_email_f221e4
      parameters:
        - description: >-
            Your messaging connection (msc_...), from GET
            /apis/v1/social/messaging/connections.
          in: query
          name: connectionId
          required: true
          schema:
            pattern: ^msc_[0-9A-Za-z]+$
            type: string
        - description: >-
            Well-known folder (`inbox`, `sent`, `drafts`, `trash`, `spam`,
            `archive`) or a provider folder id from `GET
            /apis/v1/social/messaging/email/folders`. Default inbox.
          in: query
          name: folder
          required: false
          schema:
            type: string
        - in: query
          name: unread
          required: false
          schema:
            type: boolean
        - in: query
          name: starred
          required: false
          schema:
            type: boolean
        - in: query
          name: hasAttachment
          required: false
          schema:
            type: boolean
        - description: Substring match on the subject.
          in: query
          name: subject
          required: false
          schema:
            type: string
        - description: Sender address.
          in: query
          name: from
          required: false
          schema:
            type: string
        - description: A recipient address.
          in: query
          name: to
          required: false
          schema:
            type: string
        - in: query
          name: cc
          required: false
          schema:
            type: string
        - description: Applied client-side on Microsoft.
          in: query
          name: bcc
          required: false
          schema:
            type: string
        - description: Matches from, to, cc or bcc. Applied client-side on Microsoft.
          in: query
          name: anyEmail
          required: false
          schema:
            type: string
        - in: query
          name: after
          required: false
          schema:
            format: date-time
            type: string
        - in: query
          name: before
          required: false
          schema:
            format: date-time
            type: string
        - description: >-
            The provider's own search syntax (Gmail search operators, Microsoft
            KQL). On Microsoft it cannot be combined with other filters or
            server-side ordering; those are applied to the page.
          in: query
          name: searchQueryNative
          required: false
          schema:
            maxLength: 500
            type: string
        - in: query
          name: sortOrder
          required: false
          schema:
            default: desc
            enum:
              - asc
              - desc
            type: string
        - in: query
          name: cursor
          required: false
          schema:
            type: string
        - in: query
          name: limit
          required: false
          schema:
            default: 50
            maximum: 200
            minimum: 1
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    items:
                      properties:
                        connectionId:
                          description: >-
                            One of your connections, or null when it is not one
                            of yours.
                          type:
                            - string
                            - 'null'
                        draftIds:
                          items:
                            type: string
                          type: array
                        earliestMessageAt:
                          format: date-time
                          type:
                            - string
                            - 'null'
                        folders:
                          items:
                            type: string
                          type: array
                        hasAttachments:
                          type: boolean
                        hasDrafts:
                          type: boolean
                        id:
                          type: string
                        latestMessageReceivedAt:
                          format: date-time
                          type:
                            - string
                            - 'null'
                        latestMessageSentAt:
                          format: date-time
                          type:
                            - string
                            - 'null'
                        messageIds:
                          items:
                            type: string
                          type: array
                        participants:
                          items:
                            properties:
                              email:
                                format: email
                                type: string
                              name:
                                type:
                                  - string
                                  - 'null'
                            required:
                              - email
                            type: object
                          type: array
                        provider:
                          enum:
                            - google
                            - microsoft
                          type: string
                        snippet:
                          type: string
                        starred:
                          type: boolean
                        subject:
                          type: string
                        unread:
                          type: boolean
                      type: object
                    type: array
                  meta:
                    properties:
                      filteredClientSide:
                        description: >-
                          The filters the provider could not apply server-side,
                          so they were applied to the fetched page (Microsoft:
                          `bcc`, `anyEmail`, and every other filter when
                          `searchQueryNative` is set).
                        items:
                          type: string
                        type: array
                    type: object
                  pagination:
                    properties:
                      hasMore:
                        type: boolean
                      nextCursor:
                        description: Opaque; pass it back as `cursor`.
                        type:
                          - string
                          - 'null'
                    type: object
                type: object
          description: Success
        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:
                        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.