Send Message
curl -s -X POST "https://api.yoagent.dev/v0/inboxes/inb_01je56wqswfmn9pgbc1wq8tjgq/messages/send" \ -H "Authorization: Bearer $YOAGENT_KEY" \ -H "Content-Type: application/json" \ -d '{"text":"Hello from a test.","to":["test@k7m2xq4p.yoagent.email"]}'const response = await fetch("https://api.yoagent.dev/v0/inboxes/inb_01je56wqswfmn9pgbc1wq8tjgq/messages/send", { method: "POST", headers: { Authorization: `Bearer ${process.env.YOAGENT_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "text": "Hello from a test.", "to": [ "test@k7m2xq4p.yoagent.email" ] }),});if (!response.ok) throw new Error(await response.text());const data = await response.json();import os
import requests
response = requests.post( "https://api.yoagent.dev/v0/inboxes/inb_01je56wqswfmn9pgbc1wq8tjgq/messages/send", headers={"Authorization": f"Bearer {os.environ['YOAGENT_KEY']}"}, json={ "text": "Hello from a test.", "to": [ "test@k7m2xq4p.yoagent.email", ], }, timeout=60,)response.raise_for_status()data = response.json()Send a message from an inbox, in a new thread (message_send there); delivery goes on after the answer. A
catch-all inbox cannot send.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Inbox id (inb_…), address or *@domain (the catch-all)
Header Parameters
Section titled “Header Parameters”Send at most once: the same key with the same request answers the message sent before
Request Bodyrequired
Section titled “Request Bodyrequired”A new message from an inbox (a new thread).
object
Labels of the sent copy (system labels are refused).
Files to attach.
A file to attach, its bytes in base64.
object
Its media type.
attachment: a file of the message; inline: shown in its HTML (content_id).
The file’s bytes, in base64.
The recipients in To.
The recipients in Cc.
The recipients in Bcc: in no header.
Where replies go (Reply-To); omitted: to the inbox.
Responses
Section titled “Responses”Successful Response
A sent message: its copy in the inbox and its thread. Delivery goes on after the answer (message.sent,
message.delivered and the rest).
object
Example
{ "message_id": "msg_01je56wqswfmn9pgbc1wq8tjgq", "thread_id": "thr_01je56wqswfmn9pgbc1wq8tjgq"}default
Section titled “default”An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: Errors.