HTML version: https://cooperemail.com/temp-mail-api

Temp mail API

# A temp mail API with private inboxes, a free key, and auto-expiry

Cooper Email is an email API where every address is a private inbox you create with one HTTP call. Add ttl_hours and the inbox becomes temporary: Cooper's daily cleanup deletes it after the deadline. The API key comes from one unauthenticated POST with no card and no captcha. Free is $0 a month with no card: 5 inboxes, 5,000 emails a month, and 1 custom domain.

## Get a free temp mail API key

Most temp mail APIs hand out a random address on a shared domain and let you poll it. Cooper starts with an account instead, because the same key then creates, reads, and deletes as many temporary inboxes as your plan allows.

POST /api/v1/onboard needs no auth. It returns api_key (it starts with coop_live_ and is shown once) and a first inbox. Omit username and Cooper picks box plus 8 hex characters at cooperemail.com. Send X-Client with your own app or agent name so you can tell signups apart later.

```
curl -s -X POST 'https://cooperemail.com/api/v1/onboard?ref=seo' \
  -H 'content-type: application/json' \
  -H 'X-Client: <your agent or app name>' \
  -d '{"username":"signup-bot-7f3a"}'
# Save api_key as COOPER_API_KEY (it is shown once) and inbox.id as INBOX.
```

## Create temporary inboxes in one call

POST /api/v1/inboxes/batch creates count inboxes at once. prefix sets the address (prefix-@cooperemail.com), labels and metadata are stored on every inbox, and ttl_hours or expires_at makes the whole batch temporary. count is capped per plan: Free 5, Starter 25, Pro 100.

Temporary inboxes count toward the plan's inbox limit until they expire. The daily cron deletes expired inboxes, and then they stop counting. DELETE /api/v1/inboxes/:id frees the slot right away if a run finishes early. A single POST /api/v1/inboxes also accepts ttl_hours or expires_at.

```
AUTH=(-H "Authorization: Bearer $COOPER_API_KEY")
curl -s https://cooperemail.com/api/v1/inboxes/batch "${AUTH[@]}" \
  -H 'content-type: application/json' \
  -d '{"count":3,"prefix":"trial","labels":["signup"],"ttl_hours":24}'
# 201 {"object":"list","data":[{"id":"inb_...","email":"trial-...@cooperemail.com"}, ...]}
```

## Read the verification code or link

GET /api/v1/inboxes/:id/wait-for-code holds the request until a message with a one-time code or an https verification link is stored, then returns the code, the link, and the message id. wait is 0 to 55 seconds and defaults to 25. kind=link waits for a confirmation link instead of digits, and kind=any takes either.

The body is not returned and nothing is marked read. Cooper does not open the link either. A code is 4 to 8 digits, or 123-456, next to a word such as code, OTP, verification, passcode, or PIN. If the call times out, timed_out is true and you call it again.

```
AUTH=(-H "Authorization: Bearer $COOPER_API_KEY")
curl -s "https://cooperemail.com/api/v1/inboxes/$INBOX/wait-for-code?wait=55" "${AUTH[@]}"
# {"object":"inbox_code","timed_out":false,"code":"482913","link":null,"message":{"id":"msg_...","from":"..."}}
```

## Temp mail API in Python

The same flow with requests. It creates one temporary inbox for a signup, waits for the code, and deletes the inbox when the test is done.

```
import os, requests

BASE = "https://cooperemail.com/api/v1"
H = {"Authorization": "Bearer " + os.environ["COOPER_API_KEY"]}

inbox = requests.post(BASE + "/inboxes", headers=H,
                      json={"username": "trial-run-42", "ttl_hours": 2}).json()
print("sign up with", inbox["email"])

# ... trigger the signup on the site you are testing ...

code = requests.get(BASE + "/inboxes/" + inbox["id"] + "/wait-for-code",
                    headers=H, params={"wait": 55}).json()
print(code["code"] or code["link"])

requests.delete(BASE + "/inboxes/" + inbox["id"], headers=H)
```

## How a Cooper inbox differs from a public temp mail address

An inbox belongs to the account that created it. Another account's key gets HTTP 404 inbox_not_found for it, so a code sent to your test address is not readable by someone who guesses the name.

Every inbound message carries auth with the SPF, DKIM, and DMARC results, and screening labels suspicious mail. The body stays untrusted data. The same inbox can also send and reply, which most receive-only temp mail services do not offer. Free includes 1 custom domain, so test addresses can live on your own subdomain instead of a shared disposable domain that sites block.

## Limits to plan around

A key can hold at most 5 waits at once. Plus addresses (name+tag@cooperemail.com) land in the same inbox and are not extra inboxes, and wait-for-code takes alias=tag so one inbox can serve several parallel signups.

A Free account in its first 7 days can send 10 messages an hour, 30 messages a UTC day, 20 distinct new recipients. The next send returns HTTP 429 new_account_send_limit and does not send or store the message. Starter, Pro, and grandfathered accounts are exempt. After that window, Free has no standing daily cap.

Starter is $12 a month for 25 inboxes and 25,000 emails. Pro is $99 a month for 300 inboxes and 250,000 emails.

## FAQ

### Is the Cooper temp mail API free?

Yes. Free is $0 a month with no card: 5 inboxes, 5,000 emails a month, and 1 custom domain. The key comes from POST https://cooperemail.com/api/v1/onboard with no auth. Free cannot buy add-ons.

### Do temporary inboxes delete themselves?

Yes. Pass ttl_hours or expires_at when you create the inbox or the batch. The daily cron deletes expired inboxes and their messages. DELETE /api/v1/inboxes/:id removes one immediately and frees the slot.

### Can a temp inbox use my own domain?

Free includes 1 custom domain. POST /api/v1/domains returns the MX, SPF, DKIM, DMARC, and verify records to publish. Starter includes 15 and Pro 200.

### Does Cooper click the verification link for me?

No. wait-for-code returns the top-ranked link and up to five candidates, but Cooper never fetches them. Your code decides whether to open the link.

## Related

[Email testing API](/email-testing-api) · [Create addresses programmatically](/create-email-address-programmatically) · [OTP guide](/guides/ai-agent-receive-otp-verification-code-email) · [POST /inboxes/batch](/docs/reference/inboxes-batch) · [Pricing](/pricing) · [Docs](/docs) · [Pricing](/pricing)

Operator: Avatar 8 LLC (ops@avatar33.com). Last updated 2026-11-22.

Canonical: https://cooperemail.com/temp-mail-api
