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

# Delete Knowledge Document

> Permanently deletes the document, the stored file and the copy held by the voice provider. This cannot be undone.

Permanently deletes a document from an agent's knowledge base. **This action cannot be undone.**

## Overview

Deletion removes the document record, the stored file and the copy held by the voice provider. There is no soft-delete and no version history to recover from, which is what makes this a genuine erasure rather than a hidden retention.

The freed slot is available immediately.

## Example

```bash theme={null}
curl -X DELETE https://api.instaview.sk/agents/$AGENT_ID/knowledge/$DOCUMENT_ID \
  -H "Authorization: Bearer $INSTAVIEW_API_KEY"
```

```json theme={null}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "deleted": true
}
```

<Info>
  This is the response shape after the [August 3, 2026 envelope
  change](/changelog/2026-08). Until that cutover, integrations still receiving the legacy
  envelope get `{ "statusCode": 200, "message": "Success", "data": true, "traceId": "…" }`
  instead. Watch for the `Deprecation` and `Sunset` headers to tell which shape you are on.
</Info>

## Pending Documents

Works on `PENDING` documents too. Deleting one is how you release a reserved slot straight away instead of waiting for the 24-hour cleanup.

<Info>
  To stop using a document without losing it, [deactivate
  it](/api-reference/agents/knowledge/update-knowledge) instead.
</Info>

## Error Scenarios

* **404 Not Found**: No such document on that agent

## Related Resources

* [Update Knowledge Document](/api-reference/agents/knowledge/update-knowledge)
* [List Knowledge Documents](/api-reference/agents/knowledge/list-knowledge)


## OpenAPI

````yaml DELETE /agents/{id}/knowledge/{documentId}
openapi: 3.0.0
info:
  title: InstaView API
  description: |-
    InstaView API Documentation

    ## Authentication

    All endpoints require API key authentication using Bearer token:
    ```
    Authorization: Bearer sk_your_api_key_here
    ```

    ## API Key Management

    The API Key module provides comprehensive key management for:
    - **Direct Client Keys**: Company-scoped keys for your applications
    - **ATS Partner Keys**: Resource-scoped keys for ATS integrations

    ### Key Features
    - HMAC-SHA256 hashing for API key storage
    - Configurable rate limiting
    - Comprehensive audit logging
    - Company-level isolation
    - Resource scoping for ATS partners
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.instaview.sk
    description: Production API Gateway
security: []
tags: []
paths:
  /agents/{id}/knowledge/{documentId}:
    delete:
      tags:
        - Agents
      summary: Delete a knowledge document
      description: >-
        Permanently deletes the document, the stored file and the copy held by
        the voice provider. This cannot be undone.
      operationId: PublicAgentKnowledgeController_deleteDocument_v1
      parameters:
        - name: id
          required: true
          in: path
          description: Agent the knowledge base belongs to.
          schema:
            type: string
            format: uuid
        - name: documentId
          required: true
          in: path
          description: Knowledge document id.
          schema:
            type: string
            format: uuid
        - name: companyId
          required: false
          in: query
          description: >-
            Required for ATS API keys to specify which company to access.
            Ignored for standard company API keys.
          schema:
            type: string
      responses:
        '200':
          description: Deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicDeletedResponseDto'
        '404':
          description: No such document on that agent.
      security:
        - bearer: []
components:
  schemas:
    PublicDeletedResponseDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Id of the deleted resource
        deleted:
          type: boolean
          enum:
            - true
          example: true
          description: Always true; a failed delete answers with an error status
      required:
        - id
        - deleted
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: API key for authentication using Bearer scheme

````