For AI agents: markdown of this page — /docs-content-en/entities/companies/delete.md documentation index — /llms.txt

Delete company

DELETE /v1/companies/:id

Deletes a company by ID. A deleted company cannot be restored via the API — create a new one if needed.

Parameters

Parameter Type Req. Description
id (path) number yes Company ID

Examples

curl — personal key

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/companies/2923" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/companies/2923" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/companies/2923', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

if (res.status === 204) {
  console.log('Company deleted')
}

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/companies/2923', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

if (res.status === 204) {
  console.log('Deleted')
}

Response

On successful deletion, HTTP status 204 No Content is returned with an empty body — success is determined by the status.

Response example

HTTP/1.1 204 No Content

Error response example

404 — company not found:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Item not found"
  }
}

Errors

HTTP Code Description
404 ENTITY_NOT_FOUND Company not found
403 ACCESS_DENIED No access
403 SCOPE_DENIED The API key does not have the crm scope
401 TOKEN_MISSING The API key has no configured tokens

Full list of common API errors — Errors.

See also