agentic402

Webhook URL for AI agents: inbox

Published 3 December 2026 · Updated 3 December 2026

Webhook URL for AI agents, without a server: POST https://agentic402.dev/v1/inbox costs $0.01 and returns a public inbox_url plus a read_token. Any service can send requests to that URL for the next 7 days. The agent reads what arrived with GET /v1/inbox/{id} and the token, which is free.

Nothing has to be running while the agent waits. The callback is stored when it lands and read whenever the agent comes back.

# 1. create (paid, $0.01)
POST /v1/inbox
200 {"inbox_url": "https://agentic402.dev/in/911bd778e30d25b91227595148dd4d2e",
     "read_url":  "https://agentic402.dev/v1/inbox/911bd778e30d25b91227595148dd4d2e",
     "read_token": "<64 hex characters>", "expires_at": "2026-12-10T14:29:55.817Z"}

# 2. any service sends to inbox_url (free for the sender)
POST /in/911bd778e30d25b91227595148dd4d2e   {"event": "build.finished", "status": "passed"}
200 {"ok": true}

# 3. the agent reads, waiting up to 30 s for something new (free)
GET /v1/inbox/911bd778e30d25b91227595148dd4d2e?after=0&wait=30
Authorization: Bearer <read_token>

Why an agent can't take a webhook call by itself

A webhook is a request that another service sends to a URL you gave it, once something has happened: a payment cleared, a build finished, a long job on another API produced its result. To receive one, you need an address on the public internet and something listening at it when the request arrives.

Most agents have neither. A coding agent runs on a laptop behind a router. A hosted agent may run inside a container that exists only for the length of one task. An agent that has stopped to save money isn't listening at all. Some agent frameworks that accept webhooks expect you to run the receiving code yourself. Cloudflare's Agents SDK documentation, for example, shows webhook routes inside your own Worker and tells you to "Always verify webhook signatures before trusting or processing the payload".

An inbox moves the listening part somewhere that is always up. The service calls the inbox, the inbox stores the request, and the agent collects it later, whether that is two seconds or six days after it arrived.

Creating an inbox

Creation is the only paid step. The request takes no body. Send an empty POST and pay the 402. Each inbox is a separate Cloudflare Durable Object with its own SQLite storage, so one inbox's traffic never mixes with another's.

Fields returned by POST /v1/inbox
FieldWhat it is
inbox_urlThe public address to give the other service: https://agentic402.dev/in/ followed by 32 random hex characters.
read_urlWhere the agent reads stored requests.
read_token64 hex characters. Sent as Authorization: Bearer when reading. Only its SHA-256 hash is stored, so it can't be recovered if lost.
expires_atSeven days after creation. At that moment the inbox deletes everything it holds.

The inbox ID is 16 random bytes, so it can't be guessed or listed. That matters because anyone who knows an inbox URL can post to it. Treat the URL like an unlisted address: share it with the service that needs it and nobody else.

What gets stored from each request

The URL accepts any HTTP method: POST, PUT, GET, DELETE and the rest. For each request the inbox records the time it arrived, the method, the headers and the body. A body that is valid UTF-8 is stored as text; anything else, such as an image or a protobuf payload, is stored as base64 with body_encoding: "base64", so binary data comes back intact.

Headers are kept as sent, with one exception. Headers that would reveal the sender's IP address, and Cloudflare's own cf- headers, are dropped: cf-*, x-forwarded-*, x-real-ip and true-client-ip. Everything else stays, including signature headers such as Stripe-Signature or X-Hub-Signature-256, because you need them to check the request is genuine.

One stored item, as returned when reading
FieldExample or meaning
seq1, 2, 3… A counter per inbox. Pass the last one you saw as after.
received_atISO 8601 time the request arrived
methodPOST
headersObject of header names and values, minus the IP-revealing ones
bodyThe body as a string
body_encodingutf-8 or base64

The sender gets 200 {"ok": true} as soon as the request is stored. If the body is over 256 KB the sender gets 413, and if the inbox has expired or never existed, 404.

Which services can call an inbox

Anything that lets you type in a callback or webhook URL and then sends an ordinary HTTP request can deliver to an inbox. In practice that covers CI systems announcing that a build passed or failed, payment providers reporting a settled charge or a dispute, form tools posting a submission, and slow APIs that accept a job, return at once and call back with the result when it's done. Another agent can use it too: give it the URL and it can report back with a plain POST, no shared infrastructure needed.

Setting it up is the same everywhere. Create the inbox, paste the inbox_url into the provider's webhook or callback field, and send the provider's test event if it has one. Then read the inbox once with wait=0. If the test event is there, with the headers you expect, the wiring is right and the agent can stop and come back later.

Keep one inbox per job, or per provider, rather than one for everything. Separate inboxes keep the 1,000-item window and the 60-a-minute limit from being shared by unrelated traffic, and a leaked URL then exposes only one stream.

When to run your own receiver instead

An inbox is the shortest path for an agent with no server, but it isn't the right tool for every webhook. Run your own endpoint when the provider needs a computed reply during setup, when you expect more than 60 requests a minute to one URL, when bodies can exceed 256 KB, or when you need the data kept longer than 7 days. Frameworks such as Cloudflare's Agents SDK are built for that case: the receiver is your code, so it can answer however the provider requires and store events for as long as you like.

The trade is that your receiver has to be deployed, reachable and running at the moment the provider calls. For an agent that exists for one task at a time, that's the part an inbox removes.

Reading with a cursor and a long poll

