Messages
Reply to a message
Refused with 409 mail_loop_risk when the message is automated (auto_reply or delivery_status), and with 429 thread_send_cap and Retry-After once the conversation took 10 messages from this inbox within an hour. 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
/
messages
/
{messageId}
/
reply
Reply to a message
curl --request POST \
--url https://agent-loadout.com/api/v1/messages/{messageId}/reply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"html": "<string>",
"reply_all": true,
"idempotency_key": "<string>",
"attachment_ids": [
"<string>"
],
"headers": {}
}
'import requests
url = "https://agent-loadout.com/api/v1/messages/{messageId}/reply"
payload = {
"text": "<string>",
"html": "<string>",
"reply_all": True,
"idempotency_key": "<string>",
"attachment_ids": ["<string>"],
"headers": {}
}
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({
text: '<string>',
html: '<string>',
reply_all: true,
idempotency_key: '<string>',
attachment_ids: ['<string>'],
headers: {}
})
};
fetch('https://agent-loadout.com/api/v1/messages/{messageId}/reply', 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/messages/{messageId}/reply",
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([
'text' => '<string>',
'html' => '<string>',
'reply_all' => true,
'idempotency_key' => '<string>',
'attachment_ids' => [
'<string>'
],
'headers' => [
]
]),
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/messages/{messageId}/reply"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"reply_all\": true,\n \"idempotency_key\": \"<string>\",\n \"attachment_ids\": [\n \"<string>\"\n ],\n \"headers\": {}\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/messages/{messageId}/reply")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"reply_all\": true,\n \"idempotency_key\": \"<string>\",\n \"attachment_ids\": [\n \"<string>\"\n ],\n \"headers\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent-loadout.com/api/v1/messages/{messageId}/reply")
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 \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"reply_all\": true,\n \"idempotency_key\": \"<string>\",\n \"attachment_ids\": [\n \"<string>\"\n ],\n \"headers\": {}\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
Maximum string length:
500000⌘I
Reply to a message
curl --request POST \
--url https://agent-loadout.com/api/v1/messages/{messageId}/reply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"html": "<string>",
"reply_all": true,
"idempotency_key": "<string>",
"attachment_ids": [
"<string>"
],
"headers": {}
}
'import requests
url = "https://agent-loadout.com/api/v1/messages/{messageId}/reply"
payload = {
"text": "<string>",
"html": "<string>",
"reply_all": True,
"idempotency_key": "<string>",
"attachment_ids": ["<string>"],
"headers": {}
}
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({
text: '<string>',
html: '<string>',
reply_all: true,
idempotency_key: '<string>',
attachment_ids: ['<string>'],
headers: {}
})
};
fetch('https://agent-loadout.com/api/v1/messages/{messageId}/reply', 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/messages/{messageId}/reply",
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([
'text' => '<string>',
'html' => '<string>',
'reply_all' => true,
'idempotency_key' => '<string>',
'attachment_ids' => [
'<string>'
],
'headers' => [
]
]),
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/messages/{messageId}/reply"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"reply_all\": true,\n \"idempotency_key\": \"<string>\",\n \"attachment_ids\": [\n \"<string>\"\n ],\n \"headers\": {}\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/messages/{messageId}/reply")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"reply_all\": true,\n \"idempotency_key\": \"<string>\",\n \"attachment_ids\": [\n \"<string>\"\n ],\n \"headers\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agent-loadout.com/api/v1/messages/{messageId}/reply")
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 \"text\": \"<string>\",\n \"html\": \"<string>\",\n \"reply_all\": true,\n \"idempotency_key\": \"<string>\",\n \"attachment_ids\": [\n \"<string>\"\n ],\n \"headers\": {}\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": {}
}
}