---
title: "Delete an email record"
method: DELETE
path: "/appmail/{id}"
tags: ["App Mail Records"]
---

# Delete an email record

`DELETE /appmail/{id}`

## Request

- Base URL: `https://api.surense.com/api/v1`
- URL: `https://api.surense.com/api/v1/appmail/{id}`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://api.surense.com/oauth/token`

Deletes a logged email record (activity log type 2) and publishes an `EAppMailDeletedEvent` carrying the linked entity IDs, sender, recipients, subject and the EML/HTML file keys. Returns 200 with an empty body.

The record is looked up within the caller's tenant, and the caller must also be allowed to access the entity the email is linked to (employer, customer, lead, workflow or meeting, checked in that order); otherwise that entity's access check rejects the request.

The required permission depends on the entity the email is linked to, checked in this order: meeting, lead, workflow, employer, customer. The caller needs `<entity>:delete_my_items` (for example `customers:delete_my_items`), plus `<entity>:delete_all_items` when another user created the record. These permissions are checked in the service layer, not as an OAuth2 scope on the endpoint.

Errors: 400 if `id` is missing or not a UUID; 403 if the delete permission is missing; 404 if the record does not exist in the caller's tenant.

## Path parameters

- `id` string, uuid, required

## Response `200`

Email record deleted; empty body.

## Other responses

- `400`: The `id` path variable is missing or not a UUID.
- `403`: The caller lacks the delete permission for the linked entity.
- `404`: Email record not found.

---

[API](https://skmtc.dev/surense/apis/appmail-api.md) - [All operations](https://skmtc.dev/surense/apis/appmail-api/llms.txt) - [OpenAPI document](https://skmtc.dev/surense/apis/appmail-api/revisions/dd959778fa2e?raw)
