Mailbase
FeaturesPricingDocsBlogComparisonsChangelog
Sign inStart free
Home/Docs/API

Mailbase REST API

A workspace-scoped API for transactional email, audience sync, campaign visibility, and operational checks. Tokens are generated in Settings → Developer API.

Authentication

Every request uses a bearer token. Tokens are shown once, stored hashed by Mailbase, can be created with an expiry, and can be revoked from the workspace settings screen.

Authorization: Bearer mb_live_...
ScopeAllows
email:sendSend transactional email through the workspace sender setup.
campaigns:readList campaigns and delivery stats.
audiences:readList audiences and contact counts.
audiences:writeCreate audiences and import contacts.
contacts:readRead contact profiles and suppression status.
contacts:writeCreate, update, suppress, or resubscribe contacts.
events:readRead delivery, engagement, and reply events.
templates:readRead email templates.
templates:writeCreate and update email templates.
webhooks:writeCreate and manage outgoing webhook endpoints.
analytics:readRead analytics endpoints as they are added.

OpenAPI

The current machine-readable API contract is available as OpenAPI 3.1. It is checked against the implemented /api/v1 routes in tests.

curl https://mailbase.french-web.com/api/v1/openapi.json

Idempotency

Mutating API requests that send or create records accept an Idempotency-Key header. Reusing the same key with the same payload returns the original response; reusing it with a different payload returns a conflict.

Rate Limits

Authenticated API requests are limited by both bearer token and workspace. Successful and limited responses include RateLimit-* plus token/workspace-specific headers so integrations can back off safely.

SubjectDefault limitNotes
Token120 requests / minuteEach bearer token has its own request window.
Workspace600 requests / minuteAll API tokens in a workspace share this ceiling.
HTTP/1.1 429 Too Many Requests
Retry-After: 42
RateLimit-Limit: 120
RateLimit-Remaining: 0
RateLimit-Reset: 42
X-RateLimit-Token-Limit: 120
X-RateLimit-Workspace-Limit: 600

Health Check

Use this endpoint to verify a token and identify the workspace it belongs to.

curl https://mailbase.french-web.com/api/v1/me \
  -H "Authorization: Bearer mb_live_..."
{
  "workspace": { "id": "...", "name": "Acme", "slug": "acme" },
  "scopes": ["email:send", "campaigns:read"]
}

Send Transactional Email

Sends through the workspace's configured useSend connection and default sender. Mailbase records the send for quota, analytics, and future webhook matching.

curl https://mailbase.french-web.com/api/v1/send \
  -H "Authorization: Bearer mb_live_..." \
  -H "Idempotency-Key: invoice-123" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "customer@example.com",
    "subject": "Your invoice is ready",
    "html": "<p>Your invoice is ready.</p>",
    "text": "Your invoice is ready.",
    "transactional": true
  }'

For non-transactional sends, Mailbase adds one-click List-Unsubscribe headers and skips contacts already marked unsubscribed, bounced, complained, or suppressed. Use transactional: true only for service messages that do not require marketing unsubscribe handling.

FieldTypeRequiredNotes
tostring or string[]YesRecipient email address or batch list.
subjectstringYesEmail subject.
htmlstringOne of html/textHTML body.
textstringOne of html/textPlain-text body.
senderIduuidNoOptional configured sender; default sender is used otherwise.
tagsobjectNoForwarded to useSend when supported.
transactionalbooleanNoSet true for service email; marketing sends default to suppression enforcement.

Campaigns

List campaigns in the token's workspace.

curl https://mailbase.french-web.com/api/v1/campaigns \
  -H "Authorization: Bearer mb_live_..."

Audiences

List audiences or create a new static audience with contacts.

curl https://mailbase.french-web.com/api/v1/audiences \
  -H "Authorization: Bearer mb_live_..."
curl https://mailbase.french-web.com/api/v1/audiences \
  -H "Authorization: Bearer mb_live_..." \
  -H "Idempotency-Key: audience-launch-list-1" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Launch list",
    "contacts": [
      { "email": "marie@example.com", "firstName": "Marie" }
    ]
  }'

Outgoing Webhooks

Configure signed event webhooks in Settings → Developer API. Mailbase sends JSON envelopes for email, reply, audience, and campaign events to each active endpoint.

Mailbase-Event: email.delivered
Mailbase-Delivery: 0f6f...
Mailbase-Timestamp: 1779624000
Mailbase-Signature: v1=<hex hmac sha256>

Verify the signature by computing HMAC-SHA256 over timestamp + "." + rawBody with the endpoint signing secret, then compare it with the v1= value from Mailbase-Signature.

Error Format

Errors return JSON with a stable error string.

{
  "error": "Missing scope: email:send"
}
Mailbase
Product
FeaturesPricinguseSend integrationChangelog
Learn
BlogDocsAPI referenceResources
Compare
ComparisonsAlternatives
Guides
Transactional email servicesSelf-hosted useSend stackSelf-hosted email marketingSPF, DKIM & DMARCEmail deliverability
Legal
TermsPrivacy
© 2026 Mailbase · french-webEmail workflow for builders.