curl --request GET \
--url https://api.useanima.sh/v1/email \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.useanima.sh/v1/email"
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/email', 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",
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/email"
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/email")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useanima.sh/v1/email")
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 email 1
curl --request GET \
--url https://api.useanima.sh/v1/email \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.useanima.sh/v1/email"
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/email', 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",
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/email"
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/email")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useanima.sh/v1/email")
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
JWT Bearer token obtained from authentication. Pass as: Authorization: Bearer
Query Parameters
Opaque cursor from a previous response to fetch the next page
^[cC][^\s-]{8,}$Maximum number of items to return per page (1–100, default 20)
1 <= x <= 100Filter emails by agent ID
^[cC][^\s-]{8,}$Only return received (INBOUND) or sent (OUTBOUND) email
INBOUND, OUTBOUND Only return email in this thread (see GET /threads)
^[cC][^\s-]{8,}$Only return email whose sender address matches this value (case-insensitive, exact address match)
Only return email addressed to this recipient (case-insensitive). Matches if the address appears anywhere in the message's recipient list, not only as the first recipient.
Only return email created strictly after this ISO-8601 timestamp
Only return email created strictly before this ISO-8601 timestamp
Filter to messages carrying ALL of these labels (e.g. urgent + unread means urgent AND still unread). Case-insensitive. System labels: unread, read, archived, spam.
501 - 64Include messages classified as spam on arrival. They are excluded by default. Naming spam in labels also counts as asking for it, so a deliberate spam query is never silently emptied by this default.
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.
