Report a message as spam
const url = 'https://api.inboxcnx.com/v1/messages/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/report-spam';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.inboxcnx.com/v1/messages/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/report-spam \ --header 'Authorization: Bearer <token>'Reports a message as spam to the provider and moves it to the spam folder, which also trains the provider’s filter. The provider empties its spam folder on its own schedule (Gmail after 30 days). The stored copy stays.
Requires the report:spam scope.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”The message’s new state
object
object
object
Example
{ "id": "c4a7e2b9-1d3f-4e6a-8b0c-5f2d9e7a1b34", "keywords": { "$seen": true }, "labels": { "system": [ "junk" ], "custom": [] }, "stateAt": "2026-10-23T08:00:00.000Z"}The id is not a UUID
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}The credential lacks the report:spam scope
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}message_not_found: no such message. provider_message_not_found: the provider no longer has it
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}message_deleted: the mail is deleted at the provider. connection_unreadable: the mailbox cannot be reached and may need a reconnect. connection_scope_missing: the end user did not grant the scope the action needs, named in scope. A reconnect grants it
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}provider_unavailable: the provider is down or rate-limits the mailbox. Retry after Retry-After seconds
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}