Messages
Send a message
Queued for delivery; the status becomes sent/delivered later. Reuse idempotency_key when retrying. From an inbox with outbound_approval: required, an agent token’s message is stored with status awaiting_approval and is not sent until a member or an organization key approves it; it is rejected when turned down or not decided within 7 days. The answer has the same shape either way. Do not send it again: follow the message or the message.approved and message.rejected events. Organization keys send directly.
POST
/
api
/
v1
/
inboxes
/
{inboxId}
/
messages
Send a message
curl --request POST \
--url https://agent-loadout.com/api/v1/inboxes/{inboxId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": [
"<string>"
],
"subject": "<string>",
"cc": [
"<string>"
],
"bcc": [
"<string>"
],
"text": "<string>",
"html": "<string>",
"idempotency_key": "<string>",
"attachment_ids": [
"<string>"
],
"draft_id": "<string>",
"draft_updated_at": "2023-11-07T05:31:56Z",
"reply_to": [
"<string>"
],
"headers": {},
"labels": [
"<string>"
]
}
'import requests
url = "https://agent-loadout.com/api/v1/inboxes/{inboxId}/messages"
payload = {
"to": ["<string>"],
"subject": "<string>",
"cc": ["<string>"],
"bcc": ["<string>"],
"text": "<string>",
"html": "<string>",
"idempotency_key": "<string>",
"attachment_ids": ["<string>"],
"draft_id": "<string>",
"draft_updated_at": "2023-11-07T05:31:56Z",
"reply_to": ["<string>"],
"headers": {},
"labels": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: ['<string>'],
subject: '<string>',
cc: ['<string>'],
bcc: ['<string>'],
text: '<string>',
html: '<string>',
idempotency_key: '<string>',
attachment_ids: ['<string>'],
draft_id: '<string>',
draft_updated_at: '2023-11-07T05:31:56Z',
reply_to: ['<string>'],
headers: {},
labels: ['<string>']
})
};
fetch('https://agent-loadout.com/api/v1/inboxes/{inboxId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agent-loadout.com/api/v1/inboxes/{inboxId}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => [
'<string>'
],
'subject' => '<string>',
'cc' => [
'<string>'
],
'bcc' => [
'<string>'
],
'text' => '<string>',
'html' => '<string>',
'idempotency_key' => '<string>',
'attachment_ids' => [
'<string>'
],
'draft_id' => '<string>',
'draft_updated_at' => '2023-11-07T05:31:56Z',
'reply_to' => [
'<string>'
],
'headers' => [
],
'labels' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-loadout.com/api/v1/inboxes/{inboxId}/messages"
payload := strings.NewReader("{\n \"to\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"attachment_ids\": [\n \"<string>\"\n ],\n \"draft_id\": \"<string>\",\n \"draft_updated_at\": \"2023-11-07T05:31:56Z\",\n \"reply_to\": [\n \"<string>\"\n ],\n \"headers\": {},\n \"labels\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://agent-loadout.com/api/v1/inboxes/{inboxId}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"attachment_ids\": [\n \"<string>\"\n ],\n \"draft_id\": \"<string>\",\n \"draft_updated_at\": \"2023-11-07T05:31:56Z\",\n \"reply_to\": [\n \"<string>\"\n ],\n \"headers\": {},\n \"labels\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent-loadout.com/api/v1/inboxes/{inboxId}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"attachment_ids\": [\n \"<string>\"\n ],\n \"draft_id\": \"<string>\",\n \"draft_updated_at\": \"2023-11-07T05:31:56Z\",\n \"reply_to\": [\n \"<string>\"\n ],\n \"headers\": {},\n \"labels\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": {
"id": "<string>",
"inbox_id": "<string>",
"thread_id": "<string>",
"direction": "inbound",
"status": "pending",
"from": {
"address": "<string>",
"name": "<string>"
},
"to": [
{
"address": "<string>",
"name": "<string>"
}
],
"subject": "<string>",
"snippet": "<string>",
"has_attachments": true,
"automated": "auto_reply",
"created_at": "2023-11-07T05:31:56Z",
"received_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"authentication": {
"spf": "<string>",
"dkim": "<string>",
"dmarc": "<string>",
"spam": "<string>",
"virus": "<string>"
},
"screening": {
"verdict": "pending",
"reasons": [
"<string>"
],
"warning": "<string>"
},
"cc": [
{
"address": "<string>",
"name": "<string>"
}
],
"bcc": [
{
"address": "<string>",
"name": "<string>"
}
],
"reply_to": [
{
"address": "<string>",
"name": "<string>"
}
],
"rfc_message_id": "<string>",
"in_reply_to": "<string>",
"references": [
"<string>"
],
"text": "<string>",
"html": "<string>",
"truncated": true,
"extracted_text": "<string>",
"error": "<string>",
"attachments": [
{
"id": "<string>",
"filename": "<string>",
"content_type": "<string>",
"size_bytes": 0,
"status": "pending",
"download_path": "<string>",
"content_id": "<string>",
"inline": true
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}Authorizations
agentTokenorganizationKey
Body
application/json
Plain-text body (recommended)
Maximum string length:
500000⌘I
Send a message
curl --request POST \
--url https://agent-loadout.com/api/v1/inboxes/{inboxId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": [
"<string>"
],
"subject": "<string>",
"cc": [
"<string>"
],
"bcc": [
"<string>"
],
"text": "<string>",
"html": "<string>",
"idempotency_key": "<string>",
"attachment_ids": [
"<string>"
],
"draft_id": "<string>",
"draft_updated_at": "2023-11-07T05:31:56Z",
"reply_to": [
"<string>"
],
"headers": {},
"labels": [
"<string>"
]
}
'import requests
url = "https://agent-loadout.com/api/v1/inboxes/{inboxId}/messages"
payload = {
"to": ["<string>"],
"subject": "<string>",
"cc": ["<string>"],
"bcc": ["<string>"],
"text": "<string>",
"html": "<string>",
"idempotency_key": "<string>",
"attachment_ids": ["<string>"],
"draft_id": "<string>",
"draft_updated_at": "2023-11-07T05:31:56Z",
"reply_to": ["<string>"],
"headers": {},
"labels": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: ['<string>'],
subject: '<string>',
cc: ['<string>'],
bcc: ['<string>'],
text: '<string>',
html: '<string>',
idempotency_key: '<string>',
attachment_ids: ['<string>'],
draft_id: '<string>',
draft_updated_at: '2023-11-07T05:31:56Z',
reply_to: ['<string>'],
headers: {},
labels: ['<string>']
})
};
fetch('https://agent-loadout.com/api/v1/inboxes/{inboxId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agent-loadout.com/api/v1/inboxes/{inboxId}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => [
'<string>'
],
'subject' => '<string>',
'cc' => [
'<string>'
],
'bcc' => [
'<string>'
],
'text' => '<string>',
'html' => '<string>',
'idempotency_key' => '<string>',
'attachment_ids' => [
'<string>'
],
'draft_id' => '<string>',
'draft_updated_at' => '2023-11-07T05:31:56Z',
'reply_to' => [
'<string>'
],
'headers' => [
],
'labels' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-loadout.com/api/v1/inboxes/{inboxId}/messages"
payload := strings.NewReader("{\n \"to\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"attachment_ids\": [\n \"<string>\"\n ],\n \"draft_id\": \"<string>\",\n \"draft_updated_at\": \"2023-11-07T05:31:56Z\",\n \"reply_to\": [\n \"<string>\"\n ],\n \"headers\": {},\n \"labels\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://agent-loadout.com/api/v1/inboxes/{inboxId}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"attachment_ids\": [\n \"<string>\"\n ],\n \"draft_id\": \"<string>\",\n \"draft_updated_at\": \"2023-11-07T05:31:56Z\",\n \"reply_to\": [\n \"<string>\"\n ],\n \"headers\": {},\n \"labels\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent-loadout.com/api/v1/inboxes/{inboxId}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"attachment_ids\": [\n \"<string>\"\n ],\n \"draft_id\": \"<string>\",\n \"draft_updated_at\": \"2023-11-07T05:31:56Z\",\n \"reply_to\": [\n \"<string>\"\n ],\n \"headers\": {},\n \"labels\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": {
"id": "<string>",
"inbox_id": "<string>",
"thread_id": "<string>",
"direction": "inbound",
"status": "pending",
"from": {
"address": "<string>",
"name": "<string>"
},
"to": [
{
"address": "<string>",
"name": "<string>"
}
],
"subject": "<string>",
"snippet": "<string>",
"has_attachments": true,
"automated": "auto_reply",
"created_at": "2023-11-07T05:31:56Z",
"received_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"authentication": {
"spf": "<string>",
"dkim": "<string>",
"dmarc": "<string>",
"spam": "<string>",
"virus": "<string>"
},
"screening": {
"verdict": "pending",
"reasons": [
"<string>"
],
"warning": "<string>"
},
"cc": [
{
"address": "<string>",
"name": "<string>"
}
],
"bcc": [
{
"address": "<string>",
"name": "<string>"
}
],
"reply_to": [
{
"address": "<string>",
"name": "<string>"
}
],
"rfc_message_id": "<string>",
"in_reply_to": "<string>",
"references": [
"<string>"
],
"text": "<string>",
"html": "<string>",
"truncated": true,
"extracted_text": "<string>",
"error": "<string>",
"attachments": [
{
"id": "<string>",
"filename": "<string>",
"content_type": "<string>",
"size_bytes": 0,
"status": "pending",
"download_path": "<string>",
"content_id": "<string>",
"inline": true
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>",
"details": {}
}
}