Edit email API
Api call to subrite to edit email
- Method:
PATCH
- Route:
{baseUrl}/api/v1/communications/email/edit/:id
## id - Authorization: Bearer token (use the m2m token collected in ## configuration)
- Body: See example below
Update Email Template
All fields are optional in the update request. Only the fields included in the request body will be updated, other fields will remain unchanged.
Example Request Body:
{
// Optional fields - include only what you want to update
"communicationType": "marketing", // Optional: "marketing" or "information"
"name": "coming from external", // Optional: template name
"senderId": 2, // Optional: sender ID
"consentId": null, // Optional: consent ID
"segmentId": 1, // Optional: segment ID
"subject": "email subject", // Optional: email subject
"emailPreviewText": "sample", // Optional: preview text
"emailContent": "<div>hello world</div>" // Optional: email HTML content
}
Usage Notes:
- Include only the fields you want to update
- Omitted fields will retain their existing values
- Partial updates are supported
- All fields are optional
Example Partial Update:
// Only updating email content and subject
{
"subject": "Updated Subject",
"emailContent": "<div>New content</div>"
}
Success API response :
{
"id": 156,
"name": "yy",
"communicationType": "information",
"smsContent": null,
"subject": "demo test",
"emailEditorRawContent": null,
"emailPreviewText": "demo preview data",
"template": null,
"status": "ready",
"communicationChannel": "email",
"createdAt": "2025-03-24T11:33:08.872Z",
"updatedAt": "2025-03-25T16:15:39.170Z",
"senderId": 1,
"sender": "mitsiden-email",
"segmentId": 1,
"segmentName": "Bangladeshi members",
"consentId": null,
"tenantId": 1,
"adminUserId": null,
"scheduledAt": null,
"completedAt": null,
"emailHtmlPreview": null,
"deliveryMethod": "API"
}