List / check Do-Not-Contact
curl --request GET \
--url https://app.tuco.ai/api/dnc \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.tuco.ai/api/dnc"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.tuco.ai/api/dnc', 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/dnc",
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://app.tuco.ai/api/dnc"
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://app.tuco.ai/api/dnc")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tuco.ai/api/dnc")
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{
"entries": [
{
"id": "6ad5ffeb89a6125f30a7dd2c",
"phone": "+15550100777",
"email": null,
"reason": "opt-out",
"addedBy": "system",
"addedAt": "2026-10-19T11:32:59.433Z",
"source": "keyword-STOP"
}
],
"total": 1,
"page": 1,
"limit": 50,
"totalPages": 1,
"hasMore": false,
"listed": true
}{
"error": "since must be an ISO 8601 date, e.g. 2026-10-19T00:00:00Z"
}{
"error": "Unauthorized"
}{
"error": "Rate limit exceeded"
}Do Not Contact
List / Check Do-Not-Contact
List your workspace’s Do-Not-Contact entries, poll for new opt-outs with since=, or check one phone number or email. REST endpoint in the Tuco AI iMessage API — bearer-token auth.
GET
/
api
/
dnc
List / check Do-Not-Contact
curl --request GET \
--url https://app.tuco.ai/api/dnc \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.tuco.ai/api/dnc"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.tuco.ai/api/dnc', 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/dnc",
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://app.tuco.ai/api/dnc"
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://app.tuco.ai/api/dnc")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tuco.ai/api/dnc")
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{
"entries": [
{
"id": "6ad5ffeb89a6125f30a7dd2c",
"phone": "+15550100777",
"email": null,
"reason": "opt-out",
"addedBy": "system",
"addedAt": "2026-10-19T11:32:59.433Z",
"source": "keyword-STOP"
}
],
"total": 1,
"page": 1,
"limit": 50,
"totalPages": 1,
"hasMore": false,
"listed": true
}{
"error": "since must be an ISO 8601 date, e.g. 2026-10-19T00:00:00Z"
}{
"error": "Unauthorized"
}{
"error": "Rate limit exceeded"
}Use this to stop contacts on your other channels (WhatsApp, email, dialer) when they opt out on iMessage. Poll with
since=, or subscribe to the dnc.added webhook to hear about each opt-out as it happens.Authentication
Authorization: Bearer tuco_xxxxxxxxxxxxx
429 with Retry-After).
Without since, entries are returned newest first.
Examples
curl "https://app.tuco.ai/api/dnc?since=2026-10-19T11:32:45Z&limit=200" \
-H "Authorization: Bearer tuco_xxxxxxxxxxxxx"
curl "https://app.tuco.ai/api/dnc?phone=%2B15550100777" \
-H "Authorization: Bearer tuco_xxxxxxxxxxxxx"
curl "https://app.tuco.ai/api/dnc?page=1&limit=200" \
-H "Authorization: Bearer tuco_xxxxxxxxxxxxx"
Polling loop
- Store the
addedAtof the last entry you processed (start with any past date). - Call
GET /api/dnc?since=<that addedAt>&limit=200. - Skip ids you have already processed; process the rest.
- If
hasMoreistrue, readpage=2,page=3, … with the samesince. - Save the last entry’s
addedAtand repeat (every few minutes is plenty).
Success response (200)
Check one number
{
"entries": [
{
"id": "6ad5ffeb89a6125f30a7dd2c",
"phone": "+15550100777",
"email": null,
"reason": "opt-out",
"addedBy": "system",
"addedAt": "2026-10-19T11:32:59.433Z",
"source": "keyword-STOP"
}
],
"total": 1,
"page": 1,
"limit": 50,
"totalPages": 1,
"hasMore": false,
"listed": true
}
Errors
| Status | When |
|---|---|
400 | since is not a valid date |
401 | Missing or invalid API key |
429 | Rate limit exceeded |
Authorizations
Workspace API key: Authorization: Bearer tuco_xxxxxxxxxxxxx
Query Parameters
Only entries added at or after this time, oldest first. Inclusive — dedupe by id.
Check one number (any common format). Adds listed to the response.
Check one email (case-insensitive). Adds listed to the response.
Substring match on phone or email
Required range:
x >= 1Required range:
1 <= x <= 200