> ## 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 `FAILED_PRECONDITION`; wait for it to finish (or remove dependents) and retry.

# Endpoint

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

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="sourceId" type="string" required>
      The knowledge source id returned by Ingest Knowledge.
    </ParamField>
  </Expandable>
</ParamField>

## **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.

#### 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"
  }
}
```

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