## Delete a unit of measure

`DELETE /v1/catalog-measures/:id`

Deletes a commercial catalog unit of measure by its identifier. A deleted record cannot be restored through the API. Create a new one if needed.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Unit of measure identifier, a non-negative integer. List: [`GET /v1/catalog-measures`](/docs/entities/catalog-measures/list) |

## Examples

### curl — personal key

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

### curl — OAuth application

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

if (res.status === 204) {
  console.log('Unit of measure deleted')
}
```

### JavaScript — OAuth application

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

if (res.status === 204) {
  console.log('Unit of measure deleted')
}
```

## Response

A successful deletion returns HTTP status `204 No Content` 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 unit of measure with this `id` exists, for example when the same unit is deleted twice:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "measure does not exist."
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 404 | `ENTITY_NOT_FOUND` | No unit of measure with this `id` exists on the Bitrix24 account, including one already deleted |
| 400 | `INVALID_PARAMS` | `id` is not a non-negative integer, for example `abc`. The request is rejected before execution, and no data on the Bitrix24 account changes |
| 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 missing |

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

## See also

- [Create a unit of measure](/docs/entities/catalog-measures/create)
- [Get a unit of measure](/docs/entities/catalog-measures/get)
- [List units of measure](/docs/entities/catalog-measures/list)
- [Catalog products](/docs/entities/catalog-products)
- [Batch](/docs/batch)
