> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tuco.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.

<Note>
  Updates 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](/api-reference/endpoint/get-lines).
</Note>

## 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. |

Send at least one field. Any other field (for example `dailyTotalMessagesLimit`) is rejected with `400` and nothing is changed.

<Tip>
  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.
</Tip>

## Example request

```bash theme={null}
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"
  }'
```

Remove the photo:

```bash theme={null}
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](/api-reference/endpoint/get-lines).

```json theme={null}
{
  "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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.