Reads return up to 100 items with a sequence number greater than after, oldest first, plus next_after, the number to send next time. Start at 0. Because the cursor is yours, a crashed or restarted agent can carry on from where it stopped by keeping one integer, or start over from 0 and see everything still stored.

The wait parameter, from 0 to 30 seconds, turns a read into a long poll. When nothing new has arrived, the request stays open and the inbox checks once a second; it answers as soon as an item lands, or with an empty list when the wait runs out. A loop that reads with wait=30 makes at most two requests a minute while idle and still reacts within about a second.

let after = 0;
for (;;) {
  const r = await fetch(`${readUrl}?after=${after}&wait=30`, {
    headers: { Authorization: `Bearer ${readToken}` },
  });
  const { items, next_after } = await r.json();
  for (const item of items) handle(item);   // item.body, item.headers
  after = next_after;
  if (done) break;
}

Reading never costs anything, but it does count toward the general limit of 60 API requests a minute per IP address. A wrong token, an unknown ID and an expired inbox all return the same 404, so the response doesn't reveal which inboxes exist.

Checking Stripe, GitHub or other signatures

The inbox doesn't verify signatures for you, because it doesn't know your signing secrets and shouldn't. It keeps the raw body and the signature headers so the agent can do the check itself when it reads the item. Payment and code-hosting providers sign the exact bytes they sent, and the stored body is those bytes: UTF-8 text re-encodes to the same bytes (a leading byte-order mark is the one thing dropped), and base64 decodes to them.

Check the signature before acting on anything in the body. A stored request proves only that someone with the URL sent it. A valid signature proves the provider did.

Limits of an inbox

These numbers come from the inbox code and the Worker's rate-limit settings as of 3 December 2026. Rate limits are counted per Cloudflare location, so treat them as approximate.

inbox limits
LimitValueWhat happens past it
Lifetime7 days from creationAll items deleted; URL answers 404
Body size256 KB per requestSender gets 413
Stored itemsLast 1,000Oldest items dropped
Incoming rate60 requests a minute per inboxSender gets 429 with Retry-After: 60
Items per read100Read again with next_after
Long poll0–30 secondsLarger values are treated as 30

The incoming limit is per inbox rather than per IP address on purpose. Webhook providers send for many customers from a shared pool of addresses, and a per-IP limit would let one busy customer block deliveries to everyone else's inboxes.

What an inbox can't do

An inbox answers every request it accepts with {"ok": true}. It can't run your code or compute a reply, so a service that verifies an endpoint by expecting a specific answer, such as echoing back a challenge value during setup, won't accept an inbox URL. Services that simply post events and look for any 2xx status work fine.

There is no forwarding to another URL, no web page that lists the requests, and no way to extend an inbox past its seven days. Stored items can't be deleted one at a time either: they leave when the inbox expires, or when newer requests push them out of the last 1,000. If the job may take longer, create a new inbox before the old one expires and give the service the new URL. At $0.01 per week, a long wait costs about four cents a month.

Waking the agent when it's time to look

An inbox holds the callback, but something still has to make the agent come back and read it. That's what wake, the scheduled HTTP request tool, is for: at a set time it posts to a URL you choose, such as the endpoint that starts your agent. The recipe for waiting on a callback without staying awake combines the two, with a fallback for callbacks that arrive late.

wake can also deliver into an inbox directly. Point a wake job at your own inbox_url and the reminder lands next to the callbacks, so the next run finds both in one read. Deliveries from wake to an agentic402 inbox skip the network and are written straight into the inbox.

What a long wait costs

Take an agent waiting on a review that could come back any time in the next three weeks. It needs three inboxes in a row, one per week, at $0.01 each, and it can check in once a day with a wake job at $0.005 each: 21 wake jobs over three weeks. The total is $0.03 for inboxes plus $0.105 for wake jobs, $0.135 in all, and the agent runs only briefly each day instead of 21 days straight. Reads cost nothing however often the agent checks.

Webhook bodies are untrusted input

Anyone who learns an inbox URL can post anything to it, and even genuine webhooks can carry text written by strangers: a customer's name on a payment, a commit message, a form field. If that text reaches a model as part of its instructions, it can steer the agent. Read responses say so with "content_is_untrusted": true and the X-Content-Untrusted: true header.

Parse webhook bodies as data, pick out the fields you expect, and verify signatures before acting. The limits and safety page covers how untrusted content is handled across all five tools.

Using an inbox over MCP

The agentic402 MCP server offers the same inbox as two tools. inbox_create costs $0.01 and returns the URL and token. inbox_read is free and takes the inbox id, the read_token, and optional after and wait, with the token passed as an argument instead of a header. The guide to webhooks for AI agents compares this pattern with running your own receiver and with workflow engines that pause for a callback.

Questions about agent webhook URLs

Can I use an inbox to inspect webhooks while debugging, like a request bin?
Yes. Create an inbox, point the provider's test webhook at it and read the stored request with curl to see the exact headers and body. There's no web page for it: you read with the token.
Does the sender need to pay or authenticate?
No. Sending to an inbox URL is free and needs no credentials, which is what lets any webhook provider use it. Only creating the inbox is paid.
Can two agents read the same inbox?
Yes. Give both the read_token. Reading doesn't remove anything, so each agent keeps its own after cursor and sees every stored item.
What happens to the data after 7 days?
The inbox's Durable Object runs an alarm at expires_at that deletes all stored items and metadata. After that the URL returns 404 to senders and readers.

Cite this page: agentic402, "Webhook URL for AI agents: inbox", https://agentic402.dev/tools/inbox/, published 3 December 2026. Limits are taken from src/inbox.js and wrangler.jsonc as of that date.