curl --request POST \
--url https://api.useanima.sh/v1/email/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentId": "<string>",
"to": [
"jsmith@example.com"
],
"subject": "<string>",
"body": "<string>",
"fromIdentityId": "<string>",
"cc": [],
"bcc": [],
"bodyHtml": "<string>",
"attachments": [
{
"filename": "<string>",
"contentId": "<string>",
"contentType": "<string>",
"content": "<string>",
"url": "<string>"
}
],
"headers": {},
"metadata": {},
"inReplyTo": "<string>",
"references": []
}
'import requests
url = "https://api.useanima.sh/v1/email/send"
payload = {
"agentId": "<string>",
"to": ["jsmith@example.com"],
"subject": "<string>",
"body": "<string>",
"fromIdentityId": "<string>",
"cc": [],
"bcc": [],
"bodyHtml": "<string>",
"attachments": [
{
"filename": "<string>",
"contentId": "<string>",
"contentType": "<string>",
"content": "<string>",
"url": "<string>"
}
],
"headers": {},
"metadata": {},
"inReplyTo": "<string>",
"references": []
}
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({
agentId: '<string>',
to: ['jsmith@example.com'],
subject: '<string>',
body: JSON.stringify('<string>'),
fromIdentityId: '<string>',
cc: [],
bcc: [],
bodyHtml: '<string>',
attachments: [
{
filename: '<string>',
contentId: '<string>',
contentType: '<string>',
content: '<string>',
url: '<string>'
}
],
headers: {},
metadata: {},
inReplyTo: '<string>',
references: []
})
};
fetch('https://api.useanima.sh/v1/email/send', 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://api.useanima.sh/v1/email/send",
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([
'agentId' => '<string>',
'to' => [
'jsmith@example.com'
],
'subject' => '<string>',
'body' => '<string>',
'fromIdentityId' => '<string>',
'cc' => [
],
'bcc' => [
],
'bodyHtml' => '<string>',
'attachments' => [
[
'filename' => '<string>',
'contentId' => '<string>',
'contentType' => '<string>',
'content' => '<string>',
'url' => '<string>'
]
],
'headers' => [
],
'metadata' => [
],
'inReplyTo' => '<string>',
'references' => [
]
]),
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://api.useanima.sh/v1/email/send"
payload := strings.NewReader("{\n \"agentId\": \"<string>\",\n \"to\": [\n \"jsmith@example.com\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"fromIdentityId\": \"<string>\",\n \"cc\": [],\n \"bcc\": [],\n \"bodyHtml\": \"<string>\",\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"contentId\": \"<string>\",\n \"contentType\": \"<string>\",\n \"content\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"headers\": {},\n \"metadata\": {},\n \"inReplyTo\": \"<string>\",\n \"references\": []\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://api.useanima.sh/v1/email/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"<string>\",\n \"to\": [\n \"jsmith@example.com\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"fromIdentityId\": \"<string>\",\n \"cc\": [],\n \"bcc\": [],\n \"bodyHtml\": \"<string>\",\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"contentId\": \"<string>\",\n \"contentType\": \"<string>\",\n \"content\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"headers\": {},\n \"metadata\": {},\n \"inReplyTo\": \"<string>\",\n \"references\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useanima.sh/v1/email/send")
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 \"agentId\": \"<string>\",\n \"to\": [\n \"jsmith@example.com\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"fromIdentityId\": \"<string>\",\n \"cc\": [],\n \"bcc\": [],\n \"bodyHtml\": \"<string>\",\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"contentId\": \"<string>\",\n \"contentType\": \"<string>\",\n \"content\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"headers\": {},\n \"metadata\": {},\n \"inReplyTo\": \"<string>\",\n \"references\": []\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agentId": "<string>",
"inboxId": "<string>",
"channel": "EMAIL",
"direction": "INBOUND",
"status": "QUEUED",
"fromAddress": "<string>",
"toAddress": "<string>",
"subject": "<string>",
"body": "<string>",
"bodyHtml": "<string>",
"extractedText": "<string>",
"extractedHtml": "<string>",
"headers": {},
"metadata": {},
"threadId": "<string>",
"labels": [
"<string>"
],
"inReplyTo": "<string>",
"externalId": "<string>",
"deletedAt": "2023-11-07T05:31:56Z",
"sentAt": "2023-11-07T05:31:56Z",
"receivedAt": "2023-11-07T05:31:56Z",
"readAt": "2023-11-07T05:31:56Z",
"attachments": [
{
"id": "<string>",
"filename": "<string>",
"mimeType": "<string>",
"sizeBytes": 1,
"storageKey": "<string>",
"url": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"scanStatus": "PENDING",
"detectedMimeType": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Post emailsend
curl --request POST \
--url https://api.useanima.sh/v1/email/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentId": "<string>",
"to": [
"jsmith@example.com"
],
"subject": "<string>",
"body": "<string>",
"fromIdentityId": "<string>",
"cc": [],
"bcc": [],
"bodyHtml": "<string>",
"attachments": [
{
"filename": "<string>",
"contentId": "<string>",
"contentType": "<string>",
"content": "<string>",
"url": "<string>"
}
],
"headers": {},
"metadata": {},
"inReplyTo": "<string>",
"references": []
}
'import requests
url = "https://api.useanima.sh/v1/email/send"
payload = {
"agentId": "<string>",
"to": ["jsmith@example.com"],
"subject": "<string>",
"body": "<string>",
"fromIdentityId": "<string>",
"cc": [],
"bcc": [],
"bodyHtml": "<string>",
"attachments": [
{
"filename": "<string>",
"contentId": "<string>",
"contentType": "<string>",
"content": "<string>",
"url": "<string>"
}
],
"headers": {},
"metadata": {},
"inReplyTo": "<string>",
"references": []
}
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({
agentId: '<string>',
to: ['jsmith@example.com'],
subject: '<string>',
body: JSON.stringify('<string>'),
fromIdentityId: '<string>',
cc: [],
bcc: [],
bodyHtml: '<string>',
attachments: [
{
filename: '<string>',
contentId: '<string>',
contentType: '<string>',
content: '<string>',
url: '<string>'
}
],
headers: {},
metadata: {},
inReplyTo: '<string>',
references: []
})
};
fetch('https://api.useanima.sh/v1/email/send', 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://api.useanima.sh/v1/email/send",
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([
'agentId' => '<string>',
'to' => [
'jsmith@example.com'
],
'subject' => '<string>',
'body' => '<string>',
'fromIdentityId' => '<string>',
'cc' => [
],
'bcc' => [
],
'bodyHtml' => '<string>',
'attachments' => [
[
'filename' => '<string>',
'contentId' => '<string>',
'contentType' => '<string>',
'content' => '<string>',
'url' => '<string>'
]
],
'headers' => [
],
'metadata' => [
],
'inReplyTo' => '<string>',
'references' => [
]
]),
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://api.useanima.sh/v1/email/send"
payload := strings.NewReader("{\n \"agentId\": \"<string>\",\n \"to\": [\n \"jsmith@example.com\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"fromIdentityId\": \"<string>\",\n \"cc\": [],\n \"bcc\": [],\n \"bodyHtml\": \"<string>\",\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"contentId\": \"<string>\",\n \"contentType\": \"<string>\",\n \"content\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"headers\": {},\n \"metadata\": {},\n \"inReplyTo\": \"<string>\",\n \"references\": []\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://api.useanima.sh/v1/email/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"<string>\",\n \"to\": [\n \"jsmith@example.com\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"fromIdentityId\": \"<string>\",\n \"cc\": [],\n \"bcc\": [],\n \"bodyHtml\": \"<string>\",\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"contentId\": \"<string>\",\n \"contentType\": \"<string>\",\n \"content\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"headers\": {},\n \"metadata\": {},\n \"inReplyTo\": \"<string>\",\n \"references\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useanima.sh/v1/email/send")
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 \"agentId\": \"<string>\",\n \"to\": [\n \"jsmith@example.com\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"fromIdentityId\": \"<string>\",\n \"cc\": [],\n \"bcc\": [],\n \"bodyHtml\": \"<string>\",\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"contentId\": \"<string>\",\n \"contentType\": \"<string>\",\n \"content\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"headers\": {},\n \"metadata\": {},\n \"inReplyTo\": \"<string>\",\n \"references\": []\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agentId": "<string>",
"inboxId": "<string>",
"channel": "EMAIL",
"direction": "INBOUND",
"status": "QUEUED",
"fromAddress": "<string>",
"toAddress": "<string>",
"subject": "<string>",
"body": "<string>",
"bodyHtml": "<string>",
"extractedText": "<string>",
"extractedHtml": "<string>",
"headers": {},
"metadata": {},
"threadId": "<string>",
"labels": [
"<string>"
],
"inReplyTo": "<string>",
"externalId": "<string>",
"deletedAt": "2023-11-07T05:31:56Z",
"sentAt": "2023-11-07T05:31:56Z",
"receivedAt": "2023-11-07T05:31:56Z",
"readAt": "2023-11-07T05:31:56Z",
"attachments": [
{
"id": "<string>",
"filename": "<string>",
"mimeType": "<string>",
"sizeBytes": 1,
"storageKey": "<string>",
"url": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"scanStatus": "PENDING",
"detectedMimeType": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Authorizations
Body
Request body for sending an email with threading support
Optional EmailIdentity ID to send from. An agent has exactly one email identity, so the only valid value is that one — supply it to assert which address you expect to send as, or omit it and the agent's identity is used. Discover the ID via GET /agents/{agentId}/email-identities.
^[cC][^\s-]{8,}$Optional file attachments. Max 25MB total across all attachments (after base64 decode for inline, after fetch for URL-source); max 20 attachments per email. Each entry provides either inline base64 content or a public url for server-fetch.
20Show child attributes
Show child attributes
Explicit References chain, oldest first: one RFC 5322 Message-ID per entry (an email's externalId). Anything else, such as an Anima message id, is ignored. On a reply, this chain is used only if it includes the replied-to message's Message-ID; otherwise, or if omitted, the chain is derived from the replied-to message automatically (its References plus its Message-ID).
Response
OK
Full message resource representation
ID of the inbox this message belongs to — the inbox it was delivered to (inbound) or sent from (outbound). Null when no inbox backs the address: SMS/MMS/voice messages, and email sent from an email identity that has no inbox (such as a custom-domain identity added to an agent). Pass it to GET /messages?inboxId= to list one inbox's mail.
^[cC][^\s-]{8,}$Plain-text body with the quoted reply chain and signature stripped — just what this sender actually wrote. Read this instead of body to avoid re-reading (and paying for) the whole thread on every message. Null when nothing was extracted: non-email channels, messages your agent sent, and mail received before this field existed — so extractedText ?? body is always correct. Best-effort and heuristic; body remains the verbatim source of truth. Known weak cases: forwards and bottom-posted replies have no separable 'new' part, so this returns the full body rather than nothing.
Workflow labels on this message. Always contains exactly one of the system labels unread or read; may also contain archived, spam (the inbound spam verdict — see includeSpam on list/search), and any labels you add yourself. Stored lowercase, deduped, and sorted. Change them with PATCH /messages/{id}/labels.
