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

# Download Canonical Markdown

Use this API to return the canonical markdown extracted from a knowledge source. Returns `null` if the source has no canonical markdown yet. For a de-duplicated source (`dedupOf` set), the markdown is the winning source's, returned only once that source is `completed`; until then the endpoint returns `null` rather than a partially written document.

# Endpoint

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

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

#### Download a source's markdown

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

# Response

The result is the canonical markdown string, or `null` when not yet available.

#### Success Response

```JSON theme={null}
{
  "result": "# Brand Guidelines\n\n- Always cite medical claims...\n"
}
```

#### Failure Response

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

<ResponseExample>
  ```js theme={null}
  {
    "result": "# Brand Guidelines\n\n- Always cite medical claims...\n"
  }
  ```
</ResponseExample>
