REST API Reference

Programmatic access to mailboxes, domains, and email via API keys.

Authentication

API keys authenticate requests to the laim.email REST API and JMAP endpoints. Include your key in the Authorization header:

Authorization: Bearer lm_sk_live_...

Key Format

  • Live keys: lm_sk_live_<32 chars> — full access to production resources
  • Test keys: lm_sk_test_<32 chars> — sandbox mode (emails captured, never delivered)

Keys are hashed with SHA-256 before storage. The raw key is returned once on creation and cannot be retrieved afterward. Create keys via Dashboard → Developer → API Keys (session auth required). API keys cannot create other API keys.

If the key is invalid, the request fails immediately — it does not fall back to session cookie auth.

Endpoints

MethodPathScope Required
GET/api/v1/mailboxesmailbox:read
POST/api/v1/mailboxesmailbox:create
GET/api/v1/domainsdomain:read
POST/api/v1/domainsdomain:manage
GET/api/v1/mailboxes/quota-statusmailbox:read
POST/api/v1/mailboxes/:id/disablemailbox:manage
POST/api/v1/mailboxes/:id/quotamailbox:manage
DELETE/api/v1/mailboxes/:idmailbox:manage
POST/api/v1/domains/:id/verifydomain:manage
POST/api/v1/domains/:id/enable-outbounddomain:manage
POST/api/v1/domains/:id/suspend-outbounddomain:manage

JMAP Endpoints

All JMAP proxy routes also accept API key authentication.

MethodPathSandbox Enforcement
GET/jmap/sessionN/A (read-only)
POST/jmap/Blocks Email/set and EmailSubmission/set
POST/jmap/upload/:accountIdN/A (upload only)

Scopes

Each key has a list of scopes controlling which endpoints it can access. Format: resource:action.

ScopeGrants Access To
mailbox:readmailboxes.list, mailboxes.quotaStatus
mailbox:createmailboxes.create
mailbox:managemailboxes.setMailboxQuota, mailboxes.disable, mailboxes.delete
mailbox:*All mailbox operations
domain:readdomains.list
domain:managedomains.add, domains.verify, domains.enableOutbound, domains.suspendOutbound
domain:*All domain operations
developer:readdeveloper.rateLimits, developer.requestRateLimits
developer:*All developer operations
*All API-exposed operations (global wildcard)

Scope Matching Rules

  1. Exact match: mailbox:read grants access to procedures requiring mailbox:read
  2. Resource wildcard: mailbox:* grants access to all procedures under the mailbox resource
  3. Global wildcard: * grants access to all API-exposed procedures
  4. Empty scopes: [] grants no API access at all

Sandbox Mode

Test keys (lm_sk_test_*) activate sandbox mode, designed like Stripe's test mode:

BehaviorLive KeyTest Key
Create mailboxesYesYes
List domainsYesYes
Send email (JMAP Email/set)Delivered to recipientSynthetic success (not delivered)
Submit email (JMAP EmailSubmission/set)DeliveredSynthetic success (not delivered)
JMAP session / read operationsYesYes
WebhooksFire normallyFire normally

Rate Limits

Per-organization rate limits apply to both session and API key requests:

ProtocolLimit
SMTP60 requests/min
IMAP120 requests/min
JMAP300 requests/min

Rate Limit Headers

Returned on all API responses:

  • X-RateLimit-Limit — requests allowed per window
  • X-RateLimit-Remaining — requests remaining
  • X-RateLimit-Reset — window reset time (Unix epoch seconds)

Session-Only Endpoints

The following endpoints are not accessible via API keys and require dashboard session authentication:

  • Billing (billing.*)
  • Organization management (orgs.*)
  • IMAP imports (imports.*)
  • Data export (data.*)
  • Usage snapshots (usage.*)
  • Abuse controls (abuse.*)
  • API key management (create, revoke, list)
logo
Take Back
Your Inbox