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

# List emails

> Returns a list of emails



## OpenAPI

````yaml /api-reference/openapi.json get /emails
openapi: 3.0.1
info:
  title: Attention Service V2
  description: Attention Service API V2
  termsOfService: https://www.attention.com/terms-of-use
  contact:
    name: Attention Team
    url: https://docs.attention.com/welcome
    email: support@attention.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.8.0
servers:
  - url: https://api.attention.tech/v2
security:
  - APIKeyHeader: []
paths:
  /emails:
    get:
      tags:
        - Email
      summary: List emails
      description: Returns a list of emails
      operationId: listEmails
      parameters:
        - name: subject
          in: query
          description: Filter emails by subject using case-insensitive partial matching
          schema:
            type: string
        - name: crm_account_id
          in: query
          description: Filter emails by CRM account id
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
        - name: deal_uuid
          in: query
          description: Filter emails by deal uuid
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
        - name: from_date_time
          in: query
          description: Start date and time for filtering emails (ISO 8601 format)
          schema:
            type: string
            format: date-time
        - name: to_date_time
          in: query
          description: End date and time for filtering emails (ISO 8601 format)
          schema:
            type: string
            format: date-time
        - name: page
          in: query
          description: Page number for pagination (starts from 1)
          schema:
            minimum: 1
            type: integer
            default: 1
        - name: size
          in: query
          description: Number of items per page (min 1, max 50)
          schema:
            maximum: 50
            minimum: 1
            type: integer
            default: 10
      responses:
        '200':
          description: emails successfully returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListEmailsResponse'
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/ListEmailsResponse'
        '401':
          description: valid API key required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ListEmailsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Email'
        meta:
          $ref: '#/components/schemas/Meta'
      example:
        data:
          - messageId: 123e4567-e89b-12d3-a456-426614174000
            threadId: thread_789f0123-g45h-67i8-j901-234567890123
            sendDate: '2024-03-15T14:30:00Z'
            sender: john.doe@company.com
            recipients:
              - jane.smith@company.com
              - bob.johnson@company.com
            ccRecipients:
              - manager@company.com
              - team@company.com
            subject: Project Update - Q1 2024 Report
            snippet: Hi team, I wanted to share the latest updates on our Q1 project...
            bodyUrl: >-
              https://api.company.com/emails/123e4567-e89b-12d3-a456-426614174000/body
            isInternalUser: false
        meta:
          pageCount: 5
          totalRecords: 100
          pageNumber: 1
          pageSize: 20
    Error:
      type: object
      properties:
        id:
          type: string
          description: A unique identifier for the error.
        status:
          type: string
          description: >-
            The HTTP status code applicable to this problem, expressed as a
            string value.
        code:
          type: string
          description: An application-specific error code, expressed as a string value.
        title:
          type: string
          description: A short, human-readable summary of the problem.
        detail:
          type: string
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
        source:
          type: object
          properties:
            pointer:
              type: string
            parameter:
              type: string
        meta:
          type: object
          properties: {}
      example:
        id: not_found_error
        status: '404'
        code: '404'
        title: Not Found Error
        detail: The requested resource was not found
        source:
          pointer: /data/attributes/id
    Email:
      required:
        - bodyUrl
        - ccRecipients
        - isInternalUser
        - messageId
        - recipients
        - sendDate
        - sender
        - snippet
        - subject
        - threadId
      type: object
      properties:
        messageId:
          type: string
          description: The unique identifier of the email message.
          example: 123e4567-e89b-12d3-a456-426614174000
        threadId:
          type: string
          description: The unique identifier of the email thread or conversation.
          example: thread_789f0123-g45h-67i8-j901-234567890123
        sendDate:
          type: string
          description: The date and time when the email was sent.
          format: date-time
          example: '2024-03-15T14:30:00Z'
        sender:
          type: string
          description: The email address of the sender.
          example: john.doe@company.com
        recipients:
          type: array
          description: List of primary recipient email addresses.
          example:
            - jane.smith@company.com
            - bob.johnson@company.com
          items:
            type: string
        ccRecipients:
          type: array
          description: List of CC (carbon copy) recipient email addresses.
          example:
            - manager@company.com
            - team@company.com
          items:
            type: string
        subject:
          type: string
          description: The subject line of the email.
          example: Project Update - Q1 2024 Report
        snippet:
          type: string
          description: A brief preview or excerpt of the email body content.
          example: Hi team, I wanted to share the latest updates on our Q1 project...
        bodyUrl:
          type: string
          description: URL endpoint to retrieve the full email body content.
          example: >-
            https://api.company.com/emails/123e4567-e89b-12d3-a456-426614174000/body
        isInternalUser:
          type: boolean
          description: >-
            Indicates whether the sender is an internal user within the
            organization.
          example: true
      example:
        messageId: 123e4567-e89b-12d3-a456-426614174000
        threadId: thread_789f0123-g45h-67i8-j901-234567890123
        sendDate: '2024-03-15T14:30:00Z'
        sender: john.doe@company.com
        recipients:
          - jane.smith@company.com
          - bob.johnson@company.com
        ccRecipients:
          - manager@company.com
          - team@company.com
        subject: Project Update - Q1 2024 Report
        snippet: Hi team, I wanted to share the latest updates on our Q1 project...
        bodyUrl: >-
          https://api.company.com/emails/123e4567-e89b-12d3-a456-426614174000/body
        isInternalUser: true
    Meta:
      type: object
      properties:
        pageCount:
          type: integer
        totalRecords:
          type: integer
        pageNumber:
          type: integer
        pageSize:
          type: integer
      example:
        pageCount: 5
        totalRecords: 100
        pageNumber: 1
        pageSize: 20
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      name: Authorization
      in: header

````