Skip to main content
PATCH
/
v1
/
emails
/
{artifactId}
Node.js SDK
import Migma from 'migma';

const migma = new Migma('YOUR_API_KEY');

const { data, error } = await migma.emails.update('ARTIFACT_ID', {
  source: updatedMigmaEmailSource
});
{
  "success": true,
  "data": {
    "artifactId": "<string>",
    "conversationId": "<string>",
    "messageId": "<string>",
    "slotIdx": 123,
    "slotUuid": "<string>",
    "status": "<string>",
    "subject": "<string>",
    "preheader": "<string>",
    "html": "<string>",
    "templateVariables": [
      {}
    ],
    "warnings": [
      "<string>"
    ],
    "thumbnailUrl": "<string>",
    "updatedAt": "2023-11-07T05:31:56Z",
    "source": "<string>"
  },
  "error": "<string>"
}

Authorizations

Authorization
string
header
required

API key authentication. Use 'Authorization: Bearer YOUR_API_KEY' where YOUR_API_KEY is obtained from the Migma dashboard under Settings → API Integration.

Path Parameters

artifactId
string
required

Email artifact ID returned in generation status result.emails[].artifactId or shown in Publish -> Send via API.

Pattern: ^[0-9a-fA-F]{24}$

Body

application/json
source
string
required

Replacement Migma Email source to compile and save.

vars
object

Preview variables used while compiling.

lang
string

Preview locale used while compiling.

label
string

Optional version label.

Response

Email artifact updated

success
boolean
required
data
object
error
string | null