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

# Check Phone Line

> Dry-run how an incoming call would be answered, without placing or receiving one

Runs the same decision a real inbound call would get: number match, source address, caller number. It places no call and costs nothing.

It cannot prove your carrier can reach 60db. Only a real call does. See [Bring your own SIP](https://docs.60db.ai/features/agents-bring-your-own-sip.md#the-dry-run-check).

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

**called\_number** `string` *required*

The number the carrier would dial, as it appears in the request URI

**source\_ip** `string`

The address the call would come from. Checked against the line's `allowed_addresses`

**caller\_number** `string`

The caller's number, E.164. Checked against the line's `allowed_numbers`

## Response

**200 OK**

```json theme={null}
{
  "success": true,
  "data": {
    "answer": 200,
    "result": "answered",
    "message": "The line's agent would answer this call.",
    "inbound_enabled": true
  }
}
```

| `answer` | `result` | Meaning |
| - | - | - |
| 200 | `answered` | The line's agent would answer |
| 404 | `number_not_on_this_trunk` | No number on this line matches. Check the form: a leading `+`, the country code, `normalize_numbers`. A number that belongs to another line also gets this, and nothing else is said about it |
| 403 | `source_not_allowed` | `source_ip` is not in the line's `allowed_addresses` |
| 403 | `caller_not_allowed` | `caller_number` is not in the line's `allowed_numbers` |

`answer` is the SIP status the carrier would see, not the HTTP status of this request.

`inbound_enabled` is `false` when inbound calls are not available on the environment at all.

## Errors

| Status | Code | Meaning |
| - | - | - |
| 400 | `VALIDATION_ERROR` | A field is invalid. `field` names it |
| 404 | `PHONE_LINE_NOT_FOUND` | No phone line with this ID in your workspace |

## Example

```bash cURL theme={null}
curl -X POST https://api.60db.ai/agents/phone-lines/LINE_ID/check \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{ "called_number": "+15550301", "source_ip": "203.0.113.7", "caller_number": "+919876543210" }'
```

```javascript JavaScript theme={null}
const res = await fetch(`https://api.60db.ai/agents/phone-lines/${lineId}/check`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.SIXTYDB_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    called_number: '+15550301',
    source_ip: '203.0.113.7',
    caller_number: '+919876543210',
  }),
});
if (!res.ok) throw new Error(`check failed: ${res.status}`);
const { data } = await res.json();
```

```python Python theme={null}
import os, requests

r = requests.post(
    f"https://api.60db.ai/agents/phone-lines/{line_id}/check",
    headers={"Authorization": f"Bearer {os.environ['SIXTYDB_API_KEY']}"},
    json={"called_number": "+15550301", "source_ip": "203.0.113.7", "caller_number": "+919876543210"},
    timeout=30,
)
r.raise_for_status()
data = r.json()["data"]
```


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