## Remove resource work hours

`DELETE /v1/booking-resources/:id/slots`

Removes all work hours of a booking resource in a single call. The resource remains; to set work hours again, use `PUT /v1/booking-resources/:id/slots`.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|----------|
| `id` (path) | number | yes | Booking resource ID. List: [`GET /v1/booking-resources`](/docs/entities/booking-resources/list) |

## Examples

### curl — personal key

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/booking-resources/65/slots" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -w "%{http_code}\n"
```

### curl — OAuth application

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/booking-resources/65/slots" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -w "%{http_code}\n"
```

### JavaScript — personal key

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

if (res.status === 204) {
  console.log('Work hours removed')
} else {
  const { error } = await res.json()
  console.log(error.code, error.message)
}
```

### JavaScript — OAuth application

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

if (res.status === 204) {
  console.log('Work hours removed')
} else {
  const { error } = await res.json()
  console.log(error.code, error.message)
}
```

## Response

On successful removal, the HTTP status is `204 No Content` with an empty body. The status code signals success, not the body.

## Response example

```
HTTP/1.1 204 No Content
```

## Error response example

404 — no resource with this `id` exists:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Booking resource not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 404 | `ENTITY_NOT_FOUND` | No resource with this `id` exists. Message `Booking resource not found` |
| 400 | `INVALID_PARAMS` | `id` is not a positive integer. Message `id must be a positive safe integer` |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is not passed |
| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode. The request is rejected before it reaches Bitrix24 |
| 403 | `SCOPE_DENIED` | The key does not have the `booking` scope |
| 429 | `RATE_LIMITED` | Request rate exceeded. The effective cap is in the `x-ratelimit-limit` header |
| 502 | `BITRIX_RESPONSE_INVALID` | Bitrix24 did not confirm the removal. Message `Bitrix24 returned an invalid booking response` |

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

## Known specifics

**A repeated removal also returns `204`.** For a resource without work hours, the call returns no error, so it can be repeated without checking the work hours first.

## See also

- [Resource work hours](/docs/entities/booking-resources/slots)
- [Get resource work hours](/docs/entities/booking-resources/slots-list)
- [Set resource work hours](/docs/entities/booking-resources/slots-set)
- [Update a booking resource](/docs/entities/booking-resources/update)
- [List booking resources](/docs/entities/booking-resources/list)
