Update a Line
curl --request PATCH \
--url https://app.tuco.ai/api/lines/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.tuco.ai/api/lines/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.tuco.ai/api/lines/{id}', 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/lines/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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/lines/{id}"
req, _ := http.NewRequest("PATCH", 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.patch("https://app.tuco.ai/api/lines/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tuco.ai/api/lines/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyLines & Leads
Update a Line
Change a line’s name, photo or call forwarding number, or turn on a call recording notice. Tuco AI iMessage API, bearer-token auth, JSON.
PATCH
/
api
/
lines
/
{id}
Update a Line
curl --request PATCH \
--url https://app.tuco.ai/api/lines/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.tuco.ai/api/lines/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.tuco.ai/api/lines/{id}', 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/lines/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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/lines/{id}"
req, _ := http.NewRequest("PATCH", 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.patch("https://app.tuco.ai/api/lines/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tuco.ai/api/lines/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyUpdates a line’s display profile (
firstName, lastName, profileImageUrl), its call forwarding number (forwardCallsTo) and its call recording notice (callRecordingDisclosure, callRecordingDisclosureMessage). Send only the fields you want to change. Get the line _id from Get All Lines.Endpoint
- Method:
PATCH - Path:
/api/lines/{id} - Auth:
Authorization: Bearer tuco_xxxxxxxxxxxxx
Body
| Field | Type | Notes |
|---|---|---|
firstName | string | Optional. Trimmed, cannot be blank, max 100 characters. |
lastName | string | Optional. Trimmed, cannot be blank, max 100 characters. |
profileImageUrl | string | null | Optional. A public http(s) URL to the photo, max 2048 characters. Send null to remove the photo. |
forwardCallsTo | string | null | Optional. The number inbound calls to this line are forwarded to, with country code, e.g. +14155550123. Stored in E.164 format. Must be in the same country as the line’s eSIM and can’t be the line’s own number. Send null (or an empty string) to stop forwarding. Phone lines only. See Call forwarding. |
callRecordingDisclosure | boolean | Optional. true plays a short “this call may be recorded” notice when the person you call answers. false turns it off. Off by default. Phone lines only. See Call recording notice. |
callRecordingDisclosureMessage | string | null | Optional. Your own wording for the notice, max 300 characters. Send null (or an empty string) to go back to the default: “This call may be recorded for quality and training purposes.” |
dailyTotalMessagesLimit) is rejected with 400 and nothing is changed.
3 line info changes per line per month. Each change to the name, photo or call forwarding number needs a person on our side to update the line, so a line’s info can change at most 3 times per calendar month (UTC). One request that changes several of them counts once. The 4th returns
400 with "code": "LINE_INFO_UPDATE_LIMIT" and nothing is changed — contact support@tuco.ai. Sending the same values the line already has doesn’t count, and the name, photo and forwarding number you set when ordering the line are free. Every response includes lineInfoUpdates so you can see how many changes are left. Review everything and be sure before you send. Turning the call recording notice on or off, or changing its wording, does not count toward this limit.Tuco stores the photo link you send — it does not copy the image. Host the photo somewhere permanent; if the link stops working, the photo stops showing.
Example request
curl -X PATCH https://app.tuco.ai/api/lines/699f704bc405fae6ca299a08 \
-H "Authorization: Bearer tuco_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"firstName": "Sarah",
"lastName": "Lee",
"profileImageUrl": "https://cdn.example.com/sarah.png"
}'
curl -X PATCH https://app.tuco.ai/api/lines/699f704bc405fae6ca299a08 \
-H "Authorization: Bearer tuco_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{ "profileImageUrl": null }'
Call forwarding
Calls to the line’s own number ring the number you set inforwardCallsTo:
curl -X PATCH https://app.tuco.ai/api/lines/699f704bc405fae6ca299a08 \
-H "Authorization: Bearer tuco_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{ "forwardCallsTo": "+14155550123" }'
- Same country as the eSIM. A US line forwards to a US number, a Canadian line to a Canadian number.
- Not the line’s own number. Calls would loop back to the line.
- Takes effect once our team applies it to the line. The change is saved right away and the team is told at the same time.
- Stop forwarding: send
{ "forwardCallsTo": null }.
Call recording notice
Every outbound call placed through Tuco is recorded. If you need the person you call to be told, turn on the notice for the line that places your calls:curl -X PATCH https://app.tuco.ai/api/lines/699f704bc405fae6ca299a08 \
-H "Authorization: Bearer tuco_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{ "callRecordingDisclosure": true }'
curl -X PATCH https://app.tuco.ai/api/lines/699f704bc405fae6ca299a08 \
-H "Authorization: Bearer tuco_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{ "callRecordingDisclosureMessage": "Hi, this is Acme. This call is recorded for quality." }'
- When: the moment the person you call picks up, before anyone talks. It takes about 3–5 seconds.
- Who hears it: the person you call and your rep, so your rep knows to let it finish.
- On the recording: yes. The notice is at the start of the call recording, so you have proof it played.
- Which calls: every call this line places through Tuco: the dashboard dialer, Place a Call, and calls made from your CRM through Tuco. It also plays when the call goes out from a Registered caller ID number.
- Not covered: calls on the FaceTime Audio add-on, and calls you make from your own phone. Those don’t go through Tuco’s calling, so there is nothing to play the notice into.
- Takes effect: on the next call that’s answered. It’s free.
Whether a notice like this meets the recording-consent rules where you and the people you call are
(for example, US states that require all parties to consent) is your call. Check with your own counsel.
Success response (200)
Returns the updated line, in the same shape as an item from Get All Lines, pluslineInfoUpdates: how many line info changes (name, photo, forwarding number) this line has used and has left this month.
{
"line": {
"_id": "699f704bc405fae6ca299a08",
"workspaceId": "org_3ABCDbdGyF6w99hikyVN4cmo6H0",
"phone": "+16465550100",
"firstName": "Sarah",
"lastName": "Lee",
"profileImageUrl": "https://cdn.example.com/sarah.png",
"forwardCallsTo": "+14155550123",
"callRecordingDisclosure": true,
"isActive": true,
"provisioningStatus": "active",
"updatedAt": "2026-10-19T11:05:12.000Z"
},
"lineInfoUpdates": {
"limitPerMonth": 3,
"usedThisMonth": 1,
"remainingThisMonth": 2
}
}
Error responses
| Status | When | Body |
|---|---|---|
400 | Invalid line id | { "error": "Invalid line id" } |
400 | Unsupported field in body | { "error": "Only firstName, lastName, profileImageUrl, callRecordingDisclosure, callRecordingDisclosureMessage, forwardCallsTo can be updated. Unsupported: <fields>" } |
400 | Empty body | { "error": "Provide at least one of firstName, lastName, profileImageUrl, callRecordingDisclosure, callRecordingDisclosureMessage, forwardCallsTo" } |
400 | Blank or non-string name | { "error": "firstName must be a non-empty string" } |
400 | Bad photo URL | { "error": "profileImageUrl must be an http(s) URL or null" } |
400 | Notice toggle not a boolean | { "error": "callRecordingDisclosure must be true or false" } |
400 | Notice text not a string, or over 300 characters | { "error": "callRecordingDisclosureMessage must be at most 300 characters" } |
400 | Notice on an email line | { "error": "callRecordingDisclosure applies to phone lines only — email lines place no calls" } |
400 | Forwarding number isn’t a phone number | { "error": "forwardCallsTo must be a valid phone number with country code, e.g. +14155550123" } |
400 | Forwarding to the line’s own number | { "error": "forwardCallsTo can't be the line's own number — calls would loop back to it" } |
400 | Forwarding number in another country | { "error": "forwardCallsTo must be a United States number to match the line's eSIM country (got CA)" } |
400 | Forwarding on an email line | { "error": "forwardCallsTo applies to phone lines only — email lines take no calls" } |
400 | Line info already changed 3 times this month | { "error": "This line's info has already been changed 3 times this month… contact support@tuco.ai…", "code": "LINE_INFO_UPDATE_LIMIT", "limitPerMonth": 3, "lineInfoUpdates": { "limitPerMonth": 3, "usedThisMonth": 3, "remainingThisMonth": 0 } } |
401 | Missing or invalid API key | { "error": "Unauthorized" } |
402 | Agency workspace with unpaid billing | { "error": "Editing lines is paused while your agency billing is unpaid. ..." } |
404 | Line not found in your workspace | { "error": "Line not found" } |
500 | Server error | { "error": "Internal server error" } |
Use the Try it panel to run this request interactively.