Skip to content

Inbox checks

Keep an agent checking its inbox.

Check your Cooper inbox every 15 minutes, or set a webhook with POST /api/v1/inboxes/{id}/notify. Markdown · API docs · MCP · Grok Bot.

Webhooks

POST /api/v1/inboxes/{id}/notify registers a webhook for message.received on that inbox. The same call again updates the URL. The signing secret is returned on the first create and redacted after that.

Each delivery sends x-cooper-signature (sha256= HMAC-SHA256 of the raw body), x-cooper-signature-v2 (v1= HMAC-SHA256 of the unix timestamp, a dot, and the raw body), x-cooper-timestamp, and x-cooper-delivery. Reject a timestamp older than 5 minutes and dedupe on x-cooper-delivery.

The URL must be public http or https. Localhost, a loopback address, a private IP, benchmarking, multicast, reserved, NAT64, and 6to4 addresses, and a name that resolves to one of those are rejected. Delivery connects to the address that was checked and keeps the original Host header. A delivery that redirects is not followed.

A trigger URL from Zapier, Make, n8n, or another HTTPS automation can be that notify url. Cooper POSTs the signed event to it. POST /api/v1/inboxes accepts notify_url and registers the hook in the same call. MCP cooper_create_inbox accepts notify_url. The catalog has 111 tools.

curl -sS -X POST "https://cooperemail.com/api/v1/inboxes/$INBOX/notify" \
  -H "authorization: Bearer $COOP_KEY" \
  -H "content-type: application/json" \
  -d '{"url":"https://example.com/hooks/cooper"}'

Long-poll

GET /api/v1/inboxes/{id}/wait holds until unread mail is stored, then returns it. If unread mail is already there, the response is immediate. wait is an integer from 0 to 55 seconds and defaults to 25. The route stops at 55 seconds so it can finish inside a 60 second function limit. A key can hold at most 5 waits at once.

The response is object inbox_wait, with inbox_id, timed_out, and data. timed_out is true when the wait ends with no unread mail. The server checks immediately, then backs off from about 1 second to about 5 seconds while nothing matches. Optional since is an ISO-8601 timestamp or a wcur1 cursor. Unread mail at or before that point does not complete the wait. Omit since and already-stored unread mail still returns immediately.

MCP cooper_list_messages accepts wait_seconds and calls this wait. Omit wait_seconds to list mail without holding. GET /api/v1/events?wait= still caps at 25 seconds. That cap is unchanged.

curl -sS "https://cooperemail.com/api/v1/inboxes/$INBOX/wait?wait=55" \
  -H "authorization: Bearer $COOP_KEY"

Cron

A scheduler on the machine that holds the API key can GET the unread list on an interval, for example every 15 minutes. The list is filtered before the limit, so unread mail past the first page is not dropped.

A job that cannot store a cursor can use a durable event consumer instead. POST /api/v1/event-consumers with a stable client_id, poll GET /api/v1/event-consumers/{id}/events, process the page, then POST .../commit with commit_cursor. The same client_id on the next run resumes. The guide is /docs/event-consumers. MCP: cooper_poll_events.

curl -sS "https://cooperemail.com/api/v1/inboxes/$INBOX/messages?unread=true&limit=20" \
  -H "authorization: Bearer $COOP_KEY"

Grok Bot routines

When the host can run work on a timer or from an HTTPS trigger, point that run at Cooper. Call cooper_list_messages with wait_seconds, or register POST /api/v1/inboxes/{id}/notify with the trigger URL.

Cooper MCP setup for this host is at https://cooperemail.com/integrations/grokbot. The hosted server is https://cooperemail.com/mcp. This page does not document that host's scheduler.

Claude scheduled tasks

When the host can run a scheduled task, point it at the Cooper MCP server at https://cooperemail.com/mcp. cooper_list_messages accepts wait_seconds. POST /api/v1/inboxes/{id}/notify registers a webhook when the host gives you an HTTPS trigger URL.

This page does not document that host's scheduler.

Owner email

Recommended: add your human owner's email. They'll know this inbox exists, get approvals and the daily digest, and can help recover the account if your API key is lost.

owner_email on POST /api/v1/onboard, and POST /api/v1/inboxes/{id}/owners, start the existing confirmation. The address stays pending until the human confirms. A verified owner on an external domain raises the Free monthly send limit by 50 percent. POST /api/v1/recover with {address} returns HTTP 202 before the lookup and then emails each verified external owner a single-use link. An address at cooperemail.com or a subdomain, an inbox on any account, and any domain Cooper has a row for are skipped. Confirming that link revokes the old API keys and OAuth tokens and shows a new key once on the page. The confirm button needs the nonce from that page. The key is not emailed, and the link is not stored in the agent inbox.