deleteMessage) permission in Authorization: Bearer <API_KEY>.404. A broadcast or a forum topic's main post in the key's community returns 409. Send the message ID in the path and leave the request body empty.200 confirms that the message was removed. Returning.AI also attempts to reverse rewards earned from the message and its reactions. Some of that work runs after the response. If you receive partial: true, the message was removed and an associated action failed. Ask support to check the side effects using the returned messageId.401 with Invalid token. An invalid key returns 401 with Invalid API key. A community key missing Delete Messages permission returns 401 with Your API key does not have permission to access this action. The permission error contains only message.404 once the message is gone. After a timeout or 503, read the channel to check the outcome before trying the same ID again. A 404 on its own can also mean the message is outside your community, so check the ID and channel if you have no earlier confirmation. Retrying a deleted message does not rerun its reward reversals.| HTTP | What to do |
|---|---|
| 400 | Copy the 24-character message id from Get messages. |
| 401 | Use a valid community API key with Delete Messages permission. A missing key, invalid key and missing permission all return 401. |
| 404 | Check the ID and community. If you already confirmed the original deletion, stop retrying. |
| 409 | Use the community's moderation controls for a broadcast or a forum topic's main post. |
| 500 | Retry with backoff when authentication is available again. |
| 503 | Check whether the message is still visible and retry with the same ID if needed. |
curl --location --request DELETE 'https://api.returning.ai/v1/messages/66f000000000000000000a21' \
--header 'Authorization: Bearer <token>'{
"status": "success",
"message": "Message deleted",
"messageId": "66f000000000000000000a21"
}