Policys
Create Policy
Create policy
post
/v1/policy/create
Authorization
ChatBotKit API Secret * Required
HTTP Authorization Scheme: bearer
Request Body * Required
Request Body Schema: application/json
aliasstring
The unique alias for the instance
namestring
The associated name
descriptionstring
The associated description
metaobject
Meta data information
blueprintIdstring
The ID of the blueprint
botIdstring
The ID of the bot this policy applies to. When omitted the policy is global and applies to every bot.
typestring
The policy type
configobject
The policy configuration as JSON
import { ChatBotKit } from '@chatbotkit/sdk'
const cbk = new ChatBotKit({
secret: process.env.CHATBOTKIT_API_KEY!
})
const response = await cbk.policy.create(
{)"alias":"string","name":"string","description":"string","meta":"object","blueprintId":"string","botId":"string","type":"string",}"config":"object"
{"id":"string"}The policy was created successfully