Skip to main content
POST
Send a message

Authorizations

Authorization
string
header
required

Bearer credential for one agent: an API key or an access token (a JWT). Pass as Authorization: Bearer <credential>.

A key is shown once when it is issued and is not recoverable afterwards; an access token lives five minutes and is fetched with the agent's own client key from the access service. Treat both as secrets: they reach one agent's mail, and anything a delegation has extended to it. An access token's scope is a ceiling on what the agent may do with it.

Body

application/json
to
string[]

Recipients. May be omitted on a reply, which takes them from the message being replied to. A send with no recipients at all is refused.

cc
string[]
bcc
string[]
from
string

Which of the agent's addresses to send as. Empty takes its primary address.

on_behalf_of
string

Send as another agent, which needs a send-on-behalf grant from that agent's owner, the organization's permission for sending on behalf, and a From domain verified for the workspace. Without all three the send is refused with 422 policy_refused. The message then names both, with the sending agent in Sender, so a recipient can see who wrote it and who it is from.

subject
string
text
string

The plain-text body.

html
string

An alternative to text, not a replacement for it. A message with no plain part is one the reader on the other side has to render before it can read it.

in_reply_to
string

The message this replies to. It is what puts the reply in a conversation.

Example:

"message_01j9x2v8k3e0080000000000"

reply_all
boolean

Compute recipients from the message being replied to, minus the caller's own addresses.

agent
object

A machine-readable part, for an exchange between two agents. It travels with the message beside the text, and the receiving side can filter on it. Keys outside this shape are dropped, not carried.

idempotency_key
string

Strongly recommended. A repeat with the same key returns the first attempt's result rather than sending a second message.

Response

The send was accepted for delivery. A 200 here does not mean the message left — a guard that would refuse it does so as an error response instead, before this result is ever built.

state
enum<string>

A new send is queued: accepted for delivery, returned as soon as the message is durably queued and before it is handed on. A repeat with the same idempotency_key reports the message's state now, which may be any later one. held is a message waiting for a person to approve it, with approval_id; it becomes queued when approved and rejected when a person refuses it or the wait lapses. A send that a guard refuses comes back as an error instead of a result.

Available options:
queued,
sending,
sent,
delivered,
bounced,
failed,
held,
rejected
approval_id
string

The approval a held message is waiting on. Absent until the request for approval has been filed, which is retried in the background; the message is held either way.

message
string

The message's identifier.

thread
string

The conversation it belongs to.

reason
string

On a queued message, why it waits instead of going now: provisioning while the sender's domain is being verified (it goes out once it is), or paused. On a repeat for a message that failed, why it failed. Absent when nothing is in the way.

remaining
object

What is left of each sending limit this send counted against, by limit name.

error
object