BetaLarkspeak is in private beta. Join the waitlist.
LarkspeakBeta

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.

StatusMeaning
queuedAccepted and waiting to send
sendingHanded to the relay
sentThe receiving server accepted it
deferredA temporary failure; retried on its own
bouncedThe receiving server refused it
failedIt couldn't be sent
suppressedNot 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.

EventWhen
message.sentThe receiving server accepted it
message.deferredA temporary failure; it will be retried
message.bouncedThe receiving server refused it, now or later
message.failedIt couldn't be sent
message.openedFirst open, with tracking on
message.clickedA link's first click, with tracking on
recipient.unsubscribedSomeone used a broadcast message's one-click unsubscribe
notification.createdA 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.

ToolWhat it doesLevel
list_orgs, get_orgWhich organisation, its sender addresses, its limitsfree
list_messagesMessages by status, stream, tag, metadata, date or text, with their attemptsfree
get_message, get_message_sourceOne message: every attempt, opens and clicks, and its raw sourcefree
get_usageThis hour, today and each of the last 24 hours, with what happened to themfree
list_templates, preview_templateTemplates, and one filled with sample data without sendingfree
list_suppressionsAddresses blocked after a hard bounce or an unsubscribefree
list_inbox, mark_readThe person's own notificationsfree
send_messageSend from the organisation's senders, within its rate, up to 500 recipientslimits
notifyLeave a notification in someone's inboxlimits
set_templateAdd or change a template versionlimits
set_trackingTurn open and click tracking on or off for a streamlimits
lift_suppressionUnblock an address that bounced, once the person says it workslimits
set_limitsLower a stream's sending limitslimits
set_retentionKeep messages longerlimits
set_limitsRaise a stream's sending limitsnod
set_retentionKeep messages for less time: older ones go for goodnod
lift_suppressionMail someone again who unsubscribednod
set_member, set_clientAdd a member or a service, or change a rolenod
set_hookSend the organisation's events to a new URLnod

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.