Skip to main content
PUT
/
kb
/
manage
Update a knowledge base
curl --request PUT \
  --url https://asteragents.com/api/kb/manage \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Updated Documentation",
  "description": "<string>",
  "extractionModel": "<string>",
  "extractionSchema": {},
  "trigger": {
    "enabled": true,
    "agentId": 42,
    "prompt": "Summarize this document and extract key topics",
    "createdAt": "2023-11-07T05:31:56Z"
  }
}
'
{
  "success": true,
  "knowledgeBase": {
    "id": 1,
    "name": "Product Documentation",
    "embeddingModel": "openai:text-embedding-3-small",
    "embeddingDimensions": 1536,
    "createdAt": "2024-01-15T10:30:00.000Z",
    "updatedAt": "2024-01-15T10:30:00.000Z",
    "userId": "user_2ABC123DEF",
    "fileCount": 12,
    "status": "ready",
    "description": "All product docs and user guides",
    "extractionModel": "<string>",
    "extractionSchema": {},
    "source": null,
    "trigger": {
      "enabled": true,
      "agentId": 42,
      "prompt": "Summarize this document and extract key topics",
      "createdAt": "2023-11-07T05:31:56Z"
    },
    "lastFileUploadedAt": "2023-11-07T05:31:56Z",
    "totalSize": 123
  }
}

Authorizations

Authorization
string
header
required

JWT token from Clerk authentication.

Must be from a user with org:admin role.

Query Parameters

id
integer
required

The ID of the knowledge base to update

Example:

1

Body

application/json
name
string
required

Knowledge base name

Example:

"Updated Documentation"

description
string | null

Optional description

extractionModel
string | null

Optional extraction model

extractionSchema
object

Optional extraction schema

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 updated successfully

success
boolean
required
knowledgeBase
object
required