Skip to main content
POST
/
knowledgebase
Create Knowledge Base
curl --request POST \
  --url https://api.trugen.ai/v1/knowledgebase \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-api-key: <api-key>' \
  --form 'name=HR Policy' \
  --form 'description=This knowledge base contains HR and compensation related information.' \
  --form input='@example-file' \
  --form 'text=As of 2025; we have increased the personal leaves to 15 per year.'
{
  "id": "5273e435-3cbb-4a11-9ea9-2c150ba19009",
  "message": "Knowledge Base created successfully"
}

Authorizations

x-api-key
string
header
required

Body

multipart/form-data
name
string
required

Human reabable name of the knowledge base.

Example:

"HR Policy"

description
string
required

Description of the knowledge base.

Example:

"This knowledge base contains HR and compensation related information."

input
file

Document file to upload (.pdf, .docx or .txt). Optional if text is provided.

Example:

"HR_Policy.docx"

text
string

As of 2025; we have increased the personal leaves to 15 per year.

Example:

"As of 2025; we have increased the personal leaves to 15 per year."

Response

Knowledge Base created successfully

id
string<uuid>

UUID of the newly created Knowledge Base

Example:

"5273e435-3cbb-4a11-9ea9-2c150ba19009"

message
string
Example:

"Knowledge Base created successfully"