Skip to content

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 ​

FieldValue
MethodPOST
Path/openapi/v2/knowledge-bases
Operation IDcreateKnowledgeBase
AuthenticationBearer OpenAPI key

Parameters ​

This operation has no path or query parameters.

Request Body ​

application/json ​

FieldRequiredTypeExampleDescription
nameYesstringProduct DocsHuman-readable resource name, limited to 255 UTF-8 bytes.
descriptionNostring | nullProduct documentationOptional 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.

FieldRequiredTypeDescription
knowledgeBaseYesobjectKnowledge 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 StatusError CodeExplanation
401UNAUTHORIZEDThe Bearer API key is missing, malformed, unknown, revoked, or deleted.
413PAYLOAD_TOO_LARGEThe request body or requested file exceeds the size limit for this operation.
422VALIDATION_ERRORThe request failed validation.
429RATE_LIMITEDThe request exceeded the configured rate limits.
500INTERNAL_ERRORThe API encountered an internal error.
503DATABASE_REPOSITORY_UNAVAILABLEThe data required by this operation is temporarily unavailable.

Next Steps ​