---
title: "Delete Knowledge Source"
method: DELETE
path: "/api/v1/knowledge/{knowledge_source_id}"
tags: ["knowledge"]
---

# Delete Knowledge Source

`DELETE /api/v1/knowledge/{knowledge_source_id}`

## Request

- Base URL: `https://api.gnosari.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.gnosari.com/api/v1/knowledge/{knowledge_source_id}`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-AUTH-TOKEN`

Queue knowledge source deletion (async).

Returns immediately with job_id. Actual deletion happens in background.
All documents indexed from this source will be deleted from OpenSearch,
then the PostgreSQL record will be removed.

**Deletion Flow:**
1. All documents in OpenSearch are deleted asynchronously
2. PostgreSQL source record is deleted

**Tracking:**
Poll the source endpoint - if it returns 404, deletion is complete.

## Path parameters

- `knowledge_source_id` integer, required

## Response `200`

Successful Response

- DeletionResponse: Response schema for async deletion operations. Deletion is queued and processed asynchronously via the neoqueue outbox. Poll GET /collections to check status.
  - `job_id` string, required: Event ID for tracking the deletion (outbox event)
  - `status` string: Current status (deleting)
  - `message` string: Human-readable status message

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/gnosari/apis/gnosari-api.md) · [All operations](https://skmtc.dev/gnosari/apis/gnosari-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gnosari/apis/gnosari-api/revisions/f299cf53ae5f?raw)
