
## Delete Open Channel configuration

`DELETE /v1/openline-configs/:id`

Deletes an Open Channel configuration by ID. A deleted record cannot be restored via the API — create a new one if needed.

## Parameters

| Parameter | Type | Req. | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Configuration ID |

## Examples

### curl — personal key

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/openline-configs/29" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

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

const { success, data } = await res.json()
if (success && data.deleted) {
  console.log('Configuration deleted, ID:', data.id)
}
```

### JavaScript — OAuth application

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

const { success, data } = await res.json()
if (success && data.deleted) {
  console.log('Configuration deleted, ID:', data.id)
}
```

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.id` | number | ID of the deleted configuration |
| `data.deleted` | boolean | `true` on successful deletion |

## Response example

```json
{
  "success": true,
  "data": {
    "id": 29,
    "deleted": true
  }
}
```

## Error response example

404 — configuration not found:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "openlineConfig 99999 not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_ID` | `id` is not a positive integer |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |
| 403 | `SCOPE_DENIED` | The API key lacks the `imopenlines` scope |
| 404 | `ENTITY_NOT_FOUND` | A configuration with the given ID was not found |

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

## See also

- [List configurations](/docs/openlines/config/list)
- [Get configuration](/docs/openlines/config/get)
- [Batch](/docs/batch) — bulk deletion
