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

# Remove a file from a document

> Remove one piece of evidence, a file or a link, from a document.



## OpenAPI

````yaml api-reference/openapi.json DELETE /documents/{documentId}/files/{fileId}
openapi: 3.0.0
info:
  title: DSALTA API
  version: 1.0.0
  description: >-
    DSALTA Public API (v1). Authenticate with a Bearer API token issued from
    your organization settings. Each token carries resource-level scopes (e.g.
    documents:read).
  contact: {}
servers:
  - url: https://apip.dsalta.com/v1
    description: Production
security: []
paths:
  /documents/{documentId}/files/{fileId}:
    delete:
      tags:
        - Documents
      summary: Delete Document File
      description: >-
        Remove one piece of evidence — a file or a link — from a document.


        `fileId` is the `id` of an entry in the document's `files`. Scoped to
        the

        caller's organisation: the service refuses a document (or file) that is
        not

        theirs, and a stored file also has its object removed from the bucket.
      operationId: DeleteDocumentFile
      parameters:
        - in: path
          name: documentId
          required: true
          schema:
            type: string
        - in: path
          name: fileId
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicItemResponse_PublicDocument_'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Example 1:
                  value:
                    success: false
                    message: 'API token is missing required scope(s): documents:write'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Example 1:
                  value:
                    success: false
                    message: File not found in document
      security:
        - apiToken:
            - documents:write
components:
  schemas:
    PublicItemResponse_PublicDocument_:
      properties:
        data:
          $ref: '#/components/schemas/PublicDocument'
      required:
        - data
      type: object
      additionalProperties: false
    ErrorResponse:
      properties:
        details:
          $ref: '#/components/schemas/Record_string.unknown_'
        message:
          type: string
        success:
          type: boolean
          enum:
            - false
          nullable: false
      required:
        - message
        - success
      type: object
    PublicDocument:
      properties:
        id:
          type: string
        docId:
          type: string
          description: Human-facing document number, e.g. "DOC-014".
        name:
          type: string
        type:
          type: string
          description: Document type, e.g. "POLICY" | "EVIDENCE".
        status:
          type: string
          description: Review status, e.g. "NOT_STARTED" | "IN_PROGRESS" | "COMPLETED".
        description:
          type: string
        dueDate:
          type: string
          nullable: true
          description: ISO 8601 due date, or null if none.
        frameworks:
          items:
            type: string
          type: array
          description: Names of the frameworks this document maps to.
        owner:
          type: string
          nullable: true
          description: Owner's display name, or null. Never an email or internal id.
        files:
          items:
            $ref: '#/components/schemas/PublicDocumentFile'
          type: array
          description: >-
            Evidence on the document — uploaded files and added links, each with
            an

            id so it can be removed. Empty when there is none.
        controls:
          properties:
            total:
              type: number
              format: double
            passing:
              type: number
              format: double
          required:
            - total
            - passing
          type: object
          nullable: true
          description: >-
            The controls this document is linked to as evidence: how many are
            passing

            out of the total. Null when the document is not linked to any
            control.
        createdAt:
          type: string
          description: ISO 8601 creation timestamp.
        updatedAt:
          type: string
          description: ISO 8601 last-update timestamp.
      required:
        - id
        - docId
        - name
        - type
        - status
        - description
        - dueDate
        - frameworks
        - owner
        - files
        - controls
        - createdAt
        - updatedAt
      type: object
      additionalProperties: false
    Record_string.unknown_:
      properties: {}
      type: object
      description: Construct a type with a set of properties K of type T
    PublicDocumentFile:
      description: 'One piece of evidence on a document: an uploaded file or an added link.'
      properties:
        id:
          type: string
        url:
          type: string
          description: Short-lived download URL for a file, or the link URL for a link.
        type:
          type: string
          enum:
            - file
            - link
          description: '"file" (uploaded to DSALTA) or "link" (an external URL).'
      required:
        - id
        - url
        - type
      type: object
      additionalProperties: false
  securitySchemes:
    apiToken:
      type: http
      scheme: bearer
      bearerFormat: DSALTA_API_TOKEN

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.