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 first name, last name, or profile photo after creation. REST endpoint in the Tuco AI iMessage API — bearer-token auth, JSON request/response.
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, and profileImageUrl. 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. |
dailyTotalMessagesLimit) is rejected with 400 and nothing is changed.
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 }'
Success response (200)
Returns the updated line, in the same shape as an item from Get All Lines.{
"line": {
"_id": "699f704bc405fae6ca299a08",
"workspaceId": "org_3ABCDbdGyF6w99hikyVN4cmo6H0",
"phone": "+16465550100",
"firstName": "Sarah",
"lastName": "Lee",
"profileImageUrl": "https://cdn.example.com/sarah.png",
"isActive": true,
"provisioningStatus": "active",
"updatedAt": "2026-10-19T11:05:12.000Z"
}
}
Error responses
| Status | When | Body |
|---|---|---|
400 | Invalid line id | { "error": "Invalid line id" } |
400 | Unsupported field in body | { "error": "Only firstName, lastName, profileImageUrl can be updated. Unsupported: <fields>" } |
400 | Empty body | { "error": "Provide at least one of firstName, lastName, profileImageUrl" } |
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" } |
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.