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

# Delete a knowledge file

> Deletes a customer-visible file under `user_generated/` or `skills/`.
A successful delete returns `204 No Content`. Missing or hidden paths
return `404 Not Found`.

Use `If-Match` with the current metadata ETag to delete only that
version. An unconditional delete retries one concurrent race, then
returns `409 Conflict` if another request still wins.




## OpenAPI

````yaml /api/openapi.yaml delete /v1/knowledge/files/{file_path}
openapi: 3.1.0
info:
  title: Traversal API
  version: 1.0.0
  description: |
    The Traversal V1 API lets you launch investigations and manage the
    customer-authored knowledge files that agents use.

    All endpoints require a Bearer token. The authenticated user must have at
    least the `member` role within the organization unless an endpoint states
    otherwise.

    To wait for an investigation without polling, connect to
    `GET /v1/sessions/{session_id}/events`. The Server-Sent Events stream sends
    session status snapshots and closes when the session reaches a terminal
    status.
servers:
  - url: https://api.traversal.com
    description: Traversal API
security:
  - bearerAuth: []
tags:
  - name: Sessions
    description: Create, list, retrieve, and continue investigation sessions.
  - name: Knowledge Files
    description: List, upload, download, and delete customer-authored agent knowledge.
paths:
  /v1/knowledge/files/{file_path}:
    delete:
      tags:
        - Knowledge Files
      summary: Delete a knowledge file
      description: |
        Deletes a customer-visible file under `user_generated/` or `skills/`.
        A successful delete returns `204 No Content`. Missing or hidden paths
        return `404 Not Found`.

        Use `If-Match` with the current metadata ETag to delete only that
        version. An unconditional delete retries one concurrent race, then
        returns `409 Conflict` if another request still wins.
      operationId: deleteKnowledgeFile
      parameters:
        - $ref: '#/components/parameters/KnowledgeFilePath'
        - name: If-Match
          in: header
          required: false
          description: |
            Strong ETag from the current file metadata. The delete returns
            `412 Precondition Failed` if the validator is stale.
          schema:
            type: string
      responses:
        '204':
          description: Knowledge file deleted.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '409':
          $ref: '#/components/responses/Conflict'
        '412':
          $ref: '#/components/responses/PreconditionFailed'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  parameters:
    KnowledgeFilePath:
      name: file_path
      in: path
      required: true
      description: |
        Slash-delimited path under `user_generated/` or `skills/`. Maximum
        length is 900 UTF-8 bytes, with at most 255 bytes per path segment.
      schema:
        type: string
      example: user_generated/runbooks/checkout.md
  responses:
    BadRequest:
      description: >-
        An invalid body, path, query parameter, or header value. The `message`
        identifies the failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing, invalid, or revoked API key.
      headers:
        WWW-Authenticate:
          schema:
            type: string
          description: Authentication challenge (`Bearer`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Insufficient role, ownership, permission, or endpoint-specific access.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: >-
        The requested resource does not exist or is not visible to the
        authenticated organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    MethodNotAllowed:
      description: >-
        The path exists but does not support the requested HTTP method. Uses the
        `invalid_argument` error code.
      headers:
        Allow:
          schema:
            type: string
          description: Comma-separated HTTP methods supported by the path.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: The request conflicts with the current resource state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PreconditionFailed:
      description: >-
        A conditional request validator is stale or its required resource does
        not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: An unexpected error occurred on the server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServiceUnavailable:
      description: >-
        API infrastructure is not available. Some responses include a
        recommended retry delay.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Suggested seconds to wait before retrying, when available.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - conflict
                - internal
                - invalid_argument
                - not_found
                - payload_too_large
                - permission_denied
                - precondition_failed
                - resource_exhausted
                - unauthenticated
                - unavailable
                - unsupported_media_type
              description: Stable machine-readable error category.
            message:
              type: string
              description: Human-readable explanation of the error.
            retry_after:
              type: integer
              description: |
                Optional suggested seconds to wait before retrying. Present
                only when the server can recommend a delay, such as some `429`
                and `503` responses. When set, the response also includes a
                standard `Retry-After` HTTP header with the same value.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        Bearer token in the `Authorization` header — for example,
        `Authorization: Bearer trv_ak_your_api_key_here`. Each key is bound to a
        specific user and organization.

````