Reference

Update and delete messages

Change a message’s flags or folder with PATCH, and remove it with DELETE.

TuskMail API: Update and delete messages

Update a message

PATCH/v1/messages/{id}
NameTypeDescription
is_readbooleanMark read or unread.
is_starredbooleanStar or unstar.
folderstringMove to this folder (a role such as trash, or a folder id).

Send only the fields you want to change. The response is the updated message object.

curl -X PATCH "https://api.tuskmail.africa/v1/messages/Mabc123" \
  -H "X-API-Key: $TK_API_KEY" \
  -u "$MAILBOX_EMAIL:$APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{
  "is_read": true,
  "is_starred": true,
  "folder": "inbox"
}'

Delete a message

DELETE/v1/messages/{id}
NameTypeDescription
permanentbooleanIf true, delete permanently instead of moving to Trash. Default false.
curl -X DELETE "https://api.tuskmail.africa/v1/messages/Mabc123?permanent=false" \
  -H "X-API-Key: $TK_API_KEY" \
  -u "$MAILBOX_EMAIL:$APP_PASSWORD"

Returns 204 No Content with no body.