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

# Update Phone Line

> Change a phone line's name, agent, or SIP details

Change a phone line. Send only the fields you want to change.

* **Both kinds:** `name`, `agent_id` (set to `null` to detach the agent).
* **60db number (`sixtydb`):** `inbound`. The SIP login is managed by 60db, so SIP fields are rejected with `400 VALIDATION_ERROR`.
* **Your own trunk (`byo`):** `domain`, `username`, `password`, `caller_id`, `inbound_number`.

If the call runtime cannot take the change, it is reverted and you get an error.

## Request

### Headers

**Authorization** `string` *required*

Bearer token with your API key (scope `agents`)

**Content-Type** `string` *required*

application/json

### Path

**lineId** `string` *required*

The phone line `id` (UUID)

### Body

**name** `string`

1–64 characters

**agent\_id** `string | null`

The agent that calls from this line (UUID), or `null` to detach it

**inbound** `boolean`

60db numbers only. Must be `false` for now

**domain** `string`

BYO only. SIP host name, optionally with a port

**username** `string`

BYO only. 1–128 characters

**password** `string`

BYO only. 1–256 characters. Never returned

**caller\_id** `string`

BYO only. E.164 format

**inbound\_number** `string | null`

BYO only. Must be `null` for now

## Response

**200 OK**. The updated phone line.

## Errors

| Status | Code | Meaning |
| - | - | - |
| 400 | `VALIDATION_ERROR` | A field is invalid, or a SIP field was sent for a 60db number. `field` names it |
| 404 | `PHONE_LINE_NOT_FOUND` | No phone line with this ID in your workspace |
| 404 | `AGENT_NOT_FOUND` | `agent_id` is not an agent in your workspace |
| 409 | `LINE_NAME_TAKEN` | Another phone line uses this name |
| 422 | `INBOUND_NOT_AVAILABLE` | Inbound calls are not available yet |
| 502 | `AGENTS_UPSTREAM_UNAVAILABLE` | The call runtime could not apply the change. It was reverted. Retry shortly |

## Example

```bash cURL theme={null}
curl -X PATCH https://api.60db.ai/agents/phone-lines/LINE_ID \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"agent_id": "AGENT_ID", "name": "Front desk line"}'
```

```javascript JavaScript theme={null}
await client.agents.phoneLines.update(lineId, { agentId, name: 'Front desk line' });
```

```python Python theme={null}
client.agents.phone_lines.update(line_id, agent_id=agent_id, name="Front desk line")
```


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