For AI agents: markdown of this page — /docs-content-en/telephony/lines/delete.md documentation index — /llms.txt
Delete a line
DELETE /v1/telephony-lines/:number
Deletes an external application line by its number identifier. A deleted line cannot be restored via the API — create a new one with the same number if needed.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameternumber (path) |
Typestring | Requiredyes | DescriptionLine identifier set at creation. If it contains special characters — URL-encode it |
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/telephony-lines/sip-line-1" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X DELETE "https://vibecode.bitrix24.com/v1/telephony-lines/sip-line-1" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const number = 'sip-line-1'
const res = await fetch(
`https://vibecode.bitrix24.com/v1/telephony-lines/${encodeURIComponent(number)}`,
{
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
}
)
if (res.status === 204) {
console.log('Line deleted')
}
JavaScript — OAuth application
const number = 'sip-line-1'
const res = await fetch(
`https://vibecode.bitrix24.com/v1/telephony-lines/${encodeURIComponent(number)}`,
{
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
}
)
if (res.status === 204) {
console.log('Line deleted')
}
Response
On a successful deletion the response is HTTP status 204 No Content with an empty body — success is checked by the response code.
Response example
HTTP/1.1 204 No Content
Error response example
422 — Bitrix24 error:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "External line not found"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 returned an error — text in error.message. Occurs, among other cases, when attempting to delete a nonexistent line |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header was not provided |
| HTTP401 | CodeINVALID_API_KEY |
DescriptionThe key is not recognized — no such key exists on the platform |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe key has no configured tokens |
| HTTP401 | CodeKEY_INACTIVE |
DescriptionThe API key is inactive or revoked |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key lacks the telephony scope |
| HTTP429 | CodeRATE_LIMITED |
DescriptionRequest rate limit exceeded |
| HTTP502 | CodeBITRIX_UNAVAILABLE |
DescriptionBitrix24 is unavailable |
Full list of common API errors — Errors.