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" }'
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();
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"]
Agents
Check Phone Line
Dry-run how an incoming call would be answered, without placing or receiving one
POST
/
agents
/
phone-lines
/
{lineId}
/
check
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" }'
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();
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"]
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.
Request
Headers
string
required
Bearer token with your API key (scope
agents)string
required
application/json
Path
string
required
The phone line
id (UUID)Body
string
required
The number the carrier would dial, as it appears in the request URI
string
The address the call would come from. Checked against the line’s
allowed_addressesstring
The caller’s number, E.164. Checked against the line’s
allowed_numbersResponse
200 OK{
"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
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" }'
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();
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"]