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

# Listar mensagens e-mail

> Mostra o histórico de e-mail enviados. Dá para filtrar por data e status.



## OpenAPI

````yaml /emails-api/api-reference/openapi-email.json get /v1/email/messages
openapi: 3.0.3
info:
  title: Notifique API. E-mail
  description: >-
    Envie e-mails, gerencie domínios e consulte status. Autentique com
    `Authorization: Bearer sk_live_...` ou `x-api-key`.
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Produção
security:
  - ntfEmailBearerAuth: []
  - ntfEmailApiKeyHeader: []
tags:
  - name: E-mail
    description: Envio e consulta de e-mail
  - name: Domínios
    description: Registro e verificação de domínios para envio de e-mail
paths:
  /v1/email/messages:
    get:
      tags:
        - E-mail
      summary: Listar mensagens e-mail
      description: >-
        Mostra o histórico de e-mail enviados. Dá para filtrar por data e
        status.
      operationId: ntfEmail_getV1EmailMessages
      parameters:
        - name: page
          in: query
          schema:
            type: string
          description: Página (padrão 1).
        - name: limit
          in: query
          schema:
            type: string
          description: Itens por página (padrão 20, máx. 100).
        - name: fromDate
          in: query
          schema:
            type: string
            format: date-time
          description: Início do intervalo (filtro em createdAt, inclusive).
        - name: toDate
          in: query
          schema:
            type: string
            format: date-time
          description: Fim do intervalo (filtro em createdAt, inclusive).
        - name: status
          in: query
          schema:
            type: string
          description: >-
            Um ou mais status separados por vírgula: QUEUED, SCHEDULED,
            PROCESSING, SENT, DELIVERED, OPENED, CLICKED, FAILED, CANCELLED,
            COMPLAINED. Valores inválidos são ignorados.
        - name: emailDomainId
          in: query
          schema:
            type: string
          description: >-
            Filtra pelo ID (cuid) do domínio de envio; deve pertencer ao
            workspace. Alternativa: `email_domain_id`.
        - name: email_domain_id
          in: query
          schema:
            type: string
          description: Alias de `emailDomainId`.
      responses:
        '200':
          description: Lista de e-mails e paginação.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - data
                  - pagination
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: array
                    description: >-
                      Cada item tem os mesmos campos que GET
                      /v1/email/messages/{id} em `data`. Não inclui corpo
                      (`html`/`text`), `emailDomainId`, `externalId` nem
                      `providerUsed`.
                    items:
                      $ref: '#/components/schemas/NtfEmail_EmailListItem'
                  pagination:
                    type: object
                    required:
                      - total
                      - page
                      - limit
                      - totalPages
                    properties:
                      total:
                        type: integer
                        description: Total de e-mails que batem com os filtros.
                      page:
                        type: integer
                      limit:
                        type: integer
                      totalPages:
                        type: integer
              example:
                success: true
                data:
                  - id: clxx123...
                    to: cliente@example.com
                    from: noreply@seudominio.com
                    fromName: Suporte
                    subject: Confirmação
                    status: SENT
                    scheduledFor: null
                    sentAt: '2025-02-16T12:00:00.000Z'
                    deliveredAt: null
                    failedAt: null
                    errorMessage: null
                    createdAt: '2025-02-16T11:59:58.000Z'
                pagination:
                  total: 42
                  page: 1
                  limit: 20
                  totalPages: 3
        '400':
          description: '`emailDomainId` informado não existe neste workspace.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfEmail_ErrorResponse'
        '401':
          description: API Key ausente ou inválida.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfEmail_ErrorResponse'
        '403':
          description: >-
            Escopo email:read ausente, ou `emailDomainId` não permitido para a
            API Key (restrição **domainIds**), ou listagem com chave restrita a
            domínios sem acesso ao filtro solicitado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NtfEmail_ErrorResponse'
components:
  schemas:
    NtfEmail_EmailListItem:
      type: object
      description: >-
        Metadados de envio retornados na listagem e em GET por ID; a API sempre
        devolve todos estes campos (nullable onde indicado).
      required:
        - id
        - to
        - from
        - fromName
        - subject
        - status
        - scheduledFor
        - sentAt
        - deliveredAt
        - failedAt
        - errorMessage
        - createdAt
      properties:
        id:
          type: string
          description: ID (cuid) do e-mail.
        to:
          type: string
          description: Destinatário.
        from:
          type: string
          description: Remetente (endereço verificado).
        fromName:
          type: string
          nullable: true
        subject:
          type: string
        status:
          type: string
          enum:
            - QUEUED
            - SCHEDULED
            - PROCESSING
            - SENT
            - DELIVERED
            - OPENED
            - CLICKED
            - FAILED
            - CANCELLED
            - COMPLAINED
          description: Status atual do e-mail.
        scheduledFor:
          type: string
          format: date-time
          nullable: true
        sentAt:
          type: string
          format: date-time
          nullable: true
        deliveredAt:
          type: string
          format: date-time
          nullable: true
        failedAt:
          type: string
          format: date-time
          nullable: true
        errorMessage:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
    NtfEmail_ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: 'Rótulo HTTP do erro (ex.: Unauthorized, Bad Request, Not Found).'
        message:
          type: string
          description: >-
            Mensagem legível para exibir ao usuário (localizada via
            Accept-Language / x-locale quando aplicável).
        code:
          type: string
          description: >-
            Código estável da API v1 (enum). Sempre presente em erros. Use com o
            status HTTP para decidir retry ou correção. Ver [Respostas de
            erro](/guides/conceitos/resposta-de-erros).
        details:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
        data:
          type: object
          description: 'Dados adicionais em alguns erros (ex.: status do e-mail em cancel).'
      required:
        - success
        - error
        - message
        - code
  securitySchemes:
    ntfEmailBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API Key no header Authorization. Exemplo: `Authorization: Bearer
        sk_live_xxxxx`
    ntfEmailApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: 'API Key no header x-api-key. Exemplo: `x-api-key: sk_live_xxxxx`'

````