Page through a workspace's unrouted inbound emails.
const url = 'https://example.com/api/workflows/email-unrouted/page?workspace_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0&direction=asc';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/api/workflows/email-unrouted/page?workspace_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0&direction=asc'Returns one bounded window of inbound messages no workflow alias claimed, with the cursor of the next window. The cursor is present even when a window holds only mail of other workspaces, so a client can always continue the scan.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Responses
Section titled “Responses”OK
object
Wrapper item used by list_unrouted_messages: the summary + whether this
message looks like it belongs to the given workspace.
object
true only when current or retained exact issued-recipient evidence names this workspace.
A summary of one message in Unrouted/ – the row the admin UI renders.
object
From: value, verbatim.
Opaque original account identity accompanying an actual live SELECT.
Best-effort received-at (the Date: header verbatim, since the IMAP
INTERNALDATE differs across providers); empty when absent.
The full set of recipient header values (To, Delivered-To,
X-Original-To) so an admin can see which alias was attempted.
Subject: value – empty when absent.
IMAP UID inside the Unrouted/ folder.
Original SELECT generation accompanying this exact UID. Pure unscoped summary helpers omit it; live admin list items always provide it.
Unknown until an authoritative full tenant count is available; scanned is not a total.
The Unrouted folder’s UIDVALIDITY. 0 (never a real UIDVALIDITY, RFC 3501) only on the
empty, complete first page of a mailbox whose Unrouted folder does not exist yet.
Example generated
{ "cursor": "example", "items": [ { "matches_workspace": true, "summary": { "from": "example", "mailbox_key": "example", "received_at": "example", "recipients": [ "example" ], "subject": "example", "uid": 1, "uid_validity": 1 } } ], "mailbox_key": "example", "scan_complete": true, "scanned": 1, "total": 1, "uid_validity": 1}No central mailbox is configured, or the mailbox cannot open its Unrouted folder: it refused it, or the folder vanished between pages
The canonical JSON body of every error response. Every AppError serializes as
this exact shape; code is the generated stable machine-readable vocabulary.
object
Present only on an MCP budget refusal (429) — the refusing layer + retry hint.
object
The refusing layer.
The layer’s budget.
Seconds until a retry can pass, or null when it never will for this session.
Calls already counted in the layer.
Machine-readable, stable error code.
Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.
object
The entitlement feature key that was hit, e.g. apps.max_count.
The plan’s limit for this key.
Where to send the user to upgrade.
Current usage (count or bytes, per the key).
Human-readable message (the server’s English text; the client may localize
by code).
Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.
object
Weighted workspace slots already held by starting/running agent runs.
The budget cap that refused.
Effective spend of the refusing budget scope (spend + in-flight reservations).
The workspace’s configured agent-concurrency cap.
The provider whose budget cap refused; absent for the workspace-wide cap.
Runner labels a fail-policy placement required and no runner offered.
Example
{ "code": "not_found"}