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

# Delete Knowledge

Use this API to hard-delete a knowledge source and all its derived chunks and rules. A source that is still `processing`, or that other sources were de-duplicated against, returns `ABORTED` (HTTP 409). The dependents error also carries `details.dependentCount`. Poll [Get Ingest Status](https://velt.dev/docs/api-reference/rest-apis/v2/memory/knowledge/ingest-status.md) until the source is terminal, or delete the dependents first, then retry.

# Endpoint

`POST https://api.velt.dev/v2/memory/knowledge/delete`

Rate limit: 30 requests per minute per API key. This endpoint rejects unrecognized fields, so a misspelled key returns `INVALID_ARGUMENT`.

# Headers

**x-velt-api-key** `string` *required*

Your API key.

**x-velt-auth-token** `string` *required*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body

#### Params

**data** `object` *required*

**properties**

**sourceId** `string` *required*

The knowledge source id returned by Ingest Knowledge.

## **Example Requests**

#### Delete a source

```JSON theme={null}
{
  "data": {
    "sourceId": "src_9a8..."
  }
}
```

# Response

The response confirms the deletion and reports how many derived chunks and rules were removed. An unknown `sourceId`, or one belonging to another workspace, returns `NOT_FOUND`.

Deleting a de-duplicated source returns `deletedChunks: 0` and `deletedRules: 0`, because its content belongs to the source it was de-duplicated against.

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "deleted",
    "sourceId": "src_9a8...",
    "deletedChunks": 0,
    "deletedRules": 7
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

```js theme={null}
{
  "result": {
    "status": "deleted",
    "sourceId": "src_9a8...",
    "deletedChunks": 0,
    "deletedRules": 7
  }
}
```


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