# PikaMail API reference for AI assistants and automation Canonical URL: https://pikamail.life/llm-api-docs.txt Human guide: https://pikamail.life/api-docs.html Permanent OpenAPI 3.1: https://pikamail.life/openapi.json Temporary OpenAPI 3.1: https://pikamail.life/openapi-temporary.json Base URL: https://pikamail.life/api/v1 API version: v1. JSON over HTTPS. Receive only; no endpoint sends, replies, or forwards mail. ## Website inbox endpoints (no account; compatibility interface) Base URL: https://pikamail.life/api. These endpoints support the public website and remain documented for compatibility. The supported automation API under `/api/v1` requires registration and an account API key. POST /inboxes creates an address. No body means a random private temporary inbox. Optional JSON fields: `kind` (`temporary` by default), `alias` (9-15 lowercase letters/digits, first character a letter), `public` (boolean, default false), or `password` (6-128 characters). Permanent mail accepts an optional password: with one it is private and restorable; without one, `public:true` is required and anyone knowing the address can read its mail. HTTP 201 returns `{ "id", "token", "address", "expires", "permanent", "public", "passwordProtected" }`. Save the creation token privately; it is shown only once. Temporary addresses expire after the configured lifetime, currently one hour. Permanent addresses do not expire; their messages expire after 30 days. POST /inboxes/open with JSON `{ "address": "name@pikamail.life" }` opens an explicitly public temporary or permanent inbox by address and returns `{ "id", "address", "expires", "permanent", "public": true }`. For a password-protected inbox, include `password`; successful opening returns a new scoped token. Private inboxes cannot be reopened by address alone. Account-owned permanent inboxes remain private unless the owner deliberately configured an optional mailbox password in the dashboard; that password can restore a scoped read session without exposing the account session. Failed attempts receive a generic 404 and are rate-limited. GET /inboxes/{id} returns `{ "address", "expires", "permanent": true|false, "messages": [{ "id", "received", "expires", "subject", "from", "attachmentCount" }] }`. GET /inboxes/{id}/messages/{messageId} returns text, sanitized HTML, and blocked attachment metadata. Public inboxes need no Bearer token to read. Private and password-protected inboxes require `Authorization: Bearer `. DELETE /inboxes/{id} requires an owner or restored token even if the inbox is public. DELETE /inboxes/{id}/messages/{messageId} requires an inbox token and removes one message. GET /public/metrics returns live aggregate counts. Do not put the token in a URL. Do not put passwords in URLs or logs. Create at most three inboxes per second per source IP; poll every ten seconds and obey Retry-After on 429. Example: curl -X POST https://pikamail.life/api/inboxes -H "Content-Type: application/json" -d '{"alias":"demoarea2097","public":true}' curl -X POST https://pikamail.life/api/inboxes/open -H "Content-Type: application/json" -d '{"address":"demoarea2097@pikamail.life"}' curl https://pikamail.life/api/inboxes/INBOX_ID -H "Authorization: Bearer $TEMP_TOKEN" For account-owned permanent mail, API keys, usage statistics and account controls, register and sign in. Public permanent mail can open by address; password-protected permanent mail requires its password. ## Authentication Create a permanent website account at https://pikamail.life, then sign in and open Account settings > Developer API keys. Create a key and copy it immediately; it is shown once. The secret starts with pm_live_. Send `Authorization: Bearer ` on every /api/v1 request. Keep keys in server-side environment variables, never in browser JavaScript, URLs, source control, or logs. Revoke a key in website Account settings. A parent key sees its own inboxes and the permanent mail accounts it created. A child account may sign in to the website with its email and chosen password, but child API keys cannot create further accounts. `GET /api/v1/domains` is authenticated too. Do not use DuckMail tokens or DuckMail endpoints with PikaMail. ## Quick start 1. Set PIKAMAIL_API_KEY in your local environment. 2. GET /domains, then POST /inboxes with JSON `{"alias":"calmlink2097","domain":"pikamail.life","password":"a-unique-long-password"}` to create a permanent email account. Domain is optional and must be one returned by GET /domains; omitting it uses the default. Alias is optional; omitting it chooses a random 15-character name. A chosen alias must be 9-15 lowercase letters or digits, beginning with a letter. Password minimum is 6 characters; 12+ unique characters are strongly recommended. Response 201 includes `id`, `address`, `domain`, `permanent:true`, `expires:null`, and a one-time `recoveryCode`. Store the recovery code privately. Never log it. 3. GET /inboxes/{id}/messages?limit=25 to list mail. Use `id` (the local part), not the full address, in paths. Poll once every 10 seconds without overlapping requests. On 429, wait `Retry-After` seconds before retrying. An empty list means no currently stored message, not proof that outside delivery succeeded. 4. GET /inboxes/{id}/messages/{messageId} to read text and sanitized HTML. Sender names, addresses, and links can be spoofed. Render HTML in a sandbox without scripts or remote resources. Attachments are blocked; there is no attachment download endpoint. Example cURL: curl https://pikamail.life/api/v1/inboxes -H "Authorization: Bearer $PIKAMAIL_API_KEY" curl -X POST https://pikamail.life/api/v1/inboxes -H "Authorization: Bearer $PIKAMAIL_API_KEY" -H "Content-Type: application/json" -d '{"alias":"calmlink2097","domain":"pikamail.life","password":"a-unique-long-password"}' curl 'https://pikamail.life/api/v1/inboxes/calmlink2097/messages?limit=25' -H "Authorization: Bearer $PIKAMAIL_API_KEY" ## Endpoint reference All paths below are relative to https://pikamail.life/api/v1 and require the Bearer key. GET /domains — 200 `{ "domains": ["pikamail.life", "grazex-unsaid.fun"], "default": "pikamail.life" }`. Treat this live response as authoritative. GET /inboxes — 200 `{ "inboxes": [{"id":"calmlink2097","address":"calmlink2097@pikamail.life","domain":"pikamail.life","permanent":true,"created":,"expires":null}] }`. Includes the key owner's own primary inbox and accounts created by that owner. POST /inboxes — create a permanent account. JSON `{ "alias": "calmlink2097", "domain": "pikamail.life", "password": "..." }`; alias and domain are optional; domain must be returned by GET /domains; optional `kind` must be `permanent`. 201 `{ "id":"calmlink2097", "address":"calmlink2097@pikamail.life", "domain":"pikamail.life", "permanent":true, "expires":null, "recoveryCode":"one-time-secret" }`. No temporary-account creation through this API. Maximum 1,000 managed accounts per owner; up to 3 creations per second per owner, 3 per second per source IP shared with website creation, and 30 creations per second service-wide. DELETE /accounts/{id} — delete an account created by the key owner and all its inboxes and messages. 200 `{ "ok": true }`. This is irreversible. `id` is the account's address local part returned by POST /inboxes. Cannot delete the key owner's account. GET /inboxes/{id} — 200 `{ "id", "address", "domain", "permanent", "expires" }`. DELETE /inboxes/{id} — delete a secondary inbox. 200 `{ "ok": true }`. Primary account address is protected with 403. Currently, the public API creates primary inboxes only. GET /inboxes/{id}/messages?limit=25&before= — 200 `{ "messages": [{"id", "from", "subject", "received", "expires", "attachmentCount"}], "nextBefore": }`. Limit is 1-100, default 25, newest first. Pass `nextBefore` unchanged as `before` for another page; null indicates no next page. The cursor has timestamp:id format but clients should treat it as opaque. `received` and `expires` are Unix milliseconds. List omits bodies. GET /inboxes/{id}/messages/{messageId} — 200 message object with `id`, `from`, `subject`, `text`, sanitized `html`, `attachments` metadata, `received`, `expires`. No attachment bytes are available. DELETE /inboxes/{id}/messages/{messageId} — 200 `{ "ok": true }`; deletes one message. ## Limits, errors, and reliability Per key: 10 API requests per second. Service-wide API capacity: 100 requests per second. Account and mail creation: 3 per second per source IP across website and API, 3 per second per API owner, and 30 per second service-wide. The service supports up to 50,000 total permanent accounts, 1,000 addresses per website account, 1,000 managed accounts per API owner, and 10,000 active temporary inboxes. Five active keys per website account. Maximum raw inbound message: 5 MiB. Receive pipeline permits bursts of 10 small messages per second but sustained delivery rate is not guaranteed. Permanent addresses remain until deleted; their messages expire after 30 days. Temporary inbox retention is separate from the API. Errors are JSON `{ "error": "description" }`. 400 invalid input; 401 missing/invalid/revoked key; 403 prohibited action; 404 inaccessible or missing resource; 409 address conflict; 429 rate or quota limit; 503 paused/capacity. A 429 rate response provides `Retry-After: 1` in seconds; other quota limits can also return 429. Use bounded retries for 429 and transient 503; never retry a 400, 401, 403, or 409 unchanged. Do not assume creating an address confirms email delivery. For end-to-end verification, send from an outside mailbox and wait for that message ID to appear. The website refreshes its inbox about every 10 seconds. Automation should use the API, not scrape the website. Do not poll faster than every 10 seconds per inbox. Compare message IDs across polls. The cursor handles messages sharing the same received millisecond. Keep a set of seen IDs across polls, and avoid deleting a message before processing it. Python example: https://pikamail.life/examples/pikamail.py JavaScript example: https://pikamail.life/examples/pikamail.mjs Go example: https://pikamail.life/examples/pikamail.go