curl --request POST \
--url https://api.useanima.sh/v1/messages/{id}/restore \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.useanima.sh/v1/messages/{id}/restore"
payload = {}
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({})
};
fetch('https://api.useanima.sh/v1/messages/{id}/restore', 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/{id}/restore",
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([
]),
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/messages/{id}/restore"
payload := strings.NewReader("{}")
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/messages/{id}/restore")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useanima.sh/v1/messages/{id}/restore")
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 = "{}"
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 messages restore
curl --request POST \
--url https://api.useanima.sh/v1/messages/{id}/restore \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.useanima.sh/v1/messages/{id}/restore"
payload = {}
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({})
};
fetch('https://api.useanima.sh/v1/messages/{id}/restore', 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/{id}/restore",
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([
]),
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/messages/{id}/restore"
payload := strings.NewReader("{}")
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/messages/{id}/restore")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useanima.sh/v1/messages/{id}/restore")
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 = "{}"
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
Message restore parameters
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.
