PATCH
/api/public/v1/emails/{emailId}Update an email
Marks a message read or unread, stars it, or moves it to a folder. `folder` is the whole filing system: `null` puts it back in its natural place, `archive`, `junk` and `trash` are the system folders, and any other value is a custom folder id. **Deleting mail is moving it to `trash`** — there is no destructive delete here.
Required scope
The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Settings → Company → API, and to a teammate under Employee → Permissions.
email:messages:write
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
emailId | string | Required | Email ID. |
Request Body
| Property | Type | Description |
|---|---|---|
unread | boolean | |
starred | boolean | |
folder | string | null, `archive`, `junk`, `trash`, or a custom folder id. |
PATCHExample request
curl
curl -X PATCH "https://www.pxb.app/api/public/v1/emails/{emailId}" \
-H "Authorization: Bearer your_access_token" \
-H "Content-Type: application/json" \
-d '{
"folder": "archive",
"unread": false
}'200Example response
json
{
"message": "Email updated successfully!",
"content": {
"email": {
"id": "eml_3390",
"from": "sam@acme.example",
"to": "ap@northwind.example",
"subject": "Invoice 1042",
"text": "Attached is the invoice for phase one.",
"html": null,
"direction": "OUTBOUND",
"threadId": "eml_3390",
"unread": false,
"starred": false,
"folder": "archive",
"accountId": "acc_7712",
"createdAt": "2026-08-22T15:04:00.000Z",
"updatedAt": "2026-08-22T15:04:00.000Z"
}
}
}In the console
The same thing done by hand, for anyone comparing the API against the screen they already use.