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

Delete an inventory document

DELETE /v1/catalog-documents/:id

Deletes an inventory document that is not conducted. A deleted document cannot be restored through the API — create a new one if needed.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionDocument ID. List: GET /v1/catalog-documents

Examples

curl — personal key

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/catalog-documents/301" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/catalog-documents/301" \
  -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/catalog-documents/301', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

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

JavaScript — OAuth application

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

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

Response

On successful deletion, HTTP status 204 No Content is returned with an empty body. Success is indicated by the status code, not the body.

Response example

http
HTTP/1.1 204 No Content

Error response example

404 — no document with this id:

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

Errors

HTTP Code Description
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo document with this id, including when the document has already been deleted
HTTP422 CodeBITRIX_ERROR DescriptionThe document is conducted — message A conducted document cannot be deleted. Cancel conducting first
HTTP400 CodeINVALID_PARAMS Descriptionid in the path is not a non-negative integer
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key works in read-only mode
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the catalog scope
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is not passed
HTTP401 CodeINVALID_API_KEY DescriptionThe passed API key is not found

Full list of common API errors — Errors.

See also