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

# Create knowledge base

> Create a new knowledge base to store documents for your assistants.

Creates a new knowledge base. After creation, add documents to it using the [create document](/api-reference/knowledgebases/create-document) endpoint, then attach the knowledge base to an assistant.

## Endpoint

`POST /user/knowledgebases`

## Request

<ParamField body="name" type="string" required>
  Name of the knowledge base. Maximum 255 characters.
</ParamField>

<ParamField body="description" type="string">
  Optional description. Maximum 255 characters.
</ParamField>

## Response

<ResponseField name="message" type="string">Confirmation message.</ResponseField>

<ResponseField name="data" type="object">
  The created knowledge base.

  <Expandable title="properties">
    <ResponseField name="id" type="integer">Unique identifier.</ResponseField>
    <ResponseField name="name" type="string">Name of the knowledge base.</ResponseField>
    <ResponseField name="description" type="string">Description.</ResponseField>
    <ResponseField name="status" type="string">Status — always `empty` for new knowledge bases.</ResponseField>
    <ResponseField name="status_label" type="string">Human-readable status label.</ResponseField>
    <ResponseField name="created_at" type="string">ISO 8601 creation timestamp.</ResponseField>
    <ResponseField name="updated_at" type="string">ISO 8601 last update timestamp.</ResponseField>
  </Expandable>
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://portal.intellixent.ai/api/user/knowledgebases" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Product Documentation",
      "description": "Technical documentation for our products"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://portal.intellixent.ai/api/user/knowledgebases', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Product Documentation',
      description: 'Technical documentation for our products'
    })
  });

  const data = await response.json();
  console.log(data.data.id); // New knowledge base ID
  ```
</CodeGroup>

```json 201 Created theme={null}
{
  "message": "Knowledgebase created successfully.",
  "data": {
    "id": 1,
    "name": "Product Documentation",
    "description": "Technical documentation for our products",
    "status": "empty",
    "status_label": "Empty",
    "created_at": "2025-01-08T10:30:00.000000Z",
    "updated_at": "2025-01-08T10:30:00.000000Z"
  }
}
```

After creating the knowledge base:

1. Add documents using the [create document](/api-reference/knowledgebases/create-document) endpoint.
2. Wait for document processing to complete.
3. Attach the knowledge base to an assistant using the [update assistant](/api-reference/assistants/update-assistant) endpoint.
