curl --request GET \
--url https://api.useanima.sh/v1/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.useanima.sh/v1/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.useanima.sh/v1/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://api.useanima.sh/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.useanima.sh/v1/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.useanima.sh/v1/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useanima.sh/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"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"
}
],
"pagination": {
"nextCursor": "<string>",
"hasMore": true
}
}Get messages 1
curl --request GET \
--url https://api.useanima.sh/v1/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.useanima.sh/v1/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.useanima.sh/v1/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://api.useanima.sh/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.useanima.sh/v1/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.useanima.sh/v1/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useanima.sh/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"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"
}
],
"pagination": {
"nextCursor": "<string>",
"hasMore": true
}
}Authorizations
Query Parameters
Filter messages by several channels at once, e.g. SMS+MMS to see a full text conversation. Takes precedence over channel. A single value (?channels=SMS) is accepted as well as the repeated (?channels=SMS&channels=MMS) and bracketed (?channels[]=SMS) forms.
50Communication channel used for the message
EMAIL, SMS, MMS, VOICE, WHATSAPP, RCS Include messages carrying the archived label. They are excluded by default, so archiving actually removes mail from a listing rather than only tagging it. Naming archived in labels also counts as asking for it (and returns ONLY archived mail); use this flag instead to see archived mail mixed in with the rest.
How to treat messages moved to Trash. exclude (default) hides them, so deleted mail disappears from every ordinary listing. only returns nothing but Trash. include ignores the distinction. Deletion is reversible — see DELETE /messages/{id} and POST /messages/{id}/restore.
exclude, include, only 