A customer submitted a question asking where to get the messageId
value in order to delete a message using the DELETE /api/addresses/:email/messages/:messageId
endpoint.
Deleting a Specific Message
-
List messages in the inbox to get messageId
curl -H 'Mailsac-Key: YOUR_API_KEY_HERE' https://mailsac.com/api/addresses/[email protected]/messages
. The REST API will return a JSON object that contains the_id
field. This is the messageId (in this example our messageId isBotvTxaona7gLID1Adtpfj8Fnfi7HSSv-0
). -
Delete message using the messageId
curl -H 'Mailsac-Key: YOUR_API_KEY_HERE' -X DELETE https://mailsac.com/api/addresses/[email protected]/messages/BotvTxaona7gLID1Adtpfj8Fnfi7HSSv-0
In addition to deleting a specific message, all messages in an inbox can be deleted.
Example:
curl -H 'Mailsac-Key: YOUR_API_KEY_HERE' -X DELETE https://mailsac.com/api/addresses/[email protected]/messages