AI Chatbot Hub
HomepageAPI docsDiscordLog inSign up
API docs
API docs
  • API usage guides
    • Getting an API key
    • Create a chatbot
    • Chat with chatbot
    • Uploading data sources
  • Chatbots
    • Chatbot properties
    • Create chatbot
    • Update chatbot
    • Fetch a chatbot
    • Fetch all chatbots
    • Delete chatbot
  • Agents
    • Agent properties
    • Create agent
    • Update agent
    • Fetch all agents
    • Delete agent
  • Chatbot sessions
    • Session properties
    • Create session
    • Fetch a session
    • Fetch all sessions
    • Delete session
  • Session messages
    • Message properties
    • Create message
    • Fetch all messages
    • Delete message
    • Delete multiple messages
  • Data sources
    • Source properties
    • Upload a file
    • Create QA source
    • Create URL source
    • Update source
    • Fetch list of sources
    • Retrain sources
    • Delete source
    • Delete multiple sources
  • Data source tags
    • Create source tag
    • Fetch all source tags
    • Update source tag
    • Delete source tag
Powered by GitBook
On this page
  • Endpoint
  • Authorization
  • Path
  • ​Body
  • Request example
  • Response
  • Response example
  1. Agents

Update agent

Update agent meta based on uuid

PreviousCreate agentNextFetch all agents

Last updated 6 months ago

Endpoint

POST /api / v1 / agent / {uuid} / update

Authorization

Authorization string Bearer <your_token>

Path

uuid string required

Body

name string

prompt string

description string

model string

enabled boolean

data_source_uuids List[string]

human_escalation_settings HumanEscalationSettings Object

Child attributes

human_requested_message string

live_chat_end_announcement string

live_chat_start_announcement string

monitored_messages List[string]

notifications_enabled boolean

sound_enabled boolean


variables List[AgentVariable]

Child attributes

name string

description string

type select

”string”, “number”, “boolean”

example string

Only for user-facing agents.


tags tags Object

Child attributes

name string

criteria string

color string

Only for background agents


temperature float

use_all_sources boolean

Request example

curl --location --request POST 'https://app.aichatbothub.com/api/v1/agent/{uuid}/update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
    "name": "Test update agent name",
    "description": "Test update agent description",
    "prompt": "Test update agent prompt",
    "model": "gpt-4o-mini-16k",
    "enabled": true,
    "variables": [{"description":"Email of the user.","example":"alice@company.com, ben@school.edu, carl@city.org","type":"string","default_value":{"content":"","static":0},"name":"user_email"},{"description":"Full name of the user, in the format of [First name] [Last name]","example":"","type":"string","default_value":{"content":"","static":0},"name":"user_name"}]

}'
import requests

uuid = '<agent-uuid>'
url = f'https://app.aichatbothub.com/api/v1/agent/{uuid}/update'
headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <token>'
}

data = {
    "name": "Test update agent name",
    "description": "Test update agent description",
    "prompt": "Test update agent prompt",
    "model": "gpt-4o-mini-16k",
    "enabled": true,
    "variables": [{"description":"Email of the user.","example":"alice@company.com, ben@school.edu, carl@city.org","type":"string","default_value":{"content":"","static":0},"name":"user_email"},{"description":"Full name of the user, in the format of [First name] [Last name]","example":"","type":"string","default_value":{"content":"","static":0},"name":"user_name"}]

}

response = requests.post(url, headers=headers, json=data)

if response.status_code == 200:
    print("Request successful!")
    print(response.json())
else:
    print("Request failed with status code:", response.status_code)
    print(response.text)
const axios = require('axios');

const uuid = '<agent-uuid>'
const url = `https://app.aichatbothub.com/api/v1/agent/${uuid}/update`;
const headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <token>'
};

data = {
    "name": "Test update agent name",
    "description": "Test update agent description",
    "prompt": "Test update agent prompt",
    "model": "gpt-4o-mini-16k",
    "enabled": true,
    "variables": [{"description":"Email of the user.","example":"alice@company.com, ben@school.edu, carl@city.org","type":"string","default_value":{"content":"","static":0},"name":"user_email"},{"description":"Full name of the user, in the format of [First name] [Last name]","example":"","type":"string","default_value":{"content":"","static":0},"name":"user_name"}]

}

axios.post(url, data, { headers })
    .then(response => {
        console.log('Request successful!');
        console.log(response.data);
    })
    .catch(error => {
        console.error('Request failed:', error);
    });

Response

uuid string

name string

prompt string

description string

type string

created_at string

modified_at string

enabled boolean

meta meta Object

data_source_uuids List[string]

human_escalation_settings HumanEscalationSettings Object

tool_functions List[ToolFunction]

variables List[AgentVariable]

Response example

{
    "created_at": "2024-07-25T21:19:01Z",
    "data_source_uuids": [],
    "description": "Test update agent description",
    "enabled": true,
    "meta": {
        "model": "gpt-4o-mini-16k",
        "tags": [],
        "temperature": 0.0
    },
    "modified_at": "2024-07-25T21:19:01Z",
    "name": "Test update agent name",
    "prompt": "Test update agent prompt",
    "tool_functions": [],
    "type": "user-facing",
    "uuid": "43474da7ae3b4b7191ee29c2de798257",
    "variables": [
        {
            "default_value": {
                "content": "",
                "static": 0
            },
            "description": "Email of the user.",
            "example": "alice@company.com, ben@school.edu, carl@city.org",
            "name": "user_email",
            "type": "string"
        },
        {
            "default_value": {
                "content": "",
                "static": 0
            },
            "description": "Full name of the user, in the format of [First name] [Last name]",
            "example": "",
            "name": "user_name",
            "type": "string"
        }
    ]
}

​