# Message API - Delete

Use this endpoint to delete a message from your account.

---

## Endpoint

```
DELETE https://e1.envoke.com/v2/messages/{ID}
```

Replace `{ID}` with the Envoke message ID you want to delete. Authentication is via HTTP Basic Auth using your API ID and API Key. No request body is needed.

---

## Important

**Deletion moves the message to the Deleted folder.** The message disappears from the API at once: a GET for it returns `[]`, and it is no longer listed. In Envoke, it appears in the **Deleted** folder of the message list, for 60 days, where it can be restored; after that Envoke's scheduled cleanup removes it permanently. Restoring is possible only in Envoke; the API has no restore endpoint.

**A scheduled message is unscheduled.** Deleting a `Scheduled` message sets it back to `Draft` as well, so it is not sent. There is no need to [cancel](https://envoke-developers.pages.dev/v2/messages/sending/#cancel) it first.

**Messages in most statuses can be deleted**, including `Sent` messages. These cannot:

| Message | Why |
|---|---|
| Status `Sending` | Emails are going out. Wait until the message is `Sent`. |
| Part of a nurture series | Remove it from the nurture campaign in Envoke first. |
| Envoke system or offer messages | These are managed by Envoke. |

---

## Response

### Success

```json
{
  "success": true,
  "result_data": [],
  "result_text": "Deleted"
}
```

### Message not found

Returned with HTTP status `400` when the ID does not match a message in your account. This uses the plain envelope, not the validation envelope:

```json
{
  "success": false,
  "result_data": [],
  "result_text": "Item with id '2099' not found"
}
```

### Blocked messages

Returned with HTTP status `400`, in the same plain envelope, when the message cannot be deleted:

| `result_text` | Cause |
|---|---|
| `Message: 'Spring Season Announcement' is currently sending` | The message's status is `Sending`. |
| `This message cannot be deleted because it's part of the automated series: "Welcome Sequence"` | A `Nurture` message that belongs to a nurture campaign. |
| `System messages cannot be deleted` or `Offer messages cannot be deleted` | A message Envoke manages. |

### Database error

If the delete fails on the server, `result_text` is `Delete error: ` followed by the error detail, with HTTP status `400`. Retry the request; if it keeps failing, contact Envoke support.

---

## Example

```bash
curl -X DELETE -gs \
  -u "$API_ID:$API_KEY" \
  "https://e1.envoke.com/v2/messages/2009"
```

Replace `2009` with the ID of the message you want to delete, and substitute your actual API ID and API Key.

A `GET https://e1.envoke.com/v2/messages/2009` afterwards returns `[]`.

To find the ID of a message from its name first:

```bash
curl -X GET -gs -u "$API_ID:$API_KEY" \
  "https://e1.envoke.com/v2/messages?name=Auditions%20Open&fields=id&limit=1"
```

---

*Note: The curl examples above are formatted for readability. All requests must use properly encoded URLs.*

*Full reference, OpenAPI description, and Postman collection: [developers.envoke.com](https://developers.envoke.com).*
