curl --request POST \
--url https://app.artil.ai/api/agents/{id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"replyTo": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"forward": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to": [
"<string>"
],
"cc": [
"<string>"
],
"subject": "<string>"
}
'import requests
url = "https://app.artil.ai/api/agents/{id}/messages"
payload = {
"text": "<string>",
"replyTo": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"forward": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to": ["<string>"],
"cc": ["<string>"],
"subject": "<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({
text: '<string>',
replyTo: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
forward: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
to: ['<string>'],
cc: ['<string>'],
subject: '<string>'
})
};
fetch('https://app.artil.ai/api/agents/{id}/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://app.artil.ai/api/agents/{id}/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([
'text' => '<string>',
'replyTo' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'forward' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'to' => [
'<string>'
],
'cc' => [
'<string>'
],
'subject' => '<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://app.artil.ai/api/agents/{id}/messages"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"replyTo\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"forward\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\"\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://app.artil.ai/api/agents/{id}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"replyTo\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"forward\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.artil.ai/api/agents/{id}/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 \"text\": \"<string>\",\n \"replyTo\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"forward\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"addressId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "email",
"direction": "inbound",
"counterpart": "<string>",
"counterpartName": "<string>",
"to": [
"<string>"
],
"cc": [
"<string>"
],
"subject": "<string>",
"text": "<string>",
"attachments": [
{
"name": "<string>",
"type": "<string>",
"size": 123
}
],
"thread": {
"messageId": "<string>",
"references": [
"<string>"
]
},
"status": "received",
"refusal": "self",
"admission": "team",
"error": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "invalid_input",
"message": "<string>"
}
}Send a message
Answer a message by giving its id as replyTo, start a new one with a channel and recipients in to, or pass one on by giving its id as forward and recipients in to.
curl --request POST \
--url https://app.artil.ai/api/agents/{id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"replyTo": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"forward": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to": [
"<string>"
],
"cc": [
"<string>"
],
"subject": "<string>"
}
'import requests
url = "https://app.artil.ai/api/agents/{id}/messages"
payload = {
"text": "<string>",
"replyTo": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"forward": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"to": ["<string>"],
"cc": ["<string>"],
"subject": "<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({
text: '<string>',
replyTo: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
forward: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
to: ['<string>'],
cc: ['<string>'],
subject: '<string>'
})
};
fetch('https://app.artil.ai/api/agents/{id}/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://app.artil.ai/api/agents/{id}/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([
'text' => '<string>',
'replyTo' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'forward' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'to' => [
'<string>'
],
'cc' => [
'<string>'
],
'subject' => '<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://app.artil.ai/api/agents/{id}/messages"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"replyTo\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"forward\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\"\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://app.artil.ai/api/agents/{id}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"replyTo\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"forward\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.artil.ai/api/agents/{id}/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 \"text\": \"<string>\",\n \"replyTo\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"forward\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"addressId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "email",
"direction": "inbound",
"counterpart": "<string>",
"counterpartName": "<string>",
"to": [
"<string>"
],
"cc": [
"<string>"
],
"subject": "<string>",
"text": "<string>",
"attachments": [
{
"name": "<string>",
"type": "<string>",
"size": 123
}
],
"thread": {
"messageId": "<string>",
"references": [
"<string>"
]
},
"status": "received",
"refusal": "self",
"admission": "team",
"error": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "invalid_input",
"message": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The agent's id
Body
1 - 32000^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$email, sms, telegram 1 - 10 elements1 - 320501 - 320240Response
The sent message
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$The agent's address the message came to or went from
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$email, sms, telegram inbound, outbound Who sent an inbound message, or the recipients of an outbound one
The name an inbound message's sender goes by, when the channel tells it
Whom the message names as its recipients; an inbound one names the agent unless it got a blind copy
Whom the message names as getting a copy
Show child attributes
Show child attributes
For received and imported email, its Message-ID and References; for email the agent sent, those of the email it answered
Show child attributes
Show child attributes
reported when the recipient marked an email the agent sent as spam
received, refused, sending, sent, failed, imported, reported Why a refused message did not wake the agent
self, spam, plan_limit, rate_limit, sender, outsider, unverified Who the sender of a received message is to the agent: team for a member or agent of the workspace, listed for a sender on the channel's list, and anyone for everyone else, including senders who could not be verified
team, listed, anyone Why a failed message was not sent or did not arrive