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

# Send Test Email

> Send a test email to one address. Use emailId for a specific generated email, especially emails inside a series. conversationId remains supported for single-email conversations. Requires API key with email:send permission.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/emails/test/send
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/emails/test/send:
    post:
      tags:
        - Emails
      summary: Send Test Email
      description: >-
        Send a test email to one address. Use emailId for a specific generated
        email, especially emails inside a series. conversationId remains
        supported for single-email conversations. Requires API key with
        email:send permission.
      operationId: SendTestEmail
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendTestEmailRequest'
      responses:
        '200':
          description: Test email sent successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponseTestEmailSent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '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, error } = await migma.emails.sendTest({
              emailId: 'EMAIL_ID',
              to: 'test@example.com'
            });
components:
  schemas:
    SendTestEmailRequest:
      type: object
      properties:
        emailId:
          type: string
          pattern: ^[0-9a-fA-F]{24}$
          description: >-
            Email ID to test-send. Recommended for generated emails and required
            for series slots.
        conversationId:
          type: string
          pattern: ^[0-9a-fA-F]{24}$
          description: Single-email conversation ID. For series, use emailId.
        to:
          type: string
          format: email
          description: Recipient email address
      required:
        - to
      anyOf:
        - required:
            - emailId
        - required:
            - conversationId
    ApiResponseTestEmailSent:
      allOf:
        - $ref: '#/components/schemas/ApiResponse'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/TestEmailSentData'
    ApiResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          nullable: true
        error:
          type: string
          nullable: true
      required:
        - success
    TestEmailSentData:
      type: object
      properties:
        messageId:
          type: string
          description: Message ID from the email service
        conversationId:
          type: string
          description: The conversation ID that was used
        sentTo:
          type: string
          format: email
          description: Recipient email address
        sentAt:
          type: string
          format: date-time
          description: Timestamp when the email was sent
        subject:
          type: string
          description: The subject line that was sent
      required:
        - messageId
        - conversationId
        - sentTo
        - sentAt
        - subject
    ApiError:
      type: object
      properties:
        success:
          type: boolean
          default: false
        error:
          type: string
        code:
          type: string
          description: >-
            Machine-readable error code (e.g., IDEMPOTENCY_CONFLICT,
            DOMAIN_CLAIMABLE).
        data:
          type: object
          description: >-
            Additional structured context for the error, such as the affected
            domain.
          additionalProperties: true
      required:
        - success
        - error
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Forbidden:
      description: Forbidden - Missing required permissions or access denied
      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.

````