# PagerMail > PagerMail gives AI agents programmable email identities for receiving, reading, threading, and sending mail. ## Base URLs - API origin: https://api.pager.ai - API routes: https://api.pager.ai/api/* - Dashboard: https://app.pager.ai ## Self-serve agent signup - Availability: GET https://api.pager.ai/api/signup returns 204 when signup is ready, 503 when enabled but unavailable, and 404 when signup is not exposed. - Start: POST https://api.pager.ai/api/signup with {"human_email":"","agent_name":"support-triage","username":"support-triage"}; replace the email placeholder with a canonical lowercase address and use no Bearer credential. The two names follow this rule: 3–30 lowercase ASCII letters or digits, with hyphens allowed only internally (no leading or trailing hyphen). - Provisional mint: a 201 status=provisional response contains a read-only agent_key with mail:read, an address, and verification_handle; store agent_key and verification_handle immediately. Until verification, that key cannot send mail. A 201 does not prove that an OTP challenge was issued or delivered. - Neutral acceptance: a 202 status=accepted response contains verification_handle but no credential and does not prove that an agent was minted; retain the handle and verify if a code arrives. Resend is unavailable without a provisional agent key. - Provisional verification: PagerMail's OTP email uses the database-authoritative provisional inbox address as Reply-To and asks the human to reply directly with the code. Use GET /api/inboxes and GET /api/inboxes/{inboxId}/messages to read that inbound reply; every provisional send attempt is denied until verification. - Resend: wait at least 60 seconds, then POST the same verification_handle and human_email to https://api.pager.ai/api/signup/resend using Authorization: Bearer ; this operation requires only the provisional key's mail:read scope. - Verify: POST {"verification_handle":"...","otp":"123456"} without a Bearer credential to https://api.pager.ai/api/signup/verify. After a 201 provisional mint, success upgrades that same agent and restores mail:send on the same key; the 200 status=verified response returns agent_key and address, so store the returned key. ## Agent keys - Authentication: Authorization: Bearer - Scopes: mail:read, mail:send. Operations are limited to the authenticated agent itself and its own active inboxes in its workspace, either all owned inboxes or selected inbox grants; every other authenticated agent-key method/path is forbidden. - [mail:read] GET /api/session - [mail:read] GET /api/agents/{selfAgentId} - [mail:read] GET /api/inboxes - [mail:read] GET /api/inboxes/{inboxId} - [mail:read] GET /api/inboxes/{inboxId}/messages - [mail:read] GET /api/inboxes/{inboxId}/threads - [mail:read] GET /api/messages/{messageId} - [mail:read] GET /api/messages/{messageId}/raw - [mail:read] GET /api/messages/{messageId}/attachments/{attachmentId} - [mail:read] GET /api/threads/{threadId} - [mail:read] GET /api/threads/{threadId}/context - [mail:read] GET /api/deliveries - [mail:read] GET /api/deliveries/{deliveryId} - [mail:read] GET /api/deliveries/{deliveryId}/timeline - [mail:read] GET /api/deliveries/{deliveryId}/explain - [mail:read] GET /api/trust/{selfAgentId} - [mail:read] GET /api/capabilities - [mail:read] GET /api/search - [mail:read] PATCH /api/messages/{messageId}/labels - [mail:read] POST /api/messages/{messageId}/spam - [mail:read] POST /api/messages/{messageId}/not-spam - [mail:read] POST /api/messages/{messageId}/trash - [mail:read] POST /api/messages/{messageId}/untrash - [mail:read] GET /api/inboxes/{inboxId}/drafts - [mail:read] POST /api/messages/{messageId}/process - [mail:read] POST /api/messages/{messageId}/pipeline - [mail:read] GET /api/events/stream - [mail:send] POST /api/inboxes/{inboxId}/drafts - [mail:send] POST /api/messages/send - [mail:read + mail:send] PUT /api/drafts/{draftId} - [mail:read + mail:send] POST /api/drafts/{draftId}/send - [mail:read] POST /api/signup/resend - [mail:read + mail:send] POST /api/messages/{messageId}/reply - [mail:read + mail:send] POST /api/messages/{messageId}/reply-all - [mail:read + mail:send] POST /api/messages/{messageId}/forward - Read state: PATCH /api/messages/{messageId}/labels with {"add":["read"],"remove":["unread"]}. - Realtime: GET /api/events/stream?inbox_id={inboxId} is SSE for message.received, delivery.updated, and processor.completed. Reconnect with Last-Event-ID for bounded process-local replay; on reset_required, refetch state, discard the stored Last-Event-ID, and reconnect without a cursor. ## Customer webhooks - Subscriptions: Bearer API access requires an organization-wide organization key. GET /api/webhooks accepts granular webhooks:read or webhooks:write and legacy *, read, or admin; POST /api/webhooks and DELETE /api/webhooks/{subscriptionId} accept granular webhooks:write and legacy * or admin. Agent keys and workspace-pinned organization keys are forbidden, while Clerk organization admins use the dashboard. Callback events contain identifiers and timestamps, not message content. Docs: https://app.pager.ai/docs ## Connect - Remote MCP with an API key: POST https://mcp.pager.ai/mcp with Authorization: Bearer . JSON-RPC goes over POST only; a GET returns 405 with allow: POST. - Claude Code (API-key MCP): claude mcp add --transport http pagermail https://mcp.pager.ai/mcp --header "Authorization: Bearer pm_agent_REPLACE_ME" - Cursor (API-key MCP): add this to .cursor/mcp.json and replace the placeholder key: {"mcpServers":{"pagermail":{"url":"https://mcp.pager.ai/mcp","headers":{"Authorization":"Bearer pm_agent_REPLACE_ME"}}}} - Local stdio MCP (published package @pagermail/mcp 0.3.0): PAGERMAIL_API_KEY=pm_agent_REPLACE_ME npx -y @pagermail/mcp ## Machine-readable API - OpenAPI: https://api.pager.ai/openapi.yaml - Interactive reference: https://app.pager.ai/docs