## Delete a pack

`DELETE /v1/chats/stickers/packs/:packId`

Deletes a user pack: it disappears for everyone who added it, and its sticker files are deleted. The pack cannot be restored. Only the pack author can delete it.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|----------|
| `packId` (path) | number | yes | Pack ID — `data.packs[].id` from the [list of packs](/docs/chats/stickers/packs) |
| `packType` (query) | string | yes | Pack type. Only `custom` can be deleted |

## Examples

### curl — personal key

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/chats/stickers/packs/3?packType=custom" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/chats/stickers/packs/3?packType=custom" \
  -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/chats/stickers/packs/3?packType=custom', {
  method: 'DELETE',
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { success } = await res.json()
console.log('Deleted:', success)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/stickers/packs/3?packType=custom', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success } = await res.json()
console.log('Deleted:', success)
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.result` | boolean | `true` — the pack was deleted |

## Response example

```json
{
  "success": true,
  "data": { "result": true }
}
```

## Error response example

422 — the pack does not exist, for example because it has already been deleted:

```json
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "PACK_NOT_FOUND",
    "b24Code": "PACK_NOT_FOUND"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | `packId` is not a positive integer, `packType` is missing or invalid, another parameter or body field was passed, a parameter was repeated |
| 401 | `TOKEN_MISSING` | The key has no configured Bitrix24 tokens |
| 403 | `SCOPE_DENIED` | The key lacks the `im` scope |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode |
| 403 | `BITRIX_ACCESS_DENIED` | The pack is built-in or its author is another user |
| 404 | `ENTITY_NOT_FOUND` | Bitrix24 did not find the object; the portal code is in `error.b24Code` if supplied |
| 422 | `BITRIX_ERROR` | `error.b24Code`: `PACK_NOT_FOUND` — the pack does not exist |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a server error |

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

## Known specifics

- A built-in pack and a user pack may have the same `id`, so `packType` is required.

## See also

- [List of packs](/docs/chats/stickers/packs)
- [Get a pack](/docs/chats/stickers/pack-get)
- [Rename a pack](/docs/chats/stickers/pack-update)
- [Delete stickers from a pack](/docs/chats/stickers/pack-stickers)
