Skip to content

Delete a message (move to Trash, or expunge)

DELETE
/v1/inboxes/{inbox_id}/messages/{id}

Move a message to the Trash folder (a recoverable soft delete). Pass ?expunge=true to permanently remove it instead. A message already in Trash is always expunged. Requires mailbox:read plus mailbox:create (or mailbox:delete); the owning agent’s default key carries both capabilities.

inbox_id
required
string

Opaque inbox id (the canonical path key). The inbox’s email address is also accepted here as a within-project alias. Treat the id as opaque.

id
required
string

Opaque message id (msg_...). Encodes its owning inbox.

expunge
boolean

Permanently remove instead of moving to Trash.

Delete outcome.

Outcome of a message or thread delete.

object
id
required

The message id or thread id that was deleted.

string
deleted
required

Always true on success.

boolean
expunged
required

True when the message(s) were permanently removed; false when moved to Trash (a recoverable soft delete).

boolean
count
required

Number of messages affected (1 for a message; the thread size for a thread).

integer

Invalid request.

The canonical error envelope. error is a stable machine code.

object
error
required

Stable error code (e.g. unauthorized, forbidden, not_found, invalid, quota_exceeded, rate_limited).

string
Example
forbidden
message

Human-readable detail (never leaks internals).

string
Example
missing required scope

Missing or invalid credential.

The canonical error envelope. error is a stable machine code.

object
error
required

Stable error code (e.g. unauthorized, forbidden, not_found, invalid, quota_exceeded, rate_limited).

string
Example
forbidden
message

Human-readable detail (never leaks internals).

string
Example
missing required scope

Authenticated but lacking the required scope, or out of quota.

The canonical error envelope. error is a stable machine code.

object
error
required

Stable error code (e.g. unauthorized, forbidden, not_found, invalid, quota_exceeded, rate_limited).

string
Example
forbidden
message

Human-readable detail (never leaks internals).

string
Example
missing required scope

Resource not found.

The canonical error envelope. error is a stable machine code.

object
error
required

Stable error code (e.g. unauthorized, forbidden, not_found, invalid, quota_exceeded, rate_limited).

string
Example
forbidden
message

Human-readable detail (never leaks internals).

string
Example
missing required scope