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

# List Emails

> List emails (conversations) for a project. Returns lightweight metadata including subject, status, and screenshot URL.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/projects/emails
openapi: 3.1.0
info:
  title: Migma.ai API (v1)
  description: >-
    API for managing brands, contacts, email generation, sending, and
    integrations.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.migma.ai
    description: Production
security:
  - apiKeyAuth: []
tags:
  - name: Projects/Brands
    description: Manage projects (brands) and import from websites
  - name: Contacts
    description: Manage your contacts, segments, tags, and topics
  - name: Segments
    description: Create and manage dynamic contact segments
  - name: Tags
    description: Organize contacts with tags
  - name: Topics
    description: Manage subscription topics and preferences
  - name: Emails
    description: Generate, send, and export emails
  - name: Email Validation
    description: Validate email content for compatibility and deliverability
  - name: Email Previews
    description: Preview emails across devices and email clients
  - name: Domains
    description: Manage sending domains and verification
  - name: Webhooks
    description: Manage webhook endpoints for real-time event notifications
  - name: Events
    description: Record customer events and conversions
  - name: Integrations
    description: Third-party platform integrations
  - name: Campaigns
    description: Create, schedule, send, and manage email campaigns
  - name: Project Editing
    description: Edit project assets, logos, images, and knowledge base entries
paths:
  /v1/projects/emails:
    get:
      tags:
        - Emails
      summary: List Emails
      description: >-
        List emails (conversations) for a project. Returns lightweight metadata
        including subject, status, and screenshot URL.
      operationId: ListEmails
      parameters:
        - name: projectId
          in: query
          description: Project ID to list emails for
          required: true
          schema:
            type: string
            pattern: ^[0-9a-fA-F]{24}$
        - name: limit
          in: query
          description: Maximum number of results (1-100)
          required: false
          schema:
            type: integer
            format: int32
            default: 20
            minimum: 1
            maximum: 100
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            format: int32
            default: 1
            minimum: 1
        - name: status
          in: query
          description: Filter by generation status
          required: false
          schema:
            type: string
            enum:
              - pending
              - processing
              - completed
              - failed
        - name: search
          in: query
          description: Search by title or subject
          required: false
          schema:
            type: string
      responses:
        '200':
          description: List of emails
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ListEmailsData'
        '400':
          description: Validation error
        '401':
          description: Unauthorized
        '403':
          description: Forbidden — no access to this project
      x-codeSamples:
        - lang: javascript
          label: Node.js SDK
          source: |-
            import Migma from 'migma';

            const migma = new Migma('YOUR_API_KEY');

            const { data, error } = await migma.emails.list({
              projectId: 'PROJECT_ID',
              limit: 10,
              status: 'completed'
            });
        - lang: bash
          label: CLI
          source: >-
            migma emails list --project PROJECT_ID --limit 10 --status completed
            --json
components:
  schemas:
    ApiResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          nullable: true
        error:
          type: string
          nullable: true
      required:
        - success
    ListEmailsData:
      type: object
      properties:
        emails:
          type: array
          items:
            $ref: '#/components/schemas/ListEmailsEmail'
        pagination:
          type: object
          properties:
            total:
              type: integer
              description: Total number of emails
            page:
              type: integer
              description: Current page number
            limit:
              type: integer
              description: Results per page
            hasMore:
              type: boolean
              description: Whether more results exist
    ListEmailsEmail:
      type: object
      properties:
        conversationId:
          type: string
          description: The conversation ID
        title:
          type: string
          description: Conversation title (truncated prompt)
        subject:
          type: string
          nullable: true
          description: Email subject line
        previewText:
          type: string
          nullable: true
          description: Email preview text
        status:
          type: string
          enum:
            - pending
            - processing
            - completed
            - failed
          description: Generation status
        screenshotUrl:
          type: string
          nullable: true
          description: Email screenshot URL
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Use 'Authorization: Bearer YOUR_API_KEY' where
        YOUR_API_KEY is obtained from the Migma dashboard under Settings →
        Developers → API Keys.

````