Simple Inbox
Cloudflare Inbox

API and Queue automation

Use bearer APIs and Cloudflare Queue events to connect downstream support workflows.

Cloudflare Inbox includes two automation surfaces at launch: bearer-protected API routes and optional Cloudflare Queue producer events.

Bearer API routes

Set API_TOKEN as a Worker secret if you want machine access.

Supported use cases include:

  • ad-hoc sends through POST /api/send,
  • replies to stored inbound messages through POST /api/reply,
  • archive and unarchive actions,
  • thread reads for support logging or enrichment,
  • raw EML and attachment downloads for authenticated processors.

Example:

curl --get "$APP_ORIGIN/api/threads/messages" \
  -H "Authorization: Bearer $API_TOKEN" \
  --data-urlencode "mailbox=support@example.com" \
  --data-urlencode "storageMessageId=$storageMessageId"

Queue producer events

When the INCOMING_EMAIL_QUEUE binding is present, Cloudflare Inbox enqueues a compact event after inbound mail or reply-alias relay handling succeeds.

The event contains metadata and storage references, not raw EML bytes or attachment bodies. Downstream systems can use the API routes to fetch the full thread or source files when needed.

Suggested downstream workflow

  1. Queue consumer receives a handled-inbound event.
  2. Consumer calls /api/threads/messages with API_TOKEN.
  3. Consumer logs the support thread, enriches it, or creates a ticket.
  4. Human replies from /app or a machine process replies through /api/reply.

On this page