POST
/v1/me/mail/messages/{id}/restoreIts 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}'
| Field | Type | Description |
|---|---|---|
conversation | boolean | Restore the whole exchange. Defaults to false |
Response
The message as a list row, with its new folder.
Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | missing_idempotency_key | Every POST needs one |
| 403 | insufficient_scope | This device does not hold mail:write |
| 404 | resource_not_found | No such message in a mailbox you can read. A number in the path finds none either |