Mailbux Docs / API Reference

Management API

Tenant-scoped REST endpoints for domains, mailboxes, aliases, groups, DKIM, account security, reports, recovery, and delivery diagnostics.

End-user and tenant workflows47 endpointsBearer-token JSON API

Use the tenant token everywhere

Authenticate once, keep the returned bearer token private, and send it in the Authorization header on every protected request. Principal endpoints use the same route for domains, accounts, groups, lists, roles, API keys, and OAuth clients; the object type controls what is created or filtered.

Base URLhttps://api.mailbux.comHeaderAuthorization: Bearer <access_token>
01Add domain

Create the domain principal and publish DNS records.

02Create accounts

Add individual principals with addresses and quotas.

03Configure access

Assign roles, groups, aliases, forwarders, and app passwords.

04Verify delivery

Check DKIM, reports, spam training, and diagnostics.

Authentication and Session

Get an access token, discover login metadata, and inspect the tenant-scoped permissions available to the caller.

POST
Public login
/api/oauth

Create authorization code

Starts the OAuth authorization-code flow for a tenant administrator or authorized account owner.

Body
  • type: "code"
  • client_id: "mailbux-admin"
  • redirect_uri: registered callback URL
Example request
curl -X POST "https://api.mailbux.com/api/oauth" \
  -u "[email protected]:your-password" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "code",
    "client_id": "mailbux-admin",
    "redirect_uri": "https://api.mailbux.com/api/oauth/callback"
  }'
POST
Public login
/auth/token

Exchange code for bearer token

Exchanges the authorization code for an access token and refresh token used on protected API calls.

Body
  • grant_type=authorization_code
  • code: authorization code
  • client_id: "mailbux-admin"
Example request
curl -X POST "https://api.mailbux.com/auth/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "grant_type=authorization_code" \
  --data-urlencode "code=<auth_code>" \
  --data-urlencode "client_id=mailbux-admin"
GET
Public lookup
/api/discover/{email}

Discover login provider

Returns sign-in metadata for the email domain, including the provider used by that organization.

Parameters
  • email: user email address or account name
GET
Authenticated user
/api/account

Current account descriptor

Returns the authenticated account, locale, edition, tenant context, and effective permissions.

Tenant and Organization

Tenant administrators work inside their organization boundary. These calls expose profile, quota, and plan context when enabled for the account.

GET
Tenant admin
/api/account

Tenant-aware account overview

Use the account descriptor as the first call after login to learn what the token can manage.

GET
Tenant admin
/api/principal?types=tenant

List visible tenants

Returns tenant principals visible to the caller. Most customer tokens only see their own organization.

Parameters
  • page
  • limit
  • types=tenant
PATCH
Tenant admin
/api/principal/{tenant_id}

Update tenant profile

Updates tenant-owned metadata such as display name, logo, allowed roles, or quota fields when the permission is granted.

Body
  • action: set | addItem | removeItem
  • field: tenant field name
  • value: new field value
GET
Account owner
/userapi/account-plan

Plan and usage summary

Returns the Mailbux plan, limits, and account-level usage visible to the signed-in customer.

Domains, DNS, and DKIM

Create domains first, then publish the DNS records returned by Mailbux before adding production mailboxes.

GET
Tenant admin
/api/principal?types=domain

List domains

Lists domains available in the caller tenant.

Parameters
  • page
  • limit
  • types=domain
POST
Tenant admin
/api/principal

Create domain

Creates a domain principal that can later hold mailboxes, aliases, groups, and DKIM signing.

Body
  • type: "domain"
  • name: domain name
  • description: optional label
Example request
curl -X POST "https://api.mailbux.com/api/principal" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "domain",
    "name": "example.com",
    "description": "Primary company domain"
  }'
GETPATCHDELETE
Tenant admin
/api/principal/{domain}

Read, update, or delete domain

Fetch domain details, update allowed fields, or delete a domain after dependent accounts have been removed.

GET
Tenant admin
/api/dns/records/{domain}

Fetch required DNS records

Returns the MX, SPF, DKIM, DMARC, and verification records to publish for the domain.

POSTGET
Tenant admin
/userapi/dkim

Create or view DKIM keys

Generates and returns Mailbux DKIM signing records for a customer domain.

Body
  • domain: verified domain name
  • selector: optional custom selector
