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

# Knowledge Docs

> Read knowledge base documents for a project

## List active knowledge docs

```http theme={null}
GET /api/knowledge-docs
```

Returns the active version of every knowledge doc in a project.

### Query parameters

<ParamField query="projectSlug" type="string">
  The project slug. Required if `projectId` is not provided.
</ParamField>

<ParamField query="projectId" type="string">
  The project UUID. Required if `projectSlug` is not provided.
</ParamField>

### Response

```json theme={null}
{
  "knowledgeDocs": [
    {
      "id": "uuid",
      "slug": "refund-policy",
      "title": "Refund Policy",
      "content": "Customers may request a refund...",
      "createdAt": "2026-04-01T12:00:00.000Z",
      "updatedAt": "2026-04-08T09:30:00.000Z"
    }
  ]
}
```

### Example

<CodeGroup>
  ```bash curl theme={null}
  curl "https://app.artanis.ai/api/knowledge-docs?projectSlug=my-project" \
    -H "x-api-key: $ARTANIS_API_KEY" \
    -H "x-org-slug: my-org"
  ```

  ```python Python theme={null}
  import os, requests

  r = requests.get(
      "https://app.artanis.ai/api/knowledge-docs",
      params={"projectSlug": "my-project"},
      headers={
          "x-api-key": os.environ["ARTANIS_API_KEY"],
          "x-org-slug": "my-org",
      },
  )
  docs = r.json()["knowledgeDocs"]
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch("https://app.artanis.ai/api/knowledge-docs?projectSlug=my-project", {
    headers: {
      "x-api-key": process.env.ARTANIS_API_KEY!,
      "x-org-slug": "my-org",
    },
  });
  const { knowledgeDocs } = await res.json();
  ```
</CodeGroup>

## Get a knowledge doc with version history

```http theme={null}
GET /api/knowledge-docs/{docId}
```

Returns a single knowledge doc and every version of it, oldest first.

### Path parameters

<ParamField path="docId" type="string" required>
  The knowledge doc UUID.
</ParamField>

### Response

```json theme={null}
{
  "id": "uuid",
  "slug": "refund-policy",
  "title": "Refund Policy",
  "versions": [
    {
      "id": "uuid",
      "content": "...",
      "isActive": false,
      "createdAt": "2026-03-01T00:00:00.000Z"
    },
    {
      "id": "uuid",
      "content": "...",
      "isActive": true,
      "createdAt": "2026-04-01T00:00:00.000Z"
    }
  ]
}
```
