Send Reaction
curl --request POST \
--url https://app.tuco.ai/api/messages/react \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messageId": "<string>",
"reaction": "<string>"
}
'import requests
url = "https://app.tuco.ai/api/messages/react"
payload = {
"messageId": "<string>",
"reaction": "<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({messageId: '<string>', reaction: '<string>'})
};
fetch('https://app.tuco.ai/api/messages/react', 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.tuco.ai/api/messages/react",
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([
'messageId' => '<string>',
'reaction' => '<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.tuco.ai/api/messages/react"
payload := strings.NewReader("{\n \"messageId\": \"<string>\",\n \"reaction\": \"<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.tuco.ai/api/messages/react")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messageId\": \"<string>\",\n \"reaction\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tuco.ai/api/messages/react")
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 \"messageId\": \"<string>\",\n \"reaction\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyMessages
Send Reaction
Send an iMessage tapback reaction to an existing message in your workspace. REST endpoint in the Tuco AI iMessage API — bearer-token auth, JSON.
POST
/
api
/
messages
/
react
Send Reaction
curl --request POST \
--url https://app.tuco.ai/api/messages/react \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messageId": "<string>",
"reaction": "<string>"
}
'import requests
url = "https://app.tuco.ai/api/messages/react"
payload = {
"messageId": "<string>",
"reaction": "<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({messageId: '<string>', reaction: '<string>'})
};
fetch('https://app.tuco.ai/api/messages/react', 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.tuco.ai/api/messages/react",
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([
'messageId' => '<string>',
'reaction' => '<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.tuco.ai/api/messages/react"
payload := strings.NewReader("{\n \"messageId\": \"<string>\",\n \"reaction\": \"<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.tuco.ai/api/messages/react")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messageId\": \"<string>\",\n \"reaction\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tuco.ai/api/messages/react")
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 \"messageId\": \"<string>\",\n \"reaction\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyUse this endpoint to react to an existing message with a native iMessage tapback.
The target message must already exist in Tuco and belong to your workspace.
What This Endpoint Does
This endpoint adds a native iMessage reaction to an existing message in a conversation. It is useful when you want your integration to behave more like a human operator in Unibox, for example:- acknowledging a message with a quick tapback
- reacting before sending a longer reply
- mirroring a lightweight action a user took in your own system
Authentication
Pass your workspace API key as a Bearer token, or use a Clerk session token.Authorization: Bearer tuco_sk_xxxxxxxxxxxxx
Request body
string
The Tuco message ID to react to. Required.
string
Required reaction type.Supported values:
"love""like""dislike""laugh""emphasize""question"
Example
curl -X POST "https://app.tuco.ai/api/messages/react" \
-H "Authorization: Bearer tuco_sk_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"messageId": "6a07878bafb1789f8fcb68e6",
"reaction": "love"
}'
Response
Success (200 OK)
{
"ok": true,
"reaction": "love"
}
Error responses
| Status | When | Body |
|---|---|---|
400 | messageId or reaction is missing | { "error": "messageId and reaction required" } |
400 | reaction is not supported | { "error": "Invalid reaction type" } |
400 | messageId is not a valid ObjectId | { "error": "Invalid messageId" } |
400 | The target message cannot be resolved to a valid iMessage chat target | { "error": "Cannot determine contact phone for reaction" } |
400 | The target message has no upstream message ID | { "error": "Message has no upstream ID — cannot react" } |
400 | The target line is missing required relay credentials | { "error": "Line not found or missing credentials" } |
401 | Missing or invalid API key / session | { "error": "Unauthorized" } |
404 | Message not found in your workspace | { "error": "Message not found" } |
502 | The upstream provider returned an error | { "error": "Upstream provider error: ..." } |
Notes
- Reactions are workspace-scoped: you can only react to messages inside your own workspace.
- Sending the same reaction again toggles it off.
- Tuco keeps only one outbound self-reaction per message at a time, matching native iMessage behavior.
- If you also want to receive inbound reactions from leads, see Message Webhooks.