Overview
The AllternitBus API provides the runtime surface agents use to send and receive messages, store encrypted secrets, resolve connector credentials, and manage identity channels such as email, phone, and wallet addresses. All authenticated routes are mounted under/api/v1 and require a valid bearer token via the platform auth middleware. The public inbound webhook is mounted at /webhooks/photon and is called server-to-server by Photon.codes.
Base URL
Authenticated surface:Authentication
All authenticated routes require a valid bearer token in theAuthorization header. The inbound Photon webhook is authenticated server-to-server by Photon.codes and does not carry a Clerk session. See Authentication for details.
Endpoints
Message inbox
Send a message
Request body
Example request
Example response
List inbox messages
Query parameters
Example request
Example response
Inbound webhook
Receive an inbound message
to phone number. No bearer token is required.
Request body
Example request
Example response
Secrets
Set a secret
token_crypto. If a secret with the same key already exists, it is overwritten.
Request body
Example request
Example response
Resolve secrets
missing and errors.
Request body
Each reference:
Example request
Example response
Connectors
Resolve connector credentials
connector_connections row for the caller, then falls back to legacy allternit_vault_credentials that belong to the agent and user.
Request body
Each binding:
Example request
Example response
Identity channels
Get identity channels
null.
Example request
Example response
Provision email
ALLTERNIT_BOT_EMAIL_DOMAIN.
When the mailflare agent-email rail is configured (ALLTERNIT_MAILFLARE_URL + ALLTERNIT_MAILFLARE_ADMIN_KEY), this creates a real mailbox on the mailflare worker, mints a mailbox-scoped send/read API key, seals it server-side, and stores the channel with provider "mailflare". The agent can then genuinely receive and (subject to approval) send internet email. When mailflare is not configured, the endpoint falls back to minting an address record only (provider "commrails") with no send/receive transport.
Provisioning is idempotent: re-provisioning an agent returns its existing channel.
Example request
Example response
Agent email rail
Real inbound/outbound email for agents, backed by a per-installation mailflare worker (seeservices/mailflare/). Inbound mail arrives as an HMAC-signed webhook and is bridged into the agent’s Rails Mail threads; outbound mail is held for human approval before it is sent.
Send email (approval-gated)
The message is not sent immediately. It is recorded as
pending_approval and a review is requested on a Rails Mail thread (mail:email-out-<id>). A human approves or rejects via POST /api/rails/mail/decide with { "thread": "<thread_id>", "approve": true|false }; approving triggers the actual send and writes a receipt with the provider message id. The decide response includes an email object for email threads.
Email rail status
Inbound webhook (server-to-server)
X-Email-Platform-Signature HMAC-SHA256 header against ALLTERNIT_MAILFLARE_WEBHOOK_SECRET. message.inbound events are stored and bridged into the receiving agent’s Rails Mail thread (mail:email-in-<agent>). Unknown recipients return 202 and are logged.
Provision phone
ALLTERNIT_BOT_PHONE_POOL. The first number not already assigned to another agent is chosen.
Example request
Example response
Cross-surface bridge
Bridge a session
bridged status.