Skip to content

Send Message

POST
/v0/inboxes/{inbox_id}/messages/send
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"]}'

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.

inbox_id
required
Inbox Id

Inbox id (inb_…), address or *@domain (the catch-all)

string
Idempotency-Key
Idempotency-Key
string
>= 1 characters <= 255 characters

Send at most once: the same key with the same request answers the message sent before

Media typeapplication/json
MessageSend

A new message from an inbox (a new thread).

object
text
Text

The plain-text body.

Any of:
string
<= 10485760 characters
html
Html

The HTML body.

Any of:
string
<= 10485760 characters
labels
Labels

Labels of the sent copy (system labels are refused).

Array<string>
default: <= 20 items
attachments
Attachments

Files to attach.

Array<object>
default: <= 50 items
AttachmentIn

A file to attach, its bytes in base64.

object
filename
Filename

The file’s name, as the recipient sees it.

Any of:
string
>= 1 characters <= 998 characters
content_type
Content Type

Its media type.

string
default: application/octet-stream <= 255 characters /^[a-z0-9!#$&^_.+-]+/[a-z0-9!#$&^_.+-]+$/
content_disposition
Content Disposition

attachment: a file of the message; inline: shown in its HTML (content_id).

string
default: attachment
Allowed values: attachment inline
content_id
Content Id

For inline: the id the HTML names it by (cid:<content_id>).

Any of:
string
>= 1 characters <= 998 characters
content
required
Content

The file’s bytes, in base64.

string format: base64
to
To

The recipients in To.

Array<string>
default: <= 50 items
cc
Cc

The recipients in Cc.

Array<string>
default: <= 50 items
bcc
Bcc

The recipients in Bcc: in no header.

Array<string>
default: <= 50 items
reply_to
Reply To

Where replies go (Reply-To); omitted: to the inbox.

Array<string>
default: <= 10 items
subject
Subject

The subject.

Any of:
string
>= 1 characters <= 998 characters

Successful Response

Media typeapplication/json
MessageSent

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
message_id
required
Message Id
string
/^msg_[0-7][0-9a-hjkmnp-tv-z]{25}$/
thread_id
required
Thread Id
string
/^thr_[0-7][0-9a-hjkmnp-tv-z]{25}$/

Example

{
"message_id": "msg_01je56wqswfmn9pgbc1wq8tjgq",
"thread_id": "thr_01je56wqswfmn9pgbc1wq8tjgq"
}

An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: Errors.