## Delete a form

`DELETE /v1/crm-forms/:id`

Deletes a CRM form by ID together with its settings. A deleted form cannot be restored through the API — create a new one if needed.

## Parameters

| Parameter | Type | Required | Default | Description |
|----------|-----|:-----:|-----------|----------|
| `id` (path) | integer | yes | — | Form ID. List: [`GET /v1/crm-forms`](/docs/entities/crm-forms/list) |
| `confirm` (query) | boolean | no | `false` | `true` confirms deletion of an active form. Without confirmation, an active form is not deleted — the response is `409 CRM_FORM_DELETE_CONFIRMATION_REQUIRED`. A deactivated form can be deleted without `confirm`. Accepts only `true` or `false` |
| `confirmed` (query) | boolean | no | — | Alias of `confirm`. If both are supplied, their values must match, otherwise `400 INVALID_PARAMS` |
| `updatedTime` (query) | string | no | — | Last modification time of the form from [`GET /v1/crm-forms/:id`](/docs/entities/crm-forms/get). If the form was modified after this time, deletion is rejected with `409 CRM_FORM_VERSION_MISMATCH`. Without the parameter, no version check is performed |

Any other query string parameter and any body field return `400 INVALID_PARAMS`. No request body is sent.

Bitrix24 validates the type and value of `updatedTime`. Use the version from the form read response; a local refusal for an invalid type is not guaranteed.

## Examples

### curl — personal key

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/crm-forms/75?confirm=true" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/crm-forms/75?confirm=true" \
  -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/crm-forms/75?confirm=true', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})
const body = await res.json()
if (body.success && body.data.deleted) {
  console.log('Form deleted')
}
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-forms/75?confirm=true', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})
const body = await res.json()
if (body.success && body.data.deleted) {
  console.log('Form deleted')
}
```

## Response fields

| Field | Type | Description |
|------|-----|----------|
| `success` | boolean | `true` on successful deletion |
| `data.deleted` | boolean | Always `true`: the form is deleted |

## Response example

HTTP status `200 OK`:

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

## Error response example

409 — the form is active and deletion was not confirmed:

```json
{
  "success": false,
  "error": {
    "code": "CRM_FORM_DELETE_CONFIRMATION_REQUIRED",
    "message": "The CRM form is active: confirm deletion and retry the request",
    "b24Code": "CRM_FORM_DELETE_CONFIRMATION_REQUIRED"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|----------|
| 400 | `INVALID_PARAMS` | `id` is not a positive integer, a query string parameter other than `confirm`, `confirmed` and `updatedTime` was passed, `confirm`, `confirmed` or `updatedTime` was repeated, the confirmation values conflict, `confirm` is neither `true` nor `false`, or a body field was passed |
| 400 | `FST_ERR_CTP_EMPTY_JSON_BODY` | The `Content-Type: application/json` header was passed with an empty body. Remove the header |
| 402 | `CRM_FORM_WRITE_RESTRICTED` | The Bitrix24 plan does not allow writing CRM forms. Writes are not performed on free and demo plans |
| 403 | `CRM_FORM_SYSTEM_IMMUTABLE` | The form is a system form — `system: true` in the [form list](/docs/entities/crm-forms/list). A system form cannot be deleted |
| 404 | `ENTITY_NOT_FOUND` | No form with this `id`, including when the same form is deleted again |
| 409 | `CRM_FORM_DELETE_CONFIRMATION_REQUIRED` | The form is active and deletion was not confirmed |
| 409 | `CRM_FORM_VERSION_MISMATCH` | The form was modified after the passed `updatedTime`. The current modification time is in `error.currentUpdatedTime` |
| 403 | `BITRIX_INSUFFICIENT_SCOPE` | The Bitrix24 token lacks the required scope |
| 409 | `CRM_FORM_REST_NOT_ENABLED` | The CRM form methods are disabled on the Bitrix24 account |
| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access to the form for the key's user |
| 422 | `BITRIX_ERROR` | Another Bitrix24 rejection. The rejection text is in `error.message` |
| 500 | `CRM_FORM_SIDE_EFFECT_FAILED` | The deletion was performed but completed with an error. Check the form with [`GET /v1/crm-forms/:id`](/docs/entities/crm-forms/get) before retrying |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a response of an unexpected shape. Check the form before retrying |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only |
| 403 | `SCOPE_DENIED` | The key lacks the `crm` scope |
| 401 | `MISSING_API_KEY` | `X-Api-Key` is missing |
| 401 | `TOKEN_MISSING` | The key has no valid Bitrix24 authorization |

Upstream errors include the original code in `error.b24Code` and field violations in `error.validation` when provided. `CRM_FORM_*` codes retain their HTTP status, code and message. 429 and 503 responses are described in [Limits and optimization](/docs/optimization). For the full list of common API errors, see [Errors](/docs/errors).

## Known specifics

- **Deactivate instead of deleting.** To stop a form from working while keeping its settings, [deactivate](/docs/entities/crm-forms/deactivate) it — a deactivated form can be activated again.

## See also

- [Deactivate a form](/docs/entities/crm-forms/deactivate)
- [Get a form](/docs/entities/crm-forms/get)
- [List forms](/docs/entities/crm-forms/list)
- [Create a form](/docs/entities/crm-forms/create)
- [Limits and optimization](/docs/optimization)
