Skip to main content
POST
/
v1
/
voice-agents
/
knowledge-base
/
toggle-activation
Toggle activation of a knowledge base item for a voice agent.
curl --request POST \
  --url https://api.tryhamsa.com/v1/voice-agents/knowledge-base/toggle-activation \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "voiceAgentId": "d949f13f-40d2-4e48-ac86-b66633070603",
  "knowledgeBaseItemId": "d949f13f-40d2-4e48-ac86-b66633070603",
  "isActive": true
}
'
{
  "success": false,
  "message": "Item activated successfully!",
  "messageKey": "ItemActivatedSuccessfully"
}

Authorizations

Authorization
string
header
required

Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token '

Body

application/json
voiceAgentId
string
required

The voice agent ID to toggle the activation of the knowledge base item on.

Example:

"d949f13f-40d2-4e48-ac86-b66633070603"

knowledgeBaseItemId
string
required

The knowledge base item ID to toggle the activation of.

Example:

"d949f13f-40d2-4e48-ac86-b66633070603"

isActive
boolean
default:true

The value of isActive to toggle the activation of the knowledge base item. True to activate, false to deactivate. Defaults to true.

Example:

true

Response

Successful response

success
boolean
default:false
message
string
default:success
Example:

"Item activated successfully!"

messageKey
string
default:ItemActivatedSuccessfully
Example:

"ItemActivatedSuccessfully"