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

# Update Knowledge Base

> Updates the data of a knowledge base.

## Endpoint

`PUT https://gateway.orkeia.ai/knowledge-bases/{id}`

**Authentication**\
Requires header `authorization:  <your_token>`.

## Path Parameters

| Name | Type   | Required | Description                       | Example    |
| ---- | ------ | -------- | --------------------------------- | ---------- |
| id   | string | Yes      | Identifier of the knowledge base. | KB\_123456 |

## Request Body (JSON)

```json theme={null}
{
  "knowledgeBase": {
    "name": "New name",
    "description": "New description",
    "enabled": true,
    "sectors": ["hr"],
    "content": "https://storage.orkeia.ai/kb/new-policies.pdf",
    "type": "file",
    "multimodal": false,
    "tags": ["updated"]
  },
  "filename": "new-policies.pdf"
}
```

> **Notes**
>
> * The wrapper is the same as used in creation, containing `knowledgeBase` and `filename`.
> * For `type: "file"`, send the corresponding `filename` for the new file (if any).

## Example (cURL)

```bash theme={null}
curl -X PUT "https://gateway.orkeia.ai/knowledge-bases/KB_123456" \
  -H "authorization:  <your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "knowledgeBase": {
      "name": "New name",
      "description": "New description",
      "enabled": true,
      "sectors": ["hr"],
      "content": "https://storage.orkeia.ai/kb/new-policies.pdf",
      "type": "file",
      "multimodal": false,
      "tags": ["updated"]
    },
    "filename": "new-policies.pdf"
  }'
```

## Responses

### Response - Success

```json response theme={null}
{
  "status": "OK",
  "data": {
    "id": "KB_123456",
    "name": "New name",
    "description": "New description",
    "enabled": true,
    "sectors": ["hr"],
    "content": "https://storage.orkeia.ai/kb/new-policies.pdf",
    "type": "file",
    "multimodal": false,
    "tags": ["updated"]
  }
}
```

### 500 — Server Error

```json theme={null}
{
  "status": "ERROR",
  "code": "server/error",
  "data": null
}
```

### 400 — Client Error

```json theme={null}
{
  "status": "ERROR",
  "code": "client/error",
  "data": null
}
```
