API Documentation
V3
- Get Started
- Workspaces
- Agents
Agents
- Introduction
- GETGet Agent
- POSTCreate/Edit Agent
- DELDelete Agent
- POSTChat Interact
- POSTConfigure State
- 🧠 Knowledge Base
- 💬 Conversations
- 📊 Analytics
Workspaces
- GETGet Workspace
- POSTEdit Workspace
- DELDelete Workspace
- 💼 Agency
- 🏢 Orgs
- 🤝 Clients
Agents
Configure State
Configure the chat history state of the conversation and the associated metadata (name, email, etc)
POST
/
agents
/
{agent_id}
/
interact
/
{user_id}
/
state
curl --request POST \
--url https://eu-vg-edge.moeaymandev.workers.dev/agents/{agent_id}/interact/{user_id}/state \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"turns": [
{
"from": "<string>",
"messages": [
{
"from": "human",
"type": "launch",
"item": {},
"delay": 123,
"ts": 123
}
]
}
],
"delete": {
"mids": [
"<string>"
]
},
"metadata": {
"ID": "<string>",
"userID": "<string>",
"userName": "<string>",
"userEmail": "jsmith@example.com",
"userImage": "<string>",
"userPhone": "<string>",
"userBrowser": "<string>",
"userProfilePic": "<string>",
"origin": "web-chat",
"messagesNum": 123,
"interactionsNum": 123,
"ts": 123,
"tags": [
"<string>"
],
"convoTimeSeconds": 123,
"firstMessageTS": 123,
"lastMessageTS": 123,
"userPlatform": "<string>",
"state": "requested_chat",
"chatAssignedTo": "<string>",
"lastModified": 123,
"sessionsNum": 123
}
}'
{
"platformName": "vf",
"chatState": {},
"actionMessages": [
"<any>"
],
"turns": [
{
"from": "bot",
"messages": {
"from": "human",
"type": "launch",
"item": {},
"delay": 123,
"ts": 123
},
"ts": 123
}
],
"success": true,
"appError": "<string>",
"message": "<string>",
"agentData": {
"agentPlatform": "vf",
"title": "<string>",
"description": "<string>",
"VF_DIALOGUE_API_KEY": "<string>",
"VF_PROJECT_API_KEY": "<string>",
"theme": "<string>",
"customThemeJSONString": {
"themeType": "dark",
"primary": "<string>",
"nineColorPallet": [
[
123
]
]
},
"roundedImageURL": "<string>",
"avatarImageUrl": "<string>",
"headerImageUrl": "<string>",
"bannerImageUrl": "<string>",
"chatBgURL": "<string>",
"fontFamily": "<string>",
"branding": "<string>",
"lang": "<string>",
"UIhandoffdescription": "<string>",
"UIhandoffSubdescription": "<string>",
"buttonsLayout": "horizontal",
"ADVANCED_customCSS": "<string>",
"whatsappToken": "<string>",
"whatsappNumberId": "<string>",
"whatsappBusniessId": "<string>",
"webhookUrl": "<string>",
"gcloudPrivateKey": "<string>",
"gcloudClientEmail": "<string>",
"vg_initMessages": [
"<string>"
],
"vg_systemPrompt": "<string>",
"vg_temperature": 123,
"vg_defaultModel": "gpt-3.5-turbo-0125",
"vg_maxTokens": 123,
"vg_kbDefaultDimension": 123,
"vg_kbTopChunks": 123,
"vg_enableUIEngine": true,
"SECRET_API_KEY": "<string>",
"messageDelayMS": 123,
"proactiveMessage": "<string>",
"recordChatHistory": true,
"disableSmoothScroll": true,
"autoStartWidget": true,
"listenForUrlChanges": true,
"chatForget": true,
"enableAudioSupport": true,
"enableAITranslate": true,
"disableNoReplyListener": true,
"alwaysShowHandoff": true,
"fixedHandoffPopup": true,
"smartInit": true,
"showHandoffEvenIfOffline": true,
"enableQuickFileUpload": true
},
"origin": "web-chat",
"userID": "<string>",
"agentID": "<string>",
"oldTurns": [
{
"from": "bot",
"messages": {
"from": "human",
"type": "launch",
"item": {},
"delay": 123,
"ts": 123
},
"ts": 123
}
]
}
Authorizations
Agent/Workspace secret API key as bearer token.
Path Parameters
The ID of the agent to interact with
The ID of the user to interact with
Body
application/json
Interaction data
The body is of type object
.
Response
200
application/json
Interaction successful
The response is of type object
.
curl --request POST \
--url https://eu-vg-edge.moeaymandev.workers.dev/agents/{agent_id}/interact/{user_id}/state \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"turns": [
{
"from": "<string>",
"messages": [
{
"from": "human",
"type": "launch",
"item": {},
"delay": 123,
"ts": 123
}
]
}
],
"delete": {
"mids": [
"<string>"
]
},
"metadata": {
"ID": "<string>",
"userID": "<string>",
"userName": "<string>",
"userEmail": "jsmith@example.com",
"userImage": "<string>",
"userPhone": "<string>",
"userBrowser": "<string>",
"userProfilePic": "<string>",
"origin": "web-chat",
"messagesNum": 123,
"interactionsNum": 123,
"ts": 123,
"tags": [
"<string>"
],
"convoTimeSeconds": 123,
"firstMessageTS": 123,
"lastMessageTS": 123,
"userPlatform": "<string>",
"state": "requested_chat",
"chatAssignedTo": "<string>",
"lastModified": 123,
"sessionsNum": 123
}
}'
{
"platformName": "vf",
"chatState": {},
"actionMessages": [
"<any>"
],
"turns": [
{
"from": "bot",
"messages": {
"from": "human",
"type": "launch",
"item": {},
"delay": 123,
"ts": 123
},
"ts": 123
}
],
"success": true,
"appError": "<string>",
"message": "<string>",
"agentData": {
"agentPlatform": "vf",
"title": "<string>",
"description": "<string>",
"VF_DIALOGUE_API_KEY": "<string>",
"VF_PROJECT_API_KEY": "<string>",
"theme": "<string>",
"customThemeJSONString": {
"themeType": "dark",
"primary": "<string>",
"nineColorPallet": [
[
123
]
]
},
"roundedImageURL": "<string>",
"avatarImageUrl": "<string>",
"headerImageUrl": "<string>",
"bannerImageUrl": "<string>",
"chatBgURL": "<string>",
"fontFamily": "<string>",
"branding": "<string>",
"lang": "<string>",
"UIhandoffdescription": "<string>",
"UIhandoffSubdescription": "<string>",
"buttonsLayout": "horizontal",
"ADVANCED_customCSS": "<string>",
"whatsappToken": "<string>",
"whatsappNumberId": "<string>",
"whatsappBusniessId": "<string>",
"webhookUrl": "<string>",
"gcloudPrivateKey": "<string>",
"gcloudClientEmail": "<string>",
"vg_initMessages": [
"<string>"
],
"vg_systemPrompt": "<string>",
"vg_temperature": 123,
"vg_defaultModel": "gpt-3.5-turbo-0125",
"vg_maxTokens": 123,
"vg_kbDefaultDimension": 123,
"vg_kbTopChunks": 123,
"vg_enableUIEngine": true,
"SECRET_API_KEY": "<string>",
"messageDelayMS": 123,
"proactiveMessage": "<string>",
"recordChatHistory": true,
"disableSmoothScroll": true,
"autoStartWidget": true,
"listenForUrlChanges": true,
"chatForget": true,
"enableAudioSupport": true,
"enableAITranslate": true,
"disableNoReplyListener": true,
"alwaysShowHandoff": true,
"fixedHandoffPopup": true,
"smartInit": true,
"showHandoffEvenIfOffline": true,
"enableQuickFileUpload": true
},
"origin": "web-chat",
"userID": "<string>",
"agentID": "<string>",
"oldTurns": [
{
"from": "bot",
"messages": {
"from": "human",
"type": "launch",
"item": {},
"delay": 123,
"ts": 123
},
"ts": 123
}
]
}