Skip to main content
POST
/
v1
/
projects
/
emails
/
generate
Generate Email (Async)
curl --request POST \
  --url https://api.migma.ai/v1/projects/emails/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "projectId": "<string>",
  "prompt": "<string>",
  "images": [
    {
      "source": {
        "type": "url",
        "url": "<string>"
      }
    }
  ],
  "model": "migmaAI-model-v0.1",
  "webMode": true,
  "languages": [
    "<string>"
  ],
  "visibility": "private",
  "referenceId": "<string>"
}
'
{
  "success": true,
  "data": {
    "conversationId": "<string>",
    "status": "pending",
    "message": "<string>",
    "link": "<string>"
  },
  "error": "<string>"
}

Authorizations

Authorization
string
header
required

JWT Bearer token authentication. Use 'Authorization: Bearer ' where the JWT token is obtained from the login endpoint.

Body

application/json
projectId
string
required
prompt
string
required
images
object[]
Maximum array length: 5
model
string
default:migmaAI-model-v0.1
webMode
boolean
default:true

Allow MigmaAI to do research, use connectors, mcp and more. It may take longer to generate the email. Use only if the prompt is unclear or requires additional information.

languages
string[]

The languages to generate the email in. If not provided, the email will be generated as instructed by the prompt.

Maximum array length: 5
visibility
enum<string>
default:private

Set the visibility of the generated conversation. Private conversations are only visible to the user, unlisted conversations are accessible via direct link but not listed publicly, and public conversations are visible in the public gallery.

Available options:
private,
unlisted,
public
referenceId
string

Optional conversation ID to remix so you can create personalized variants from an existing conversation.

Response

Email generation started

success
boolean
required
data
object
error
string | null