> ## 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.

# Get Email Generation Status

> Check email generation status. When completed, returns primary email HTML plus result.emails[] for every generated email, including emailId, subject, HTML, screenshot URL, and series order.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/projects/emails/{conversationId}/status
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: 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/{conversationId}/status:
    get:
      tags:
        - Emails
      summary: Get Email Generation Status
      description: >-
        Check email generation status. When completed, returns primary email
        HTML plus result.emails[] for every generated email, including emailId,
        subject, HTML, screenshot URL, and series order.
      operationId: GetEmailGenerationStatus
      parameters:
        - name: conversationId
          in: path
          description: The conversation ID returned from the generate endpoint
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Email status retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseEmailStatus'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-codeSamples:
        - lang: javascript
          label: Node.js SDK
          source: >-
            import Migma from 'migma';


            const migma = new Migma('YOUR_API_KEY');


            const { data } = await
            migma.emails.getGenerationStatus('CONVERSATION_ID');


            for (const email of data.result?.emails || []) {
              console.log(email.emailId, email.subject, email.html, email.screenshotUrl);
            }
components:
  schemas:
    ApiResponseEmailStatus:
      allOf:
        - $ref: '#/components/schemas/ApiResponse'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/EmailStatusData'
    ApiResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          nullable: true
        error:
          type: string
          nullable: true
      required:
        - success
    EmailStatusData:
      type: object
      properties:
        conversationId:
          type: string
        status:
          type: string
          enum:
            - pending
            - processing
            - completed
            - failed
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        error:
          type: string
          description: Error message if status is failed
        result:
          type: object
          description: >-
            Full email content and metadata, present when status is completed.
            result.html/result.subject identify the primary email; use
            result.emails[] for per-email IDs, HTML, screenshots, and series
            order.
          properties:
            subject:
              type: string
              description: Email subject line
            previewText:
              type: string
              description: Email preview text shown in inbox
            html:
              type: string
              description: Production-ready HTML for the primary email.
            screenshotUrl:
              type: string
              format: uri
              description: URL to email screenshot preview
            screenshotFullUrl:
              type: string
              format: uri
              description: URL to full-length email screenshot
            stats:
              type: object
              description: Email statistics and metadata
              properties:
                imageCount:
                  type: integer
                  description: Number of images in the email
                buttonCount:
                  type: integer
                  description: Number of buttons/CTAs in the email
                estimatedLength:
                  type: string
                  description: Estimated email length (short, medium, long)
                colors:
                  type: array
                  items:
                    type: string
                  description: Colors used in the email
            languages:
              type: array
              items:
                type: string
              description: Languages the email was generated in
            emails:
              type: array
              items:
                $ref: '#/components/schemas/GeneratedEmail'
              description: >-
                All active generated emails. Use emailId from this array to
                fetch, edit, test-send, or send one email from a series.
            seriesPlan:
              type: object
              additionalProperties: true
              description: >-
                Series planning metadata when the generation produced multiple
                emails.
      required:
        - conversationId
        - status
        - createdAt
        - updatedAt
    ApiError:
      type: object
      properties:
        success:
          type: boolean
          default: false
        error:
          type: string
      required:
        - success
        - error
    GeneratedEmail:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          description: >-
            Stable generated email ID. Use this to fetch, edit, export,
            test-send, or send one email.
        emailId:
          type:
            - string
            - 'null'
          description: Stable generated email ID. Same value as id.
        conversationId:
          type: string
        messageId:
          type:
            - string
            - 'null'
        slotIdx:
          type: integer
          description: Zero-based slot index in the generated series.
        slot:
          type: integer
          description: One-based slot number for display.
        subject:
          type: string
        preheader:
          type: string
        html:
          type: string
          description: Production-ready email HTML for this email.
        sendOffsetDays:
          type: integer
          description: Suggested send offset in days for series emails.
        status:
          type: string
          enum:
            - ready
            - processing
            - failed
        screenshotUrl:
          type:
            - string
            - 'null'
          format: uri
          description: Rendered email screenshot URL when available.
        thumbnailUrl:
          type:
            - string
            - 'null'
          format: uri
          description: Alias of screenshotUrl when available.
      required:
        - id
        - emailId
        - conversationId
        - messageId
        - slotIdx
        - slot
        - subject
        - preheader
        - html
        - status
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  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 → API
        Integration.

````