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

# Create Phone Line

> Add a 60db Dialer number or your own SIP trunk as a phone line

Add a phone line that agents can call from. Use `kind: "sixtydb"` for a number from your 60db Dialer, or `kind: "byo"` for your own SIP trunk.

* **60db number.** The number must be one you own in Dialer. 60db creates the SIP login for it. Call minutes are billed from your Dialer balance. Get numbers in [Dialer](https://docs.60db.ai/features/dialer.md). Find yours with [List available numbers](https://docs.60db.ai/api-reference/agents/list-available-numbers.md).
* **Your own trunk (BYO).** Your carrier bills the calls. The password is accepted here and never returned.

> [!NOTE]
>
> **Inbound calls are coming soon.** Setting `inbound` or `inbound_number` now returns `422 INBOUND_NOT_AVAILABLE`.

## Request

### Headers

**Authorization** `string` *required*

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

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

application/json

### Body for a 60db number (`kind: "sixtydb"`)

**kind** `string` *required*

`sixtydb`

**number** `string` *required*

A Dialer number you own, in E.164 format (for example `+919876543210`)

**name** `string`

1–64 characters. Defaults to the number

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

The agent that calls from this line (UUID)

**inbound** `boolean` (default: false)

Must be `false` for now

### Body for your own SIP trunk (`kind: "byo"`)

**kind** `string` *required*

`byo`

**name** `string` *required*

1–64 characters

**domain** `string` *required*

SIP host name, optionally with a port, for example `sip.carrier.example.com`

**username** `string` *required*

1–128 characters

**password** `string` *required*

1–256 characters. Never returned by the API

**caller\_id** `string` *required*

The number shown to callers, in E.164 format

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

The agent that calls from this line (UUID)

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

Must be `null` for now

## Response

**201 Created**. The phone line.

```json theme={null}
{
  "success": true,
  "data": {
    "id": "2d8e4f10-6a3b-4c9d-8e7f-0b1a2c3d4e5f",
    "kind": "sixtydb",
    "name": "+919876543210",
    "caller_id": "+919876543210",
    "inbound_number": null,
    "agent_id": "9c2e1d7a-0b3f-4e6a-8f1d-5a7b9c0e2d44",
    "agent_name": "Front desk",
    "created_at": "2026-11-03T10:05:00.000Z",
    "updated_at": "2026-11-03T10:05:00.000Z"
  }
}
```

## Errors

| Status | Code | Meaning |
| - | - | - |
| 400 | `VALIDATION_ERROR` | A field is invalid. `field` names it |
| 403 | `DIALER_SUSPENDED` | Dialer is suspended for this workspace. Contact support |
| 404 | `AGENT_NOT_FOUND` | `agent_id` is not an agent in your workspace |
| 409 | `DIALER_NOT_PROVISIONED` | Set up your SIP trunk in Dialer first |
| 409 | `DIALER_NOT_ROUTABLE` | Your Dialer trunk is not ready yet. Try again in a minute |
| 409 | `NUMBER_IN_USE` | The number already has a phone line |
| 409 | `LINE_NAME_TAKEN` | Another phone line uses this name |
| 422 | `NUMBER_NOT_OWNED` | The number is not one of your 60db Dialer numbers |
| 422 | `INBOUND_NOT_AVAILABLE` | Inbound calls are not available yet |
| 502 | `AGENTS_UPSTREAM_UNAVAILABLE` | The call runtime could not register the line. Nothing was saved. Retry shortly |

## Example

```bash cURL theme={null}
curl -X POST https://api.60db.ai/agents/phone-lines \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"kind": "sixtydb", "number": "+919876543210", "agent_id": "AGENT_ID"}'
```

```javascript JavaScript theme={null}
// 60db number
const line = await client.agents.phoneLines.create({
  kind: 'sixtydb',
  number: '+919876543210',
  agentId,
});

// Your own SIP trunk
const byo = await client.agents.phoneLines.create({
  kind: 'byo',
  name: 'Main office trunk',
  domain: 'sip.carrier.example.com',
  username: 'office-trunk',
  password: process.env.SIP_PASSWORD,
  callerId: '+911204567890',
});
```

```python Python theme={null}
# 60db number
line = client.agents.phone_lines.create_from_number("+919876543210", agent_id=agent_id)

# Your own SIP trunk
byo = client.agents.phone_lines.create_byo(
    name="Main office trunk",
    domain="sip.carrier.example.com",
    username="office-trunk",
    password=os.environ["SIP_PASSWORD"],
    caller_id="+911204567890",
)
```


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