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

# Delete multiple files in a single request

> Permanently delete multiple files in a single request.

**Authorization (applied to every file in the request):**
- Visibility: file must be accessible to the user → 404 if any are not found
- Delete permission: user must have the right to delete each file → 403 if any are denied
- Workspace type: workspace must not be sync-managed → 400 if any are synced

**Public datasets:** instance admins (`MANAGE_PUBLIC_DATASET`) can bulk-delete public-dataset files. A workspace-scoped API key with read-only access to a public dataset can see the file (so it counts toward visibility) but gets 403 on the delete-permission check — public datasets are read-only for opted-in companies.

Returns 204 (No Content) on success.



## OpenAPI

````yaml /api-reference/api-console.yaml post /api/v3/files/bulk-delete
openapi: 3.1.0
info:
  title: LightOn API
  version: 3.15.0 (v1)
  description: >-
    LightOn gives you an API to search, parse, and ingest documents at scale.
    Build knowledge-retrieval pipelines without managing vector databases or OCR
    models.
servers:
  - url: https://api.lighton.ai
security: []
tags:
  - name: Ask
    description: >-
      Retrieval-augmented generation: search your indexed corpus and generate an
      LLM answer grounded in the retrieved passages. Supports streaming (SSE)
      and synchronous modes.
  - name: Search
    description: >-
      Hybrid vector + text retrieval over your indexed corpus. Returns ranked
      passages with provenance (file, page range, workspace). Optional reranking
      and vision mode.
  - name: Files
    description: Upload, list, fetch, and delete documents indexed in your workspaces.
  - name: Facets
    description: >-
      Organise documents with hierarchical content types and custom attributes
      per file. Start from starter templates or build your own classification
      schema from scratch.
  - name: Tags
    description: >-
      Manage flat, company-wide labels used to scope search and group content
      across workspaces.
  - name: Workspaces
    description: >-
      Create and manage workspaces — the access-controlled containers your
      documents live in.
  - name: Parse
    description: >-
      Convert documents into structured Markdown — PDFs, images, Office files,
      and HTML. Synchronous endpoint capped at 20 MB / 15 pages.
  - name: Extract
    description: >-
      Pull typed fields out of documents using a JSON Schema you provide. Sync
      mode for small documents (≤20 MB / 15 pages); async mode for larger jobs
      (≤100 MB / 1000 pages) with polling on a job ID.
  - name: API Keys
    description: >-
      Provision and revoke API keys used to authenticate against the Console
      API.
  - name: Budget
    description: >-
      Manage your organization's monthly spend budget and alert thresholds. Set
      a hard cap that blocks API requests when reached, and configure email
      notifications at custom spend percentages.
paths:
  /api/v3/files/bulk-delete:
    post:
      tags:
        - Files
      summary: Delete multiple files in a single request
      description: >-
        Permanently delete multiple files in a single request.


        **Authorization (applied to every file in the request):**

        - Visibility: file must be accessible to the user → 404 if any are not
        found

        - Delete permission: user must have the right to delete each file → 403
        if any are denied

        - Workspace type: workspace must not be sync-managed → 400 if any are
        synced


        **Public datasets:** instance admins (`MANAGE_PUBLIC_DATASET`) can
        bulk-delete public-dataset files. A workspace-scoped API key with
        read-only access to a public dataset can see the file (so it counts
        toward visibility) but gets 403 on the delete-permission check — public
        datasets are read-only for opted-in companies.


        Returns 204 (No Content) on success.
      operationId: api_v3_files_bulk_delete_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileBulkDeleteRequestSerializerV3'
            examples:
              BulkDeleteRequest:
                value:
                  ids:
                    - 123
                    - 124
                    - 125
                summary: Bulk delete request
        required: true
      responses:
        '204':
          description: Files deleted successfully (no content returned)
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                SyncedWorkspace:
                  value:
                    id: null
                    code: 400
                    error: bad_request
                    detail: >-
                      Cannot manually delete documents from a workspace
                      configured for synced documents. Documents in this
                      workspace can only be managed through external
                      datasources.
                    doc_url: https://developers.lighton.ai/errors#bad_request
                  summary: Synced workspace
          description: >-
            Synced workspace constraint — documents can only be managed through
            external datasources.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: >-
                      Authentication credentials were not provided or are
                      invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: You do not have permission to perform this action.
                    doc_url: >-
                      https://developers.lighton.ai/errors#insufficient_permissions
          description: Insufficient permissions
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                NotFound:
                  value:
                    id: null
                    code: 404
                    error: not_found
                    detail: The requested resource was not found.
                    doc_url: https://developers.lighton.ai/errors#not_found
                  summary: Not Found
          description: The requested resource was not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ValidationErrorResponse'
              examples:
                ValidationError:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      <field_name>:
                        - error: required
                          detail: This field is required.
                  summary: Validation Error
          description: Request body is valid JSON but one or more fields failed validation
        '503':
          description: >-
            API is under maintenance. Check `GET /api/v3/system/status` for
            active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
      security:
        - bearerAuth: []
components:
  schemas:
    FileBulkDeleteRequestSerializerV3:
      type: object
      description: Request serializer for V3 bulk file deletion.
      properties:
        ids:
          type: array
          items:
            type: integer
            minimum: 1
      required:
        - ids
    APIV3ErrorResponse:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          description: >-
            Job/resource id when one already exists (useful for async error
            diagnosis); null otherwise.
        code:
          type: integer
          description: HTTP status code
        error:
          type: string
          description: Error code used by the UI as a translation key
        detail:
          type: string
          description: Human-readable error message for developers
        doc_url:
          type: string
          description: Link to the error-code documentation page
      required:
        - code
        - detail
        - doc_url
        - error
        - id
    APIV3ValidationErrorResponse:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          description: >-
            Job/resource id when one already exists (useful for async error
            diagnosis); null otherwise.
        code:
          type: integer
          description: HTTP status code
        error:
          type: string
          description: Error code used by the UI as a translation key
        detail:
          type: string
          description: Human-readable error message for developers
        doc_url:
          type: string
          description: Link to the error-code documentation page
        fields:
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/APIV3FieldError'
          description: Field-level validation errors keyed by field name
      required:
        - code
        - detail
        - doc_url
        - error
        - id
    ServiceMaintenance503:
      type: object
      description: >-
        Returned by the maintenance middleware when the requested endpoint is
        blocked.
      required:
        - detail
        - error
        - mode
      properties:
        detail:
          type: string
          example: System is under maintenance.
        error:
          type: string
          example: service_maintenance
        mode:
          type: string
          enum:
            - full_shutdown
            - warning_banner
          description: >-
            `full_shutdown` blocks all traffic; `warning_banner` also blocks and
            shows a dismissible toast.
        reason:
          type: string
          description: Operator-supplied maintenance reason, if any.
        started_at:
          type: string
          format: date-time
        endpoint_category_names:
          type: array
          items:
            type: string
          description: >-
            Non-empty only for category-scoped periods. Empty means all
            endpoints are affected.
    APIV3FieldError:
      type: object
      properties:
        error:
          type: string
          description: Error code / translation key
        detail:
          type: string
          description: Human-readable description of the field error
      required:
        - detail
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your auth token.

````