Flow
ServicesCommunications Service

API

Send, list, bulk, webhooks, and the tool catalog for the communications service.

Discovery and ops

PathMethodNotes
/GETService discovery (enveloped)
/api-docsGETSwagger UI
/openapi.yaml, /openapi.jsonGETSpec from binary
/healthzGETLiveness
/readyzGETReadiness (Postgres ping)

Versioned API

PathMethodPurpose
/v1/channelsGETChannel list + available
/v1/toolsGETCommitted tool catalog
/v1/messagesPOSTOne send
/v1/messages/{id}GETOne message + provider_message_id
/v1/announcementsPOSTBulk send
/v1/announcements/{id}GETBlast status
/v1/conversationsGETList threads
/v1/conversations/{id}GETThread + messages
/v1/conversations/{id}/linkPOSTAttach agent_id
/v1/webhooks/twilioPOSTInbound SMS
/v1/webhooks/mailgunPOSTInbound email. Recipient ${slug}@ on the agent domain links the thread

Enveloped All /v1/* JSON uses the Response envelope: The template service wraps every JSON response in {header, payload}. A success payload is {data} (a record or a list) plus optional meta.pagination; accounting still returns bare bodies and RFC 9457 errors until the divergence is resolved.. Webhooks are form posts and are not enveloped.

Authorization is Cedar: The authorization engine; each service embeds a Cedar policy and evaluates every mutating request against the actor's principal record.: communications::Send, communications::Announce, communications::Read, communications::LinkAgent. Webhooks are off Cedar. The shared service token (X-Flow-Service-Token) is accepted the same way foundry accepts it, so the harness can send. For SMS, from may be omitted; the service uses TWILIO_FROM_NUMBER. For email, from may be omitted; the service uses MAILGUN_FROM. The harness sends agent mail as the agent's mailbox (${slug}@ the agent domain) instead.

Headers

HeaderRequiredPurpose
Idempotency-KeyEvery mutating /v1/* commandStable across retries
Content-TypePOST JSONapplication/json
X-Dev-Principallocal DEV_AUTH=1 onlyThe caller email
X-Flow-Service-Tokencluster service-to-serviceShared token; actor is system

Events carry ids only: conversation.message.sent, conversation.message.received, announcement.created, announcement.completed.

On this page