For developers & AI agents

Build on Hanbai

A public REST API and a remote MCP server for sending email, managing domains and contacts, and running broadcasts — programmatically or from an AI agent.

REST API

Authenticate with a scoped API key from Settings → API Keys (hb_live_… / hb_test_…) as a Bearer token, or with an OAuth 2.1 access token (see below).

EndpointScopeDoes
/api/v1/emailsemails:sendSend a single email, or send/manage a scheduled email (get status, cancel, reschedule).
/api/v1/emails/batchemails:sendSend up to 100 emails in a single request.
/api/v1/domainsdomains:read / domains:writeList sending domains, provision a new domain in a chosen region, verify DNS, and run a live SPF/DKIM/DMARC/MX audit.
/api/v1/contactscontacts:read / contacts:writeList and add/update contacts (audience members), scoped to a brand.
/api/v1/broadcastsbroadcasts:sendSend a one-off broadcast to all active contacts of a brand — respects suppression lists and plan limits.
/api/v1/webhooksdomains:read / domains:writeList and register webhook endpoints for email and domain events.

Available scopes

emails:sendemails:readdomains:readdomains:writeinbound:readcontacts:readcontacts:writebroadcasts:send

Keys are scoped to your organization and can be assigned any combination of the scopes above when you create them in Settings → API Keys.

MCP server

Hanbai runs a remote MCP (Model Context Protocol) server so AI agents — Claude, Claude Desktop, or any MCP-compatible client — can send email, manage domains, and run broadcasts directly. Each tool call is forwarded to the REST API above with your bearer token, so the same scopes, rate limits, and audit trail apply.

Connection

Transport
streamable-http (JSON-RPC over POST)
Endpoint
https://hanb.ai/api/mcp
Auth
Bearer Hanbai API key (from Settings → API Keys), or OAuth 2.1

Live connection metadata (including a copy-paste Claude Desktop config) is always up to date at GET /api/mcp/info.

Available tools

send_emailsend_batch_emailget_email_statuscancel_emailreschedule_emailadd_domainverify_domainlist_domainsaudit_domainadd_contactlist_contactssend_broadcast

OAuth 2.1

For MCP clients that support dynamic OAuth discovery instead of a pasted API key, Hanbai exposes standard OAuth 2.1 metadata with PKCE (S256) and dynamic client registration:

Authorization endpoint

/oauth/authorize

Token endpoint

/api/oauth/token

Dynamic client registration

/api/oauth/register

Authorization server metadata

/.well-known/oauth-authorization-server

Protected resource metadata

/.well-known/oauth-protected-resource

Webhooks

Register a webhook via /api/v1/webhooks to get notified of email and domain events instead of polling.

Ready to build?

Create an API key from your dashboard settings and start sending in minutes.

Start Free Trial