## Delete workspace

`DELETE /v1/automated-solutions/:id`

Deletes a CRM digital workspace by ID — only if no smart process type is bound to it.

A deleted workspace cannot be restored via the API — create a new one if needed.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Workspace identifier. List: [`GET /v1/automated-solutions`](/docs/entities/automated-solutions/list) |

## Examples


### curl — personal key

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/automated-solutions/9" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

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

if (res.status === 204) {
  console.log('Workspace deleted')
}
```

### JavaScript — OAuth application

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

if (res.status === 204) {
  console.log('Workspace deleted')
}
```

## Response

On successful deletion, the API returns HTTP status `204 No Content` with an empty body. Success is indicated by the response code, not the body.

## Response example

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

## Error response example

422 — smart process types are bound to the workspace:

```json
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Cannot delete a workspace that contains smart processes. Move them to another workspace",
    "hint": "The digital workspace still has smart process types attached, and Bitrix24 refuses to delete a non-empty workspace. Move them first: PATCH /v1/automated-solutions/:id of ANOTHER workspace with the full typeIds set (the set is overwritten in full), or PATCH this workspace with typeIds: [] if the types should stay unattached. Then repeat the DELETE.",
    "b24Code": "HAS_BOUND_TYPES"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 422 | `BITRIX_ERROR` | At least one smart process type is bound to the workspace; `error.b24Code` is `HAS_BOUND_TYPES`. The hint in `error.hint` names the steps: move the types to another workspace with a [`PATCH /v1/automated-solutions/:id`](/docs/entities/automated-solutions/update) request to that workspace carrying the full `typeIds` set, or unbind them with a `PATCH` request to this workspace with `typeIds: []`, then retry the deletion |
| 403 | `BITRIX_ACCESS_DENIED` | The workspace was installed by a Marketplace application and is locked against deletion, or the key owner lacks permissions. The response has no `b24Code` field; the hint in `error.hint` names both causes |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 403 | `SCOPE_DENIED` | The API key does not have the `crm` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |

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

## Known specifics

**Deleting a missing workspace also returns `204`.** A repeated `DELETE` of an already deleted workspace and a `DELETE` with a non-existent `id` respond the same way as a successful deletion. A `204` confirms that no workspace with this `id` exists any more, not that this particular call deleted it.

## See also

- [Digital workspaces](/docs/entities/automated-solutions)
- [List workspaces](/docs/entities/automated-solutions/list)
- [Update workspace](/docs/entities/automated-solutions/update)
- [Create workspace](/docs/entities/automated-solutions/create)
- [Batch](/docs/batch)
