> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cube.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete workspace items in bulk

Delete up to 100 workspace items — workbooks, reports, and folders, mixed freely — in a single request.

Request body:

* `items` — the items to delete, each `{ type, id }` with `type` one of `WORKBOOK`, `REPORT`, `FOLDER`. Repeated references to the same item are collapsed, so the response holds exactly one entry per distinct item requested.

**This endpoint is partially successful.** It returns `200` whenever the request itself is well formed, and reports each item's outcome separately:

* `deleted` — the `(type, id)` of each item that was deleted.
* `failed` — the items that were not deleted, each with the `(type, id)` requested and an `error` carrying the `status` and `message` the per-type delete endpoint would have returned for it (`403` when the caller lacks access, `404` when the item does not exist or belongs to another deployment, `400` when a folder still has sub-folders).

An empty `failed` array means the whole batch applied. Items are deleted one at a time in the order given, each in its own transaction, so **deletions are not rolled back** when a later item fails — the response is the record of what was applied. Deleting a folder does not delete the workbooks, dashboards, and reports directly inside it: they are detached and returned to the workspace root, matching `DELETE /folders/:folderId`.

Access is checked per item with the same rules as the per-type delete endpoints: **manage** access for a workbook or folder, and **edit** access plus the report-manage permission for a report.


## OpenAPI

````yaml /api-reference/api.yaml post /api/v1/deployments/{deploymentId}/workspace/bulk-delete
openapi: 3.1.0
info:
  title: Cube Platform API
  version: 1.0.0
  description: >-
    Programmatically manage Cube: deployments and everything scoped to them

    (environments, folders, reports, workbooks, notifications, workspace, and
    agents),

    plus account-level users, groups, policies, embedding, and AI settings.
    Data-model

    authoring, dev mode, branches, and uploads live under /build/api/v1 — same
    host and

    token, routed to the build pods.
servers:
  - url: https://{tenant}.cubecloud.dev
    description: Your tenant host. Replace the whole host if you use a custom domain.
    variables:
      tenant:
        default: your-tenant
        description: Your Cube tenant subdomain
security:
  - bearerAuth: []
tags:
  - name: Deployments
  - name: Deployment Creation
  - name: Environments
  - name: Env Variables
  - name: Regions
  - name: Data Model
  - name: Data Model Uploads
  - name: GitHub
  - name: GitHub Connection
  - name: dbt Sync
  - name: Folders
  - name: Reports
  - name: Workbooks
  - name: Notifications
  - name: Workspace
  - name: Users Admin
  - name: User Attributes
  - name: User Attribute Values
  - name: Tenant Settings
  - name: OAuth Integrations
  - name: User OAuth Tokens
  - name: OIDC Token Configs
  - name: App Theme
  - name: Embed
  - name: Embed Tenants
  - name: Dashboard Embed Access
paths:
  /api/v1/deployments/{deploymentId}/workspace/bulk-delete:
    post:
      tags:
        - Workspace
      summary: Delete workspace items in bulk
      operationId: bulkDeleteWorkspaceObjects
      parameters:
        - in: path
          name: deploymentId
          required: true
          schema:
            type: number
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkDeleteWorkspaceObjectsInput'
        description: BulkDeleteWorkspaceObjectsInput
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkDeleteWorkspaceObjectsPayload'
          description: ''
components:
  schemas:
    BulkDeleteWorkspaceObjectsInput:
      properties:
        items:
          items:
            $ref: '#/components/schemas/WorkspaceItemRefInput'
          maxItems: 100
          minItems: 1
          type: array
      required:
        - items
      type: object
    BulkDeleteWorkspaceObjectsPayload:
      properties:
        deleted:
          items:
            $ref: '#/components/schemas/WorkspaceItemRef'
          type: array
        failed:
          items:
            $ref: '#/components/schemas/WorkspaceBulkFailure'
          type: array
      required:
        - deleted
        - failed
      type: object
    WorkspaceItemRefInput:
      properties:
        id:
          type: integer
        type:
          $ref: '#/components/schemas/WorkspaceItemRefInputType'
      required:
        - type
        - id
      type: object
    WorkspaceItemRef:
      properties:
        id:
          type: integer
        type:
          $ref: '#/components/schemas/WorkspaceItemRefType'
      required:
        - type
        - id
      type: object
    WorkspaceBulkFailure:
      properties:
        error:
          $ref: '#/components/schemas/BulkActionError'
        id:
          type: integer
        type:
          $ref: '#/components/schemas/WorkspaceBulkFailureType'
      required:
        - error
        - type
        - id
      type: object
    WorkspaceItemRefInputType:
      enum:
        - FOLDER
        - WORKBOOK
        - REPORT
      type: string
    WorkspaceItemRefType:
      enum:
        - FOLDER
        - WORKBOOK
        - REPORT
      type: string
    BulkActionError:
      properties:
        message:
          type: string
        status:
          type: integer
      required:
        - status
        - message
      type: object
    WorkspaceBulkFailureType:
      enum:
        - FOLDER
        - WORKBOOK
        - REPORT
      type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Token authentication. Send `Authorization: Bearer <YOUR_TOKEN>`.'

````