Skip to main content
POST
/
kb
/
manage
curl --request POST \
  --url https://asteragents.com/api/kb/manage \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Product Documentation",
  "embeddingModel": "openai:text-embedding-3-small"
}
'
{
  "success": true,
  "knowledgeBase": {
    "id": 1,
    "name": "Product Documentation",
    "description": null,
    "embeddingModel": "openai:text-embedding-3-small",
    "embeddingDimensions": 1536,
    "extractionModel": null,
    "extractionSchema": null,
    "source": null,
    "trigger": null,
    "createdAt": "2024-01-15T10:30:00.000Z",
    "updatedAt": "2024-01-15T10:30:00.000Z",
    "userId": "user_2ABC123DEF",
    "fileCount": 0,
    "status": "empty"
  }
}

Authorizations

Authorization
string
header
required

JWT token from Clerk authentication.

Must be from a user with org:admin role.

Body

application/json
name
string
required

Name of the knowledge base (must be unique within the org)

Example:

"Product Documentation"

embeddingModel
string
required

Embedding model identifier (e.g., openai:text-embedding-3-small)

Example:

"openai:text-embedding-3-small"

description
string | null

Optional description

Example:

"All product docs and user guides"

extractionModel
string | null

Optional model for structured data extraction from files

extractionSchema
object

JSON schema defining what structured data to extract from files

source
string | null

Integration source identifier. When set, the KB becomes integration-managed — manual file upload/deletion is disabled in the UI, but API access remains unrestricted.

Example:

"salesforce"

trigger
object

Trigger configuration that automatically runs an agent when new files are added. Set enabled: true with an agentId and prompt to activate.

Response

Knowledge base created successfully

success
boolean
required
knowledgeBase
object
required