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

# Remove a source from a knowledge base

> Detaches a source from a knowledge base and removes its embeddings from it. The source itself is not deleted. Requires a token with write access.



## OpenAPI

````yaml /openapi-knowledge-base.json delete /knowledge-base/datasets/{dataset_id}/sources/{dataset_source_id}
openapi: 3.0.3
info:
  title: AnyReach Knowledge Base API
  version: 1.0.0
  description: Manage knowledge bases, their sources, and run retrieval queries.
servers:
  - url: https://api.anyreach.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Knowledge bases
    description: >-
      A knowledge base (a `dataset` in the API) is a collection of embedded
      content an agent can retrieve from.
  - name: Knowledge base sources
    description: Attach and detach sources to a knowledge base.
  - name: Sources
    description: >-
      A source is a file or URL whose content is ingested, chunked, and
      embedded.
paths:
  /knowledge-base/datasets/{dataset_id}/sources/{dataset_source_id}:
    delete:
      tags:
        - Knowledge base sources
      summary: Remove a source from a knowledge base
      description: >-
        Detaches a source from a knowledge base and removes its embeddings from
        it. The source itself is not deleted. Requires a token with write
        access.
      operationId: removeKnowledgeBaseSource
      parameters:
        - name: dataset_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The knowledge base ID.
        - name: dataset_source_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The attachment ID (from List sources in a knowledge base).
      responses:
        '200':
          description: Source detached.
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  responses:
    Forbidden:
      description: The token's role doesn't grant access to this action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        detail:
          type: string
          example: Dataset not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Personal access token. See Authentication.

````