Skip to main content
POST
/
update-knowledgebase-status
Update knowledge base status
curl --request POST \
  --url https://www.tryunleashx.com/api/v1/global/update-knowledgebase-status \
  --header 'Content-Type: application/json' \
  --header 'token: <token>' \
  --data '
{
  "knowledge_base_id": 123,
  "status": "active"
}
'
{
  "message": "<string>",
  "data": {
    "id": 123,
    "name": "<string>",
    "status": 123
  }
}
Use this endpoint to update the status of a knowledge base item linked to a campaign.

Endpoint

POST /update-knowledgebase-status Content-Type: application/json Authentication: Required (workspace auth)

Request Body

{
  "knowledge_base_id": 7,
  "status": "active"
}
FieldTypeRequiredDescription
knowledge_base_idnumberYesID of the knowledge base record
statusstringYesactive or inactive

Response

{
  "message": "Knowledge base status updated successfully",
  "data": {
    "id": 7,
    "name": "faq.pdf",
    "status": 1
  }
}

Behavior

  • Updates the knowledge base STATUS and resets TRAINED to 0 (untrained), requiring re-training.
  • Validates that the knowledge base record exists and is not deleted.
  • Validates that the associated agent exists and is not deleted.

Error Cases

ErrorCause
Knowledge base not foundInvalid knowledge_base_id or record is deleted
Associated agent not foundThe linked agent has been removed

Example cURL

curl -X POST https://www.tryunleashx.com/api/v1/global/update-knowledgebase-status \
  -H "Content-Type: application/json" \
  -H "token: <api_key>" \
  -d '{
    "knowledge_base_id": 7,
    "status": "active"
  }'

Headers

token
string
required

API token for authentication

Body

application/json
knowledge_base_id
integer
required

ID of the knowledge base record

status
enum<string>
required

New status value to set. Use 'active' to enable or 'inactive' to disable.

Available options:
active,
inactive

Response

Knowledge base status updated successfully

message
string
data
object