> For the complete documentation index, see [llms.txt](https://anunzi-ai.gitbook.io/anunzi-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anunzi-ai.gitbook.io/anunzi-docs/api-widgets/trabajar-con-la-api-de-llamadas/knowledge-bases/create-knowledge-base.md).

# Crear base de conocimiento

**POST**\
`https://api.anunzi.net/v2/knowledge_base`

Create a new knowledge base in your Anunzi environment. This allows the AI assistant to access predefined information when interacting with users.

***

#### **Body Parameters**

| Parameter           | Type   | Required | Description                                                    |
| ------------------- | ------ | -------- | -------------------------------------------------------------- |
| `name`              | string | Yes      | The name of the knowledge base.                                |
| `rag_use_condition` | string | Yes      | The condition under which the knowledge base will be accessed. |

***

#### **Example Request (cURL)**

```bash
curl --request POST \
     --url https://api.anunzi.net/v2/knowledge_base \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'Authorization: Bearer API_KEY' \
     --data '
{
  "name": "Social Agent",
  "rag_use_condition": "When client asks by social assistant"
}
'
```

***

#### **Example Response (200 OK)**

```json
{
  "status": "ok",
  "response": {
    "body": "Knowledge Base created",
    "knowledge_base_id": "1739253053024x397207388602947460"
  }
}
```

***

#### **Response Fields**

| Field               | Type   | Description                                                |
| ------------------- | ------ | ---------------------------------------------------------- |
| `body`              | string | Confirmation message that the knowledge base was created.  |
| `knowledge_base_id` | string | The unique identifier of the newly created knowledge base. |

***

#### **Status Codes**

| Code | Description                                 |
| ---- | ------------------------------------------- |
| 200  | Knowledge base created successfully.        |
| 400  | Bad Request. Invalid or missing parameters. |
