API Reference

Complete endpoint reference for the inboxes backend API.

Authentication

All protected endpoints require a valid JWT in an httpOnly cookie named token. The cookie is set on login/signup/claim and cleared on logout.

  • Signing: HMAC-SHA256 (HS256)
  • Expiry: 7 days
  • Flags: HttpOnly, SameSite=Lax, Secure (HTTPS), Path=/

JWT claims: user_id, org_id, role (admin | member), jti, iat, exp

CSRF protection: All state-changing requests must include an X-Requested-With header (any non-empty value). Requests without it receive 403 Forbidden.

Error format

{ "error": "human-readable message" }

Common status codes: 400 (validation), 401 (unauthenticated), 403 (forbidden), 404 (not found), 409 (conflict), 422 (unprocessable), 429 (rate limited), 500 (server error).

Rate limits

EndpointLimitWindow
POST /api/auth/signup51 hour
POST /api/auth/login10/IP + 10/email15 min
POST /api/auth/forgot-password3/IP + 3/email1 hour
POST /api/emails/send20/IP + 30/user60 sec
POST /api/setup315 min
Admin cron/jobs560 sec

Public endpoints

No authentication required.

Health

MethodPathDescription
GET/api/healthService health check
GET/api/configPublic runtime configuration

Setup (self-hosted only)

Available only when STRIPE_KEY is unset.

MethodPathDescription
GET/api/setup/statusCheck if initial setup is needed
POST/api/setupCreate first admin account and org
POST/api/setup/validate-keyValidate a Resend API key

Auth

MethodPathDescription
POST/api/auth/signupRegister a new account
POST/api/auth/loginLog in, receive JWT cookie
POST/api/auth/forgot-passwordSend password reset email
POST/api/auth/reset-passwordReset password with token
POST/api/auth/claimClaim an invited account
POST/api/auth/verify-emailVerify email with 6-digit code

Webhooks

MethodPathDescription
POST/api/webhooks/resend/{orgId}Resend webhook receiver (Svix signature-verified)
POST/api/webhooks/stripeStripe webhook receiver (commercial mode only)

WebSocket

MethodPathDescription
GET/api/wsWebSocket connection (authenticates via JWT cookie)

Protected endpoints

Require valid JWT cookie. All state-changing requests require X-Requested-With header.

Org settings

MethodPathAuthDescription
GET/api/orgs/settingsAny userGet org settings
PATCH/api/orgs/settingsAdminUpdate org settings

User profile

MethodPathDescription
GET/api/users/meGet current user profile
PATCH/api/users/meUpdate profile (name)
PATCH/api/users/me/passwordChange password
GET/api/users/me/preferencesGet user preferences
PATCH/api/users/me/preferencesUpdate preferences (merge), including the undo-send delay
PATCH/api/users/me/signatureUpdate the user's email signature
GET/api/users/me/sessionsList active sessions
DELETE/api/users/me/sessions/{jti}Revoke a session

Threads

MethodPathDescription
GET/api/threadsList threads
PATCH/api/threads/bulkBulk action on multiple threads
GET/api/threads/{id}Get thread with all emails
PATCH/api/threads/{id}/readMark thread as read
PATCH/api/threads/{id}/unreadMark thread as unread
PATCH/api/threads/{id}/starToggle or set star
PATCH/api/threads/{id}/archiveMove to archive
PATCH/api/threads/{id}/trashMove to trash (purged after 30 days when the trash collector is enabled)
PATCH/api/threads/{id}/spamMark as spam or not-spam
PATCH/api/threads/{id}/snoozeSnooze or unsnooze until a given time
PATCH/api/threads/{id}/muteMute or unmute the thread
PATCH/api/threads/{id}/moveMove to a label/folder
DELETE/api/threads/{id}Permanently delete (must be in trash)

Emails

MethodPathDescription
POST/api/emails/sendSend an email (queued via job system). Accepts an optional scheduled_at time up to 30 days out
POST/api/emails/{id}/cancel-sendUndo send - cancel an email inside its undo window
GET/api/emails/searchSearch emails. Supports from:, to:, has:attachment, before:, after:, plus label and page params
POST/api/emails/{id}/retryRe-queue a failed outbound email
GET/api/bouncesList blocked (bounced) recipients; blocks expire after 30 days
DELETE/api/bounces/{id}Unblock a recipient (admin only)

Forwarding rules & auto-replies

Rules are per-alias. Members manage rules for their own aliases; admins manage all of them. Org policy toggles can disable forwarding, auto-replies, or external forwarding for the whole org.

MethodPathDescription
GET/api/forwarding-rulesList forwarding rules
POST/api/forwarding-rulesCreate a forwarding rule
PATCH/api/forwarding-rules/{id}Update a forwarding rule
DELETE/api/forwarding-rules/{id}Delete a forwarding rule
GET/api/auto-repliesList auto-replies
POST/api/auto-repliesCreate or update an auto-reply for an alias
DELETE/api/auto-replies/{id}Delete an auto-reply

Domains

MethodPathDescription
GET/api/domainsList visible domains
POST/api/domainsAdd a new domain
POST/api/domains/{id}/verifyVerify domain DNS records
DELETE/api/domains/{id}Soft-delete a domain (admin only)
PATCH/api/domains/reorderReorder sidebar domains
POST/api/domains/syncSync domain list from Resend

Users (admin)

MethodPathDescription
GET/api/usersList org users
POST/api/users/inviteInvite a new user
PATCH/api/users/{id}/disableDisable user
PATCH/api/users/{id}/roleChange user role

Aliases

MethodPathDescription
GET/api/aliasesList all aliases
POST/api/aliasesCreate alias (admin only)
PATCH/api/aliases/{id}Update alias name (admin only)
DELETE/api/aliases/{id}Delete alias (admin only)
PATCH/api/aliases/{id}/defaultSet as default send-from alias

Drafts

MethodPathDescription
GET/api/draftsList drafts
POST/api/draftsCreate draft
PATCH/api/drafts/{id}Update draft
DELETE/api/drafts/{id}Delete draft
POST/api/drafts/{id}/sendSend a draft, now or at an optional scheduled_at time (up to 30 days out)
POST/api/drafts/{id}/cancel-scheduleCancel a scheduled send and keep the draft

Labels

MethodPathDescription
GET/api/labelsList custom labels
POST/api/labelsCreate label
PATCH/api/labels/reorderReorder labels in the sidebar
PATCH/api/labels/{id}Rename label
DELETE/api/labels/{id}Delete label

Attachments

MethodPathDescription
POST/api/attachments/uploadUpload attachment (max 10MB, multipart/form-data)
GET/api/attachments/{id}/metaGet attachment metadata
GET/api/attachments/{id}Download attachment

Sync

MethodPathDescription
POST/api/syncStart an email sync job (admin only)
GET/api/sync/{id}Get sync job status

Billing

MethodPathAuthDescription
GET/api/billingAny userGet billing status and plan info. Includes read_only for lapsed plans; a lapsed org keeps read access, writes return 402
POST/api/billing/checkoutAdminCreate Stripe checkout session
POST/api/billing/portalAdminCreate Stripe billing portal URL

Agent credentials (MCP)

These endpoints manage the API keys and OAuth connections that MCP clients use. See MCP for the full agent integration guide, including the /mcp endpoint and the OAuth discovery routes.

MethodPathDescription
GET/api/agent-keysList your API keys and OAuth connections
POST/api/agent-keysCreate an API key. The raw key is returned once and stored only as a SHA-256 hash
DELETE/api/agent-keys/{id}Revoke a key or OAuth connection

Admin-only endpoints

Require role = admin. Protected by JWT auth.

MethodPathDescription
POST/api/cron/purge-trashManually trigger trash purge
POST/api/cron/cleanup-webhooksClean up stale Resend webhooks
GET/api/admin/jobsList email job queue status

System settings (self-hosted, owner only)

MethodPathDescription
GET/api/system/emailGet system email configuration
PATCH/api/system/emailUpdate system from-address

Org deletion (owner only)

MethodPathDescription
DELETE/api/orgsSoft-delete organization
DELETE/api/orgs/hardPermanently delete organization