Restore a message

.md

Put it back in the folder it came from.

Scopesmail:write
POST/v1/me/mail/messages/{id}/restore

Its own call rather than a folder on the patch, because where it goes back to is written on the message and not chosen by the client.

Falls back to the inbox when nothing was written down, which is the case for anything that landed in spam straight off the wire: it was never anywhere else, and the inbox is where the person rescuing it wants it.

Request

curl -X POST https://api.proppertrading.com/v1/me/mail/messages/msg_h3k8q2w7n4r9t5vx/restore \
  -H "Authorization: Bearer ptat_9f2c1a44_3b8e7d2f5c9a1b4e6d8f0a2c4e6b8d1f" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1e2a90-3c7d-4f2b-8e1a-9d0c4b5a6f31" \
  -d '{"conversation": true}'
FieldTypeDescription
conversationbooleanRestore the whole exchange. Defaults to false

Response

The message as a list row, with its new folder.

Errors

StatusCodeMeaning
400missing_idempotency_keyEvery POST needs one
403insufficient_scopeThis device does not hold mail:write
404resource_not_foundNo such message in a mailbox you can read. A number in the path finds none either