POST
Tenant admin
/api/dkim

Create DKIM signature

Creates a DKIM signature object for a domain when advanced DKIM management is enabled.

Body
  • domain: domain name
  • algorithm: Ed25519 | RSA
  • selector: optional selector

Accounts, Mailboxes, and Aliases

Mailboxes are individual principals. Aliases and catch-all addresses are additional values on the account email list.

GET
Tenant admin
/api/principal?types=individual

List email accounts

Lists individual mailboxes inside the tenant.

Parameters
  • page
  • limit
  • types=individual
  • tenant
POST
Tenant admin
/api/principal

Create email account

Creates a mailbox with login name, password, addresses, quota, tenant, and roles.

Body
  • type: "individual"
  • tenant: tenant id or name
  • name: primary login
  • emails: primary and aliases
  • secrets: password array
  • quota: bytes
Example request
curl -X POST "https://api.mailbux.com/api/principal" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "individual",
    "tenant": "example",
    "name": "[email protected]",
    "description": "Jane Doe",
    "secrets": ["StrongPassword123!"],
    "emails": ["[email protected]"],
    "quota": 1073741824,
    "roles": ["user"]
  }'
GETPATCHDELETE
Tenant admin
/api/principal/{email}

Read, update, or delete account

Fetch mailbox details, change password or quota, suspend access, update membership, or delete the account.

PATCH
Tenant admin
/api/principal/{email}

Add or remove alias

Adds an address to the account emails array, or removes it later.

Body
Example request
curl -X PATCH "https://api.mailbux.com/api/principal/[email protected]" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '[{
    "action": "addItem",
    "field": "emails",
    "value": "[email protected]"
  }]'
PATCH
Tenant admin
/api/principal/{email}

Set domain catch-all

Adds @example.com to an account so unmatched addresses at that domain deliver to the mailbox.

Body
  • action: addItem
  • field: "emails"
  • value: "@example.com"

Groups, Shared Inboxes, and Lists

Groups can receive mail and expose a shared inbox to members. Mailing lists distribute mail to internal or external recipients.

GET
Tenant admin
/api/principal?types=group,list

List groups and lists

Returns collaboration groups and mailing lists visible to the tenant administrator.

Parameters
  • page
  • limit
  • types=group,list
POST
Tenant admin
/api/principal

Create group

Creates a group principal with addresses, members, optional quota, and shared access behavior.

Body
  • type: "group"
  • name: group id
  • emails: group addresses
  • members: account or group ids
POST
Tenant admin
/api/principal

Create mailing list

Creates a mailing-list principal with internal members and optional external recipients.

Body
  • type: "list"
  • name: list id
  • emails: list addresses
  • members
  • externalMembers
PATCH
Tenant admin
/api/principal/{principal_id}

Update membership

Adds or removes members, addresses, roles, or list subscriptions from a group or mailing list.

Body
  • action: addItem | removeItem
  • field: "members" | "emails" | "externalMembers"
  • value: item to change
DELETE
Tenant admin
/api/principal/{principal_id}

Delete group or list

Removes the group or mailing list principal from the tenant.

Forwarders

Forwarders route incoming messages from a Mailbux address to one or more external destinations.

GET
Tenant admin
/api/forwarders?domain={domain}

List domain forwarders

Returns forwarders configured for a domain.

Parameters
  • domain: customer domain
POST
Tenant admin
/api/forwarders

Create forwarder

Creates a forwarding rule with optional local mailbox copy.

Body
  • fromEmail: source address
  • to: comma-separated destinations
  • keepLocal: true | false
  • description: optional label
Example request
curl -X POST "https://api.mailbux.com/api/forwarders" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "fromEmail": "[email protected]",
    "to": "[email protected],[email protected]",
    "keepLocal": true,
    "description": "Info desk forwarding"
  }'
DELETE
Tenant admin
/api/forwarders/{id}

Delete forwarder

Removes a forwarding rule by id.

Roles, API Keys, and OAuth Clients

Grant scoped automation access without sharing a user password.

GET
Tenant admin
/api/principal?types=role,apiKey,oauthClient

List access principals

Lists roles, API keys, and OAuth clients visible to the tenant administrator.

Parameters
  • types=role,apiKey,oauthClient
  • page
  • limit
POST
Tenant admin
/api/principal

Create role

Creates a reusable permission bundle that can be assigned to users, groups, or API keys.

Body
  • type: "role"
  • name: role id
  • enabledPermissions
  • disabledPermissions
POST
Tenant admin
/api/principal

Create API key

Creates a tenant-scoped API key for automation. API keys are for management calls, not mailbox login.

Body
  • type: "apiKey"
  • name: key id
  • secrets: generated key secret
  • tenant
  • roles or enabledPermissions
POST
Tenant admin
/api/principal

Create OAuth client

Registers an OAuth client used by an internal app or trusted integration.

Body
  • type: "oauthClient"
  • name: client id
  • secrets
  • urls: redirect URLs
  • roles
PATCHDELETE
Tenant admin
/api/principal/{principal_id}

Rotate or revoke access

Updates secrets and permissions or removes the role, API key, or OAuth client.

Account Security

Manage authentication factors, app passwords, suspended access, and encryption-at-rest preferences.

GET
Account owner
/api/account/auth

Get own authentication settings

Returns the signed-in account authentication state, including app password and two-factor configuration where available.

POST
Account owner
/api/account/auth

Update own authentication settings

Adds app passwords, updates password state, or changes two-factor authentication for the signed-in account.

Body
  • type: addAppPassword | removeAppPassword | enable2fa | disable2fa
  • name: optional label
  • password or code: operation-specific value
GET
Account owner
/api/account/crypto

Get encryption settings

Returns the signed-in account encryption-at-rest configuration.

POST
Account owner
/api/account/crypto

Update encryption settings

Updates the signed-in account encryption-at-rest mode when available on the plan.

Body
  • type: disabled | pGP
  • algo: optional encryption algorithm
  • publicKey: optional account key
PATCH
Tenant admin
/api/principal/{email}

Suspend or restore account login

Uses permission fields to disable or restore authentication for a tenant mailbox.

Body
  • field: "disabledPermissions"
  • value: ["authenticate"] or []

Spam Training and Reports

Tenant admins can train filtering and review domain reports where their plan exposes those tools.

POST
Tenant admin
/api/spam-filter/train/spam

Train global filter as spam

Uploads a raw message sample and marks it as unwanted mail for training.

Body
  • Raw RFC 5322 message body
POST
Tenant admin
/api/spam-filter/train/ham

Train global filter as not spam

Uploads a raw message sample and marks it as legitimate mail for training.

Body
  • Raw RFC 5322 message body
POST
Tenant admin
/api/spam-filter/train/{spam|ham}/{account_id}

Train account filter

Applies a spam or not-spam training sample to one mailbox account.

Parameters
  • account_id: target account id
GET
Tenant admin
/api/reports/dmarc

List DMARC reports

Returns incoming DMARC aggregate reports for domains visible to the caller.

Parameters
  • page
  • limit
  • max-total
GET
Tenant admin
/api/reports/tls

List TLS reports

Returns SMTP TLS reporting data for tenant domains.

GET
Tenant admin
/api/reports/arf

List abuse feedback reports

Returns ARF feedback reports related to tenant traffic.

Deleted Message Recovery

Recover messages that are still inside the account retention window.

GET
Tenant admin
/api/store/undelete/{account_id}

List restorable messages

Lists deleted messages that can still be restored for the account.

Parameters
  • account_id
  • page
  • limit
POST
Tenant admin
/api/store/undelete/{account_id}

Restore messages

Restores selected deleted message records by hash and collection.

Body
  • hash: deleted message hash
  • collection: email
  • restoreTime
  • cancelDeletion

Delivery Diagnostics

Read-only troubleshooting helpers for customer-owned domains and outbound delivery checks.

GET
Tenant admin
/api/troubleshoot/token

Create troubleshooting token

Issues a short-lived token used by delivery diagnostic streams.

GET
Tenant admin
/api/troubleshoot/delivery/{recipient}

Trace delivery attempt

Runs a delivery diagnostic for a recipient address using a short-lived token.

Parameters
  • recipient: destination email
  • token: token from /api/troubleshoot/token

Intentionally not listed

This page is limited to customer and tenant workflows. The following platform-only operations are not part of the public Mailbux end-user API reference.

  • Queue start/stop, reschedule, and message deletion
  • Global settings writes and configuration reloads
  • Software update, store purge, database, and indexing operations
  • Platform-wide telemetry, logs, and live tracing streams