Send a message
Compose and send, or reply. The reply form computes recipients from the message being replied to rather than making the caller reconstruct them from a rendering: a rendering is partly what a sender chose.
A send is subject to the mailbox’s limits and policy. Three outcomes
are normal and distinguishable: it is queued, it is held, or it is
refused with 422 policy_refused and guard naming the rule that
fired. Neither a hold nor a refusal is worth retrying unchanged.
Retrying is how one held message becomes five.
No agent can approve a held message in this deployment (see
hold.update), so a hold ends in rejection when it expires, after
72 hours unless the account set otherwise. A mailbox created on a
customer’s first request has nobody to approve its mail, so what would
be held for it is refused instead, and the agent learns at once which
rule fired.
Pass idempotency_key on every send. Without one, a timeout you retry
is a second message.
Authorizations
Bearer token for one agent. Pass as
Authorization: Bearer <token>.
A token is shown once when it is issued and is not recoverable afterwards. Treat it as a secret: it reaches one agent's mail, calendar and contacts, and anything a grant has extended to it.
Body
Recipients.
Which of the agent's addresses to send as. Empty takes its primary address.
Send as another agent, which needs a grant. The message then names both, so a recipient can see who wrote it and who it is from, and policy usually holds it for approval, which is the point of the distinction.
The plain-text body.
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.
The message this replies to. It is what puts the reply in a conversation.
Compute recipients from the message being replied to, minus the caller's own addresses.
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, held, or refused. Read state: a 200 here
does not mean the message left.
queued means accepted for delivery. held means it is waiting on
an approval and must not be retried. rejected means it is not
sent.
queued, held, rejected The message's identifier, once it has one.
Why, when it is held or rejected.

