Docs · beta
Larkspeak docs
Transactional and broadcast email and a notification inbox: one API and one MCP server. What's here is built and tested today.
Getting access
Larkspeak is in private beta. Join the waitlist; when your place opens your organisation gets the API's address and the addresses and domains it sends from, set up with you. Every call carries an OAuth 2 bearer token for a person, their agent, or a service your organisation lets send.
Sending email
POST /v1/messages sends one message per recipient, up to 500 recipients a request and 1 MiB a body: {org, from, to, subject, text and/or html}, or a template with data. A recipient may be {address, data}: their own values over the shared data, so each gets their own subject and body from one request. The whole request is accepted or refused together. Pass an Idempotency-Key header and a retried request returns the first messages instead of sending again.
Also on a send: stream (transactional, the default, or broadcast), tag (one category, up to 100 characters) and metadata (up to 10 keys, values up to 80 characters, such as your own order id). Both come back in lists, on each message and in every hook event.
Messages are queued, signed with DKIM and sent through the relay, retried on temporary failures. Bounces are collected and recorded against the message. Larkspeak also takes mail by SMTP submission, up to 50 recipients a message, with X-Comms-Stream, X-Comms-Tag and X-Comms-Metadata-<key> headers taken out before sending.
Status, search and history
GET /v1/messages/<id> gives a message's status and every attempt with the receiving server's answer (a 5.1.1 means the address doesn't exist). GET /v1/messages/<id>/source is the message exactly as the relay got it, headers and body, less the DKIM signature.
GET /v1/messages?org= lists them newest first, filtered by status, stream, tag, meta=key=value, q (text in the recipient, sender, subject or id) and since and until (a date, an RFC 3339 time or milliseconds). A date range reads only the messages in it.
| Status | Meaning |
|---|---|
queued | Accepted and waiting to send |
sending | Handed to the relay |
sent | The receiving server accepted it |
deferred | A temporary failure; retried on its own |
bounced | The receiving server refused it |
failed | It couldn't be sent |
suppressed | Not sent: this address hard-bounced before |
Templates
Templates fill {{path}} placeholders from a send's data, and from each recipient's own data over it: HTML-escaped in HTML, line breaks removed in the subject. Each change is a new version, and you can preview one with sample data (POST /v1/orgs/<org>/templates/<name>/render). A placeholder with no value refuses the whole request and names whose it was: a refusal is safer than “Hi ,”. Templates hold values only for now; no conditionals, loops or layouts.
Streams and unsubscribe
Each organisation has two streams. Transactional is one person's own mail: receipts, sign-in codes, alerts. Broadcast is the same mail to many, such as release notes. Each stream has its own hourly and daily limits and its own suppressed addresses, so a broadcast that goes badly never blocks a sign-in code.
Every broadcast message carries a one-click unsubscribe (RFC 8058): List-Unsubscribe and List-Unsubscribe-Post headers, both DKIM-signed, with a link signed for that organisation, address and message. Using it suppresses the address in the broadcast stream and sends recipient.unsubscribed to your hook. GET /v1/orgs/<org>/suppressions?kind=unsubscribe&stream=broadcast lists them. Mailing someone again who unsubscribed is an admin's call, and an agent needs an owner's nod. Not yet: an unsubscribe line in the body itself.
Opens and clicks
Off by default. PUT /v1/orgs/<org>/tracking {stream, opens, clicks} turns them on for one stream. HTML mail sent through the API then has its links rewritten to signed tracking links (a changed link answers 404, never a redirect elsewhere) and carries an invisible image. Each recipient gets their own body. GET /v1/messages/<id> shows the message's opens and each link's clicks, and the hook hears message.opened on the first open and message.clicked on each link's first click. A link with data-comms-notrack stays as written.
Beta: tracking links use Larkspeak's own domain (your own tracking domain is not built yet), and mail sent by SMTP submission isn't tracked.
Retention
Messages and their bodies are kept 45 days by default; PUT /v1/orgs/<org>/retention {days} chooses 1 to 365. Older messages are deleted each hour, never one that hasn't settled. An admin can lengthen it; shortening deletes history for good, so it's an owner's, and an agent needs an owner's nod.
The notification inbox
POST /v1/notifications leaves a notification (title, body, link) in a person's inbox, at the same rate as mail. GET /v1/inbox lists a person's own notifications and the unread count; POST /v1/inbox/<id>/read marks one read and POST /v1/inbox/read-all all of them. SMS and push are not sent yet: a notification asking for them records them as not sent.
Events and limits
Each organisation can set one hook: Larkspeak posts each event to it, signed, and retries until it answers 2xx. The signing secret is shown once. Every message event carries the message's tag and metadata. GET /v1/orgs/<org>/events lists what was sent to the hook and whether it was delivered.
| Event | When |
|---|---|
message.sent | The receiving server accepted it |
message.deferred | A temporary failure; it will be retried |
message.bounced | The receiving server refused it, now or later |
message.failed | It couldn't be sent |
message.opened | First open, with tracking on |
message.clicked | A link's first click, with tracking on |
recipient.unsubscribed | Someone used a broadcast message's one-click unsubscribe |
notification.created | A notification left in someone's inbox |
Each stream has messages per hour and per day (100 and 1,000 by default; notifications count too). Past a limit the answer is 429 with Retry-After. Admins can lower limits; raising them needs an owner's nod. GET /v1/orgs/<org>/usage shows this hour, today and each of the last 24 hours, with how many messages were sent, deferred, bounced, failed or suppressed in each.
Agents and MCP
Larkspeak has an MCP server at /mcp. Each tool calls the API as the caller, so their role decides and the API enforces limits and nods. Mail an agent sends is recorded as sent by the person, through that agent.
| Tool | What it does | Level |
|---|---|---|
list_orgs, get_org | Which organisation, its sender addresses, its limits | free |
list_messages | Messages by status, stream, tag, metadata, date or text, with their attempts | free |
get_message, get_message_source | One message: every attempt, opens and clicks, and its raw source | free |
get_usage | This hour, today and each of the last 24 hours, with what happened to them | free |
list_templates, preview_template | Templates, and one filled with sample data without sending | free |
list_suppressions | Addresses blocked after a hard bounce or an unsubscribe | free |
list_inbox, mark_read | The person's own notifications | free |
send_message | Send from the organisation's senders, within its rate, up to 500 recipients | limits |
notify | Leave a notification in someone's inbox | limits |
set_template | Add or change a template version | limits |
set_tracking | Turn open and click tracking on or off for a stream | limits |
lift_suppression | Unblock an address that bounced, once the person says it works | limits |
set_limits | Lower a stream's sending limits | limits |
set_retention | Keep messages longer | limits |
set_limits | Raise a stream's sending limits | nod |
set_retention | Keep messages for less time: older ones go for good | nod |
lift_suppression | Mail someone again who unsubscribed | nod |
set_member, set_client | Add a member or a service, or change a role | nod |
set_hook | Send the organisation's events to a new URL | nod |
An action that needs a nod is refused with a challenge naming exactly that action, until a person approves it on their own device. An agent never approves for itself. view_messages {org} opens one screen: messages, templates, senders, limits and usage, settings and the inbox, every button a tool call as the signed-in person.