Emails

Edit Email With Prompt

Changed on

Prompt Migma to edit one generated email as a canvas follow-up turn (same orchestrator path as design chat). Omit async or set it to false to wait for the edited Email response; this existing synchronous write is not idempotent and the SDK does not automatically retry it. Set async to true to durably enqueue the edit with no AI work on the request path and receive an EmailEditOperation. Async edits require email:write and email:read; credits are checked when the worker starts. Poll the edit-specific status endpoint and do not use conversation generation status, because a previous conversation turn may already be completed. Total work varies with section and image complexity, provider behavior, and retries; no fixed maximum latency is established.

post/v1/emails/{emailId}/edit

Request

  • Base URL
    https://api.migma.ai
  • URL
    https://api.migma.ai/v1/emails/{emailId}/edit
  • Auth
    API key in header Authorization

Path parameters

emailIdstring required

Email ID returned in generation status result.emails[].emailId.

Headers

Idempotency-Keystring

Optional key of at most 100 characters for async edits only. For the same authenticated API key and email, reusing the key with the same prompt and label returns the same job; a conflicting body returns 409 IDEMPOTENCY_CONFLICT. The receipt remains available for at least 24 hours after terminal completion under normal cleanup. Reuse the same key after an uncertain async start.

Request body

promptstring required

Natural-language edit request, e.g. "Make this shorter and more transactional".

labelstring

Optional version label.

asyncboolean

Set true to durably enqueue the edit and return 202. Omit or set false to keep the existing synchronous 200 Email response.

Response

Synchronous edit completed. Returned when async is omitted or false.

successboolean required
errorstring nullable

Changes

    • breaking

      the request property's minLength was increased from 0 to 1

    • breaking

      the request property's minLength was increased from 0 to 1

    • warning

      the request property's maxLength was set to 120

    • warning

      the request property's maxLength was set to 20000

    • info

      added the new optional header request parameter Idempotency-Key

    • info

      added the new optional request property

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the success response with the status