# Edit email

**Summary:** Update an email by its ID with a PATCH request. All fields are optional and only the fields you send are changed. The old route /communications/email/edit/:id is deprecated.

- Space: [Developers](https://www.subrite.no/developers)
- Source: https://www.subrite.no/developers/email-edit
- Updated: 2026-09-23
- Markdown index: https://www.subrite.no/developers/llms.txt

Edit an email in Subrite.

- **Method:** `PATCH`
- **Route:** `{baseUrl}/api/v1/communications/:id/email/edit` (get the `:id` from the [email list](https://www.subrite.no/developers/email-lists?md=true))
- **Authorization:** Bearer token (use the M2M token from [Setup](https://www.subrite.no/developers/email-setup?md=true))
- **Body:** see the example below

> [!WARNING]
> **Deprecated**
>
> As of **October 28, 2025**, the old route `PATCH {baseUrl}/api/v1/communications/email/edit/:id` is **deprecated**.
>
> Please migrate to `PATCH {baseUrl}/api/v1/communications/:id/email/edit`.
>
> The old route will continue to function temporarily but may be removed in a future release.

<a id="request-body"></a>
## Request body

All fields are optional in the update request. Only the fields included in the request body will be updated; other fields will remain unchanged.

<a id="example-request-body"></a>
### Example request body

```javascript
{
  // 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
}
```

<a id="usage-notes"></a>
## 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

<a id="example-partial-update"></a>
## Example partial update

```javascript
// Only updating email content and subject
{
  "subject": "Updated Subject",
  "emailContent": "<div>New content</div>"
}
```

<a id="success-response"></a>
## Success response

```json
{
  "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"
}
```
