Create knowledge base
Interface Description
Create a new knowledge base and receive the knowledgeBaseId required by its upload, processing-status, readable-file, and deletion APIs.
Endpoint
| Field | Value |
|---|---|
| Method | POST |
| Path | /openapi/v2/knowledge-bases |
| Operation ID | createKnowledgeBase |
| Authentication | Bearer OpenAPI key |
Parameters
This operation has no path or query parameters.
Request Body
application/json
| Field | Required | Type | Example | Description |
|---|---|---|---|---|
name | Yes | string | Product Docs | Human-readable resource name, limited to 255 UTF-8 bytes. |
description | No | string | null | Product documentation | Optional description, limited to 16384 UTF-8 bytes. |
Request Example
bash
curl -X POST "https://openapi.example.com/openapi/v2/knowledge-bases" \
-H "Authorization: Bearer <openapi-key>" \
-H "Content-Type: application/json" \
--data '{
"name": "Product Docs",
"description": "Product documentation"
}'Successful Responses
201
Newly created knowledge base.
| Field | Required | Type | Description |
|---|---|---|---|
knowledgeBase | Yes | object | Knowledge base returned by the request. |
Success Response Example
json
{
"knowledgeBase": {
"knowledgeBaseId": "knowledge-base-11111111-1111-4111-8111-111111111111",
"name": "Product Docs",
"description": "Product documentation",
"activeContentRevision": 0,
"resourceRevision": 1,
"createdAt": "2026-06-17T00:00:00.000Z",
"updatedAt": "2026-06-17T00:00:00.000Z"
}
}Error Codes
The table below lists every error response documented for this operation.
| HTTP Status | Error Code | Explanation |
|---|---|---|
| 401 | UNAUTHORIZED | The Bearer API key is missing, malformed, unknown, revoked, or deleted. |
| 413 | PAYLOAD_TOO_LARGE | The request body or requested file exceeds the size limit for this operation. |
| 422 | VALIDATION_ERROR | The request failed validation. |
| 429 | RATE_LIMITED | The request exceeded the configured rate limits. |
| 500 | INTERNAL_ERROR | The API encountered an internal error. |
| 503 | DATABASE_REPOSITORY_UNAVAILABLE | The data required by this operation is temporarily unavailable. |