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

# Attention: List Emails

> List emails in Attention, filterable by subject, CRM account, deal and date. Includes SDK V2 examples, input constraints, response fields, and Deepline cost.

List emails in Attention, filterable by subject, CRM account, deal and date.

> [!NOTE]
>
> Tool ID: `attention_list_emails`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'attention_list_emails',
  {
    "subject": "Introduction",
    "crm_account_id": [
      "123456789"
    ],
    "deal_uuid": [
      "deal_123"
    ]
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute attention_list_emails --input '{
  "subject": "Introduction",
  "crm_account_id": [
    "123456789"
  ],
  "deal_uuid": [
    "deal_123"
  ]
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "data": [
      {
        "messageId": "message_123",
        "threadId": "thread_123",
        "sendDate": "2026-01-15T12:00:00Z",
        "sender": "example",
        "recipients": [
          "example"
        ],
        "ccRecipients": [
          "example"
        ],
        "subject": "Introduction",
        "snippet": "example",
        "bodyUrl": "https://example.com",
        "isInternalUser": true
      }
    ],
    "meta": {
      "pageCount": 123,
      "totalRecords": 123,
      "pageNumber": 123
    }
  }
}
```

Use `deepline describe attention_list_emails --json` for the latest machine-readable contract.

## Input reference

Returns a list of emails

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.subject` | `string` | No | — | Filter emails by subject using case-insensitive partial matching |
| `payload.crm_account_id` | `array` | No | — | Filter emails by CRM account id |
| `payload.deal_uuid` | `array` | No | — | Filter emails by deal uuid |
| `payload.from_date_time` | `string` | No | — | Start date and time for filtering emails (ISO 8601 format) Format: `date-time`. |
| `payload.to_date_time` | `string` | No | — | End date and time for filtering emails (ISO 8601 format) Format: `date-time`. |
| `payload.page` | `integer` | No | `1` | Page number for pagination (starts from 1) Minimum: 1. |
| `payload.size` | `integer` | No | `10` | Number of items per page (min 1, max 50) Minimum: 1. Maximum: 50. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Returns a list of emails",
    "properties": {
      "subject": {
        "type": "string",
        "description": "Filter emails by subject using case-insensitive partial matching"
      },
      "crm_account_id": {
        "type": "array",
        "description": "Filter emails by CRM account id",
        "items": {
          "type": "string"
        }
      },
      "deal_uuid": {
        "type": "array",
        "description": "Filter emails by deal uuid",
        "items": {
          "type": "string"
        }
      },
      "from_date_time": {
        "type": "string",
        "description": "Start date and time for filtering emails (ISO 8601 format)",
        "format": "date-time"
      },
      "to_date_time": {
        "type": "string",
        "description": "End date and time for filtering emails (ISO 8601 format)",
        "format": "date-time"
      },
      "page": {
        "type": "integer",
        "description": "Page number for pagination (starts from 1)",
        "default": 1,
        "minimum": 1
      },
      "size": {
        "type": "integer",
        "description": "Number of items per page (min 1, max 50)",
        "default": 10,
        "minimum": 1,
        "maximum": 50
      }
    },
    "required": [],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.data` | `array` | No | — | — |
| `result.data.data[].messageId` | `string` | Yes | — | The unique identifier of the email message. |
| `result.data.data[].threadId` | `string` | Yes | — | The unique identifier of the email thread or conversation. |
| `result.data.data[].sendDate` | `string` | Yes | — | The date and time when the email was sent. Format: `date-time`. |
| `result.data.data[].sender` | `string` | Yes | — | The email address of the sender. |
| `result.data.data[].recipients` | `array` | Yes | — | List of primary recipient email addresses. |
| `result.data.data[].ccRecipients` | `array` | Yes | — | List of CC (carbon copy) recipient email addresses. |
| `result.data.data[].subject` | `string` | Yes | — | The subject line of the email. |
| `result.data.data[].snippet` | `string` | Yes | — | A brief preview or excerpt of the email body content. |
| `result.data.data[].bodyUrl` | `string` | Yes | — | URL endpoint to retrieve the full email body content. |
| `result.data.data[].isInternalUser` | `boolean` | Yes | — | Indicates whether the sender is an internal user within the organization. |
| `result.data.meta` | `object` | No | — | — |
| `result.data.meta.pageCount` | `integer` | No | — | — |
| `result.data.meta.totalRecords` | `integer` | No | — | — |
| `result.data.meta.pageNumber` | `integer` | No | — | — |
| `result.data.meta.pageSize` | `integer` | No | — | — |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "messageId": {
                  "type": "string",
                  "description": "The unique identifier of the email message."
                },
                "threadId": {
                  "type": "string",
                  "description": "The unique identifier of the email thread or conversation."
                },
                "sendDate": {
                  "type": "string",
                  "description": "The date and time when the email was sent.",
                  "format": "date-time"
                },
                "sender": {
                  "type": "string",
                  "description": "The email address of the sender."
                },
                "recipients": {
                  "type": "array",
                  "description": "List of primary recipient email addresses.",
                  "items": {
                    "type": "string"
                  }
                },
                "ccRecipients": {
                  "type": "array",
                  "description": "List of CC (carbon copy) recipient email addresses.",
                  "items": {
                    "type": "string"
                  }
                },
                "subject": {
                  "type": "string",
                  "description": "The subject line of the email."
                },
                "snippet": {
                  "type": "string",
                  "description": "A brief preview or excerpt of the email body content."
                },
                "bodyUrl": {
                  "type": "string",
                  "description": "URL endpoint to retrieve the full email body content."
                },
                "isInternalUser": {
                  "type": "boolean",
                  "description": "Indicates whether the sender is an internal user within the organization."
                }
              },
              "required": [
                "bodyUrl",
                "ccRecipients",
                "isInternalUser",
                "messageId",
                "recipients",
                "sendDate",
                "sender",
                "snippet",
                "subject",
                "threadId"
              ],
              "additionalProperties": false
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "pageCount": {
                "type": "integer"
              },
              "totalRecords": {
                "type": "integer"
              },
              "pageNumber": {
                "type": "integer"
              },
              "pageSize": {
                "type": "integer"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Attention provider guide](https://deepline.com/docs/providers/attention/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


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