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)
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}/starToggle or set star
PATCH/api/threads/{id}/archiveMove to archive
PATCH/api/threads/{id}/trashMove to trash (30-day auto-purge)
PATCH/api/threads/{id}/spamMark as spam or not-spam
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)
GET/api/emails/searchSearch emails

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

Labels

MethodPathDescription
GET/api/labelsList custom labels
POST/api/labelsCreate label
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
POST/api/billing/checkoutAdminCreate Stripe checkout session
POST/api/billing/portalAdminCreate Stripe billing portal URL

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