## 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 |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Document ID. List: [`GET /v1/catalog-documents`](/docs/entities/catalog-documents/list) |

## Examples

### curl — personal key

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

### curl — OAuth application

```bash
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 |
|------|-----|---------|
| 404 | `ENTITY_NOT_FOUND` | No document with this `id`, including when the document has already been deleted |
| 422 | `BITRIX_ERROR` | The document is conducted — message `A conducted document cannot be deleted.` [Cancel conducting](/docs/entities/catalog-documents/cancel) first |
| 400 | `INVALID_PARAMS` | `id` in the path is not a non-negative integer |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key works in read-only mode |
| 403 | `SCOPE_DENIED` | The API key does not have the `catalog` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is not passed |
| 401 | `INVALID_API_KEY` | The passed API key is not found |

Full list of common API errors — [Errors](/docs/errors).

## See also

- [Inventory documents](/docs/entities/catalog-documents)
- [Cancel conducting of an inventory document](/docs/entities/catalog-documents/cancel)
- [List inventory documents](/docs/entities/catalog-documents/list)
- [Inventory document items](/docs/entities/catalog-document-elements)
- [Batch](/docs/batch)
