---
title: "Import HTML Email (Async)"
method: POST
path: "/v1/projects/emails/import-html"
tags: ["Emails"]
---

# Import HTML Email (Async)

`POST /v1/projects/emails/import-html`

Convert existing HTML or .eml into editable Migma emails using the same HTML to Email path as Create. Requires API key with email:write. Provide html for one file or htmls (1-12). Optional instruction describes keep-as-is vs apply-brand. Returns immediately with a conversationId and pending status. Use GET /v1/projects/emails/{conversationId}/status to retrieve production HTML, screenshots, and per-email IDs. Do not send HTML to generate.

## Request body

- ImportHtmlEmailRequest
  - `projectId` string, required
  - `html` string — Single HTML or .eml source. Provide html or htmls, not both.
  - `name` string — Filename for a single html paste.
  - `htmls` ImportHtmlEmailFile[] — Multiple HTML or .eml files. One file becomes one canvas slot.
    - `name` string, required — Filename, e.g. welcome.html or message.eml
    - `source` string, required — HTML document or raw .eml source. Max 250KB per file.
  - `instruction` string — Natural-language conversion instruction (keep as-is vs apply brand).
  - `languages` string[]
  - `visibility` 'private' | 'unlisted' | 'public'
  - `generateMedia` boolean — Generate AI media for missing images. Defaults to the project setting, then true.

## Response `200`

HTML import started

- ApiResponseGenerateEmail
  - `success` boolean, required
  - `data` object, nullable
    - `conversationId` string, required — The conversation ID to check status and retrieve results
    - `status` 'pending', required — Initial status is always pending
    - `message` string, required — Information message about the generation process
    - `link` string, uri, required — Direct link to view the generated email. Unlisted and public generations return https://migma.ai/share/{conversationId}; private generations return https://migma.ai/chat?c={conversationId}.
    - `count` integer — Requested email count, when provided.
    - `referenceId` string — Reference conversation used for remixing, when provided.
  - `error` string, nullable

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Resource not found

## Changes

- **2026-08-24** `cf2696d3899f` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/migma/apis/migma-ai-api-v1/changes/v1/projects/emails/import-html/post.md)

---

[API](https://skmtc.dev/migma/apis/migma-ai-api-v1.md) · [All operations](https://skmtc.dev/migma/apis/migma-ai-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/migma/migma-ai-api-v1/revisions/6b3357db6cf6/schema)
