Skip to content

Batch update messages (mark read/unread and/or move folder)

PATCH
/v1/inboxes/{inbox_id}/messages/batch

Mark read/unread and/or move folder for a list of message ids that all belong to this inbox. At least one of read / folder must be set. Partial failures (an id that is malformed or not owned by this inbox) are reported in failed rather than failing the whole batch. A folder move additionally requires the mailbox:create (or :delete) scope.

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.

Apply a read-state toggle and/or a folder move to a list of message ids that all belong to the path inbox. At least one of read / folder must be set. Ids that are malformed or address a different inbox are reported in the response’s failed list rather than failing the whole batch.

object
ids
required

Opaque message ids (msg_…), all owned by the path inbox. Max 200.

Array<string>
read

When present, set (true) or clear (false) the \Seen flag on each id.

boolean
folder

When present, move each message to this folder. One of INBOX, Sent, Trash, Junk, Archive.

string
Allowed values: INBOX Sent Trash Junk Archive

Per-id outcome.

Per-id outcome of a batch update.

object
updated
required

Ids that were updated.

Array<string>
failed
required

Ids skipped (not found, malformed, or not owned by this inbox).

Array<string>

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