curl --request PUT \
--url https://api.closebot.com/bot/{id} \
--header 'Content-Type: application/json' \
--header 'X-CB-KEY: <api-key>' \
--data '
{
"favorite": true,
"trash": true,
"locked": true,
"rescheduling": true,
"name": "<string>",
"folderId": "<string>",
"category": "<string>",
"followUpActive": true,
"followUpSequences": [
{
"order": 123,
"duration": 123,
"unit": "<string>"
}
],
"smartFollowUp": true,
"followUpRepeat": true,
"followUpVarianceMinutes": 123,
"followUpExtraPrompt": "<string>",
"followUpStates": [
{
"name": "<string>",
"isDefault": true,
"sequences": [
{
"order": 123,
"duration": 123,
"unit": "<string>"
}
],
"repeatFinal": true,
"extraPrompt": "<string>",
"order": 123
}
],
"personaIds": [
"<string>"
],
"personaWeights": {},
"personaSplitTest": {
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"personas": [
{
"personaId": "<string>",
"weight": 123,
"order": 123,
"results": {
"personaId": "<string>",
"personaName": "<string>",
"splitWeight": 123,
"totalInstances": 123,
"responseCount": 123,
"averageMetric": 123,
"sources": [
{
"sourceId": "<string>",
"sourceName": "<string>",
"totalInstances": 123,
"responseCount": 123,
"averageMetric": 123
}
],
"computedAt": "2023-11-07T05:31:56Z"
}
}
],
"id": "<string>",
"isActive": true,
"metric": "<string>"
}
}
'import requests
url = "https://api.closebot.com/bot/{id}"
payload = {
"favorite": True,
"trash": True,
"locked": True,
"rescheduling": True,
"name": "<string>",
"folderId": "<string>",
"category": "<string>",
"followUpActive": True,
"followUpSequences": [
{
"order": 123,
"duration": 123,
"unit": "<string>"
}
],
"smartFollowUp": True,
"followUpRepeat": True,
"followUpVarianceMinutes": 123,
"followUpExtraPrompt": "<string>",
"followUpStates": [
{
"name": "<string>",
"isDefault": True,
"sequences": [
{
"order": 123,
"duration": 123,
"unit": "<string>"
}
],
"repeatFinal": True,
"extraPrompt": "<string>",
"order": 123
}
],
"personaIds": ["<string>"],
"personaWeights": {},
"personaSplitTest": {
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"personas": [
{
"personaId": "<string>",
"weight": 123,
"order": 123,
"results": {
"personaId": "<string>",
"personaName": "<string>",
"splitWeight": 123,
"totalInstances": 123,
"responseCount": 123,
"averageMetric": 123,
"sources": [
{
"sourceId": "<string>",
"sourceName": "<string>",
"totalInstances": 123,
"responseCount": 123,
"averageMetric": 123
}
],
"computedAt": "2023-11-07T05:31:56Z"
}
}
],
"id": "<string>",
"isActive": True,
"metric": "<string>"
}
}
headers = {
"X-CB-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-CB-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
favorite: true,
trash: true,
locked: true,
rescheduling: true,
name: '<string>',
folderId: '<string>',
category: '<string>',
followUpActive: true,
followUpSequences: [{order: 123, duration: 123, unit: '<string>'}],
smartFollowUp: true,
followUpRepeat: true,
followUpVarianceMinutes: 123,
followUpExtraPrompt: '<string>',
followUpStates: [
{
name: '<string>',
isDefault: true,
sequences: [{order: 123, duration: 123, unit: '<string>'}],
repeatFinal: true,
extraPrompt: '<string>',
order: 123
}
],
personaIds: ['<string>'],
personaWeights: {},
personaSplitTest: {
startedAt: '2023-11-07T05:31:56Z',
endedAt: '2023-11-07T05:31:56Z',
personas: [
{
personaId: '<string>',
weight: 123,
order: 123,
results: {
personaId: '<string>',
personaName: '<string>',
splitWeight: 123,
totalInstances: 123,
responseCount: 123,
averageMetric: 123,
sources: [
{
sourceId: '<string>',
sourceName: '<string>',
totalInstances: 123,
responseCount: 123,
averageMetric: 123
}
],
computedAt: '2023-11-07T05:31:56Z'
}
}
],
id: '<string>',
isActive: true,
metric: '<string>'
}
})
};
fetch('https://api.closebot.com/bot/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.closebot.com/bot/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'favorite' => true,
'trash' => true,
'locked' => true,
'rescheduling' => true,
'name' => '<string>',
'folderId' => '<string>',
'category' => '<string>',
'followUpActive' => true,
'followUpSequences' => [
[
'order' => 123,
'duration' => 123,
'unit' => '<string>'
]
],
'smartFollowUp' => true,
'followUpRepeat' => true,
'followUpVarianceMinutes' => 123,
'followUpExtraPrompt' => '<string>',
'followUpStates' => [
[
'name' => '<string>',
'isDefault' => true,
'sequences' => [
[
'order' => 123,
'duration' => 123,
'unit' => '<string>'
]
],
'repeatFinal' => true,
'extraPrompt' => '<string>',
'order' => 123
]
],
'personaIds' => [
'<string>'
],
'personaWeights' => [
],
'personaSplitTest' => [
'startedAt' => '2023-11-07T05:31:56Z',
'endedAt' => '2023-11-07T05:31:56Z',
'personas' => [
[
'personaId' => '<string>',
'weight' => 123,
'order' => 123,
'results' => [
'personaId' => '<string>',
'personaName' => '<string>',
'splitWeight' => 123,
'totalInstances' => 123,
'responseCount' => 123,
'averageMetric' => 123,
'sources' => [
[
'sourceId' => '<string>',
'sourceName' => '<string>',
'totalInstances' => 123,
'responseCount' => 123,
'averageMetric' => 123
]
],
'computedAt' => '2023-11-07T05:31:56Z'
]
]
],
'id' => '<string>',
'isActive' => true,
'metric' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CB-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.closebot.com/bot/{id}"
payload := strings.NewReader("{\n \"favorite\": true,\n \"trash\": true,\n \"locked\": true,\n \"rescheduling\": true,\n \"name\": \"<string>\",\n \"folderId\": \"<string>\",\n \"category\": \"<string>\",\n \"followUpActive\": true,\n \"followUpSequences\": [\n {\n \"order\": 123,\n \"duration\": 123,\n \"unit\": \"<string>\"\n }\n ],\n \"smartFollowUp\": true,\n \"followUpRepeat\": true,\n \"followUpVarianceMinutes\": 123,\n \"followUpExtraPrompt\": \"<string>\",\n \"followUpStates\": [\n {\n \"name\": \"<string>\",\n \"isDefault\": true,\n \"sequences\": [\n {\n \"order\": 123,\n \"duration\": 123,\n \"unit\": \"<string>\"\n }\n ],\n \"repeatFinal\": true,\n \"extraPrompt\": \"<string>\",\n \"order\": 123\n }\n ],\n \"personaIds\": [\n \"<string>\"\n ],\n \"personaWeights\": {},\n \"personaSplitTest\": {\n \"startedAt\": \"2023-11-07T05:31:56Z\",\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"personas\": [\n {\n \"personaId\": \"<string>\",\n \"weight\": 123,\n \"order\": 123,\n \"results\": {\n \"personaId\": \"<string>\",\n \"personaName\": \"<string>\",\n \"splitWeight\": 123,\n \"totalInstances\": 123,\n \"responseCount\": 123,\n \"averageMetric\": 123,\n \"sources\": [\n {\n \"sourceId\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"totalInstances\": 123,\n \"responseCount\": 123,\n \"averageMetric\": 123\n }\n ],\n \"computedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"isActive\": true,\n \"metric\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-CB-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.closebot.com/bot/{id}")
.header("X-CB-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"favorite\": true,\n \"trash\": true,\n \"locked\": true,\n \"rescheduling\": true,\n \"name\": \"<string>\",\n \"folderId\": \"<string>\",\n \"category\": \"<string>\",\n \"followUpActive\": true,\n \"followUpSequences\": [\n {\n \"order\": 123,\n \"duration\": 123,\n \"unit\": \"<string>\"\n }\n ],\n \"smartFollowUp\": true,\n \"followUpRepeat\": true,\n \"followUpVarianceMinutes\": 123,\n \"followUpExtraPrompt\": \"<string>\",\n \"followUpStates\": [\n {\n \"name\": \"<string>\",\n \"isDefault\": true,\n \"sequences\": [\n {\n \"order\": 123,\n \"duration\": 123,\n \"unit\": \"<string>\"\n }\n ],\n \"repeatFinal\": true,\n \"extraPrompt\": \"<string>\",\n \"order\": 123\n }\n ],\n \"personaIds\": [\n \"<string>\"\n ],\n \"personaWeights\": {},\n \"personaSplitTest\": {\n \"startedAt\": \"2023-11-07T05:31:56Z\",\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"personas\": [\n {\n \"personaId\": \"<string>\",\n \"weight\": 123,\n \"order\": 123,\n \"results\": {\n \"personaId\": \"<string>\",\n \"personaName\": \"<string>\",\n \"splitWeight\": 123,\n \"totalInstances\": 123,\n \"responseCount\": 123,\n \"averageMetric\": 123,\n \"sources\": [\n {\n \"sourceId\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"totalInstances\": 123,\n \"responseCount\": 123,\n \"averageMetric\": 123\n }\n ],\n \"computedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"isActive\": true,\n \"metric\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.closebot.com/bot/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-CB-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"favorite\": true,\n \"trash\": true,\n \"locked\": true,\n \"rescheduling\": true,\n \"name\": \"<string>\",\n \"folderId\": \"<string>\",\n \"category\": \"<string>\",\n \"followUpActive\": true,\n \"followUpSequences\": [\n {\n \"order\": 123,\n \"duration\": 123,\n \"unit\": \"<string>\"\n }\n ],\n \"smartFollowUp\": true,\n \"followUpRepeat\": true,\n \"followUpVarianceMinutes\": 123,\n \"followUpExtraPrompt\": \"<string>\",\n \"followUpStates\": [\n {\n \"name\": \"<string>\",\n \"isDefault\": true,\n \"sequences\": [\n {\n \"order\": 123,\n \"duration\": 123,\n \"unit\": \"<string>\"\n }\n ],\n \"repeatFinal\": true,\n \"extraPrompt\": \"<string>\",\n \"order\": 123\n }\n ],\n \"personaIds\": [\n \"<string>\"\n ],\n \"personaWeights\": {},\n \"personaSplitTest\": {\n \"startedAt\": \"2023-11-07T05:31:56Z\",\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"personas\": [\n {\n \"personaId\": \"<string>\",\n \"weight\": 123,\n \"order\": 123,\n \"results\": {\n \"personaId\": \"<string>\",\n \"personaName\": \"<string>\",\n \"splitWeight\": 123,\n \"totalInstances\": 123,\n \"responseCount\": 123,\n \"averageMetric\": 123,\n \"sources\": [\n {\n \"sourceId\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"totalInstances\": 123,\n \"responseCount\": 123,\n \"averageMetric\": 123\n }\n ],\n \"computedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"isActive\": true,\n \"metric\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"modifiedAt": "<string>",
"modifiedBy": "<string>",
"versions": [
{
"version": "<string>",
"name": "<string>",
"published": true,
"modifiedAt": "2023-11-07T05:31:56Z",
"modifiedBy": "<string>"
}
],
"sources": [
{
"id": "<string>",
"category": "<string>",
"key": "<string>",
"name": "<string>",
"tags": [
{
"name": "<string>",
"approveDeny": true,
"id": "<string>"
}
],
"tagFilterConfig": {
"operator": "<string>",
"groups": [
{
"operator": "<string>",
"rules": [
{
"tagName": "<string>",
"tagId": "<string>",
"condition": "<string>"
}
]
}
]
},
"channelList": [
"<string>"
],
"channelRules": {
"channels": [
{
"channel": "<string>",
"type": "<string>",
"rules": [
{
"operator": "<string>",
"value": "<string>"
}
]
}
]
},
"personaNameOverride": "<string>",
"enabled": true,
"flowVariableValues": {}
}
],
"personaIds": [
"<string>"
],
"personaWeights": {},
"favorited": true,
"locked": true,
"reschedulingEnabled": true,
"category": "<string>",
"folderId": "<string>",
"followUpActive": true,
"followUpSequences": [
{
"order": 123,
"duration": 123,
"unit": "<string>"
}
],
"smartFollowUp": true,
"followUpRepeat": true,
"followUpVarianceMinutes": 123,
"followUpExtraPrompt": "<string>",
"personaSplitTest": {
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"personas": [
{
"personaId": "<string>",
"weight": 123,
"order": 123,
"results": {
"personaId": "<string>",
"personaName": "<string>",
"splitWeight": 123,
"totalInstances": 123,
"responseCount": 123,
"averageMetric": 123,
"sources": [
{
"sourceId": "<string>",
"sourceName": "<string>",
"totalInstances": 123,
"responseCount": 123,
"averageMetric": 123
}
],
"computedAt": "2023-11-07T05:31:56Z"
}
}
],
"id": "<string>",
"isActive": true,
"metric": "<string>"
},
"tools": [
{
"id": "<string>",
"type": "<string>",
"enabled": true,
"options": {}
}
],
"followUpStates": [
{
"id": 123,
"name": "<string>",
"isDefault": true,
"sequences": [
{
"order": 123,
"duration": 123,
"unit": "<string>"
}
],
"repeatFinal": true,
"extraPrompt": "<string>",
"order": 123
}
],
"availableSplitTestMetrics": [
{
"id": "<string>",
"label": "<string>",
"shortLabel": "<string>"
}
]
}{
"message": "<string>"
}{
"message": "<string>"
}Update a bot
Updates fields in a bot.
Only non-null fields are updated. Any missing or null field is ignored.
curl --request PUT \
--url https://api.closebot.com/bot/{id} \
--header 'Content-Type: application/json' \
--header 'X-CB-KEY: <api-key>' \
--data '
{
"favorite": true,
"trash": true,
"locked": true,
"rescheduling": true,
"name": "<string>",
"folderId": "<string>",
"category": "<string>",
"followUpActive": true,
"followUpSequences": [
{
"order": 123,
"duration": 123,
"unit": "<string>"
}
],
"smartFollowUp": true,
"followUpRepeat": true,
"followUpVarianceMinutes": 123,
"followUpExtraPrompt": "<string>",
"followUpStates": [
{
"name": "<string>",
"isDefault": true,
"sequences": [
{
"order": 123,
"duration": 123,
"unit": "<string>"
}
],
"repeatFinal": true,
"extraPrompt": "<string>",
"order": 123
}
],
"personaIds": [
"<string>"
],
"personaWeights": {},
"personaSplitTest": {
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"personas": [
{
"personaId": "<string>",
"weight": 123,
"order": 123,
"results": {
"personaId": "<string>",
"personaName": "<string>",
"splitWeight": 123,
"totalInstances": 123,
"responseCount": 123,
"averageMetric": 123,
"sources": [
{
"sourceId": "<string>",
"sourceName": "<string>",
"totalInstances": 123,
"responseCount": 123,
"averageMetric": 123
}
],
"computedAt": "2023-11-07T05:31:56Z"
}
}
],
"id": "<string>",
"isActive": true,
"metric": "<string>"
}
}
'import requests
url = "https://api.closebot.com/bot/{id}"
payload = {
"favorite": True,
"trash": True,
"locked": True,
"rescheduling": True,
"name": "<string>",
"folderId": "<string>",
"category": "<string>",
"followUpActive": True,
"followUpSequences": [
{
"order": 123,
"duration": 123,
"unit": "<string>"
}
],
"smartFollowUp": True,
"followUpRepeat": True,
"followUpVarianceMinutes": 123,
"followUpExtraPrompt": "<string>",
"followUpStates": [
{
"name": "<string>",
"isDefault": True,
"sequences": [
{
"order": 123,
"duration": 123,
"unit": "<string>"
}
],
"repeatFinal": True,
"extraPrompt": "<string>",
"order": 123
}
],
"personaIds": ["<string>"],
"personaWeights": {},
"personaSplitTest": {
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"personas": [
{
"personaId": "<string>",
"weight": 123,
"order": 123,
"results": {
"personaId": "<string>",
"personaName": "<string>",
"splitWeight": 123,
"totalInstances": 123,
"responseCount": 123,
"averageMetric": 123,
"sources": [
{
"sourceId": "<string>",
"sourceName": "<string>",
"totalInstances": 123,
"responseCount": 123,
"averageMetric": 123
}
],
"computedAt": "2023-11-07T05:31:56Z"
}
}
],
"id": "<string>",
"isActive": True,
"metric": "<string>"
}
}
headers = {
"X-CB-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-CB-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
favorite: true,
trash: true,
locked: true,
rescheduling: true,
name: '<string>',
folderId: '<string>',
category: '<string>',
followUpActive: true,
followUpSequences: [{order: 123, duration: 123, unit: '<string>'}],
smartFollowUp: true,
followUpRepeat: true,
followUpVarianceMinutes: 123,
followUpExtraPrompt: '<string>',
followUpStates: [
{
name: '<string>',
isDefault: true,
sequences: [{order: 123, duration: 123, unit: '<string>'}],
repeatFinal: true,
extraPrompt: '<string>',
order: 123
}
],
personaIds: ['<string>'],
personaWeights: {},
personaSplitTest: {
startedAt: '2023-11-07T05:31:56Z',
endedAt: '2023-11-07T05:31:56Z',
personas: [
{
personaId: '<string>',
weight: 123,
order: 123,
results: {
personaId: '<string>',
personaName: '<string>',
splitWeight: 123,
totalInstances: 123,
responseCount: 123,
averageMetric: 123,
sources: [
{
sourceId: '<string>',
sourceName: '<string>',
totalInstances: 123,
responseCount: 123,
averageMetric: 123
}
],
computedAt: '2023-11-07T05:31:56Z'
}
}
],
id: '<string>',
isActive: true,
metric: '<string>'
}
})
};
fetch('https://api.closebot.com/bot/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.closebot.com/bot/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'favorite' => true,
'trash' => true,
'locked' => true,
'rescheduling' => true,
'name' => '<string>',
'folderId' => '<string>',
'category' => '<string>',
'followUpActive' => true,
'followUpSequences' => [
[
'order' => 123,
'duration' => 123,
'unit' => '<string>'
]
],
'smartFollowUp' => true,
'followUpRepeat' => true,
'followUpVarianceMinutes' => 123,
'followUpExtraPrompt' => '<string>',
'followUpStates' => [
[
'name' => '<string>',
'isDefault' => true,
'sequences' => [
[
'order' => 123,
'duration' => 123,
'unit' => '<string>'
]
],
'repeatFinal' => true,
'extraPrompt' => '<string>',
'order' => 123
]
],
'personaIds' => [
'<string>'
],
'personaWeights' => [
],
'personaSplitTest' => [
'startedAt' => '2023-11-07T05:31:56Z',
'endedAt' => '2023-11-07T05:31:56Z',
'personas' => [
[
'personaId' => '<string>',
'weight' => 123,
'order' => 123,
'results' => [
'personaId' => '<string>',
'personaName' => '<string>',
'splitWeight' => 123,
'totalInstances' => 123,
'responseCount' => 123,
'averageMetric' => 123,
'sources' => [
[
'sourceId' => '<string>',
'sourceName' => '<string>',
'totalInstances' => 123,
'responseCount' => 123,
'averageMetric' => 123
]
],
'computedAt' => '2023-11-07T05:31:56Z'
]
]
],
'id' => '<string>',
'isActive' => true,
'metric' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CB-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.closebot.com/bot/{id}"
payload := strings.NewReader("{\n \"favorite\": true,\n \"trash\": true,\n \"locked\": true,\n \"rescheduling\": true,\n \"name\": \"<string>\",\n \"folderId\": \"<string>\",\n \"category\": \"<string>\",\n \"followUpActive\": true,\n \"followUpSequences\": [\n {\n \"order\": 123,\n \"duration\": 123,\n \"unit\": \"<string>\"\n }\n ],\n \"smartFollowUp\": true,\n \"followUpRepeat\": true,\n \"followUpVarianceMinutes\": 123,\n \"followUpExtraPrompt\": \"<string>\",\n \"followUpStates\": [\n {\n \"name\": \"<string>\",\n \"isDefault\": true,\n \"sequences\": [\n {\n \"order\": 123,\n \"duration\": 123,\n \"unit\": \"<string>\"\n }\n ],\n \"repeatFinal\": true,\n \"extraPrompt\": \"<string>\",\n \"order\": 123\n }\n ],\n \"personaIds\": [\n \"<string>\"\n ],\n \"personaWeights\": {},\n \"personaSplitTest\": {\n \"startedAt\": \"2023-11-07T05:31:56Z\",\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"personas\": [\n {\n \"personaId\": \"<string>\",\n \"weight\": 123,\n \"order\": 123,\n \"results\": {\n \"personaId\": \"<string>\",\n \"personaName\": \"<string>\",\n \"splitWeight\": 123,\n \"totalInstances\": 123,\n \"responseCount\": 123,\n \"averageMetric\": 123,\n \"sources\": [\n {\n \"sourceId\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"totalInstances\": 123,\n \"responseCount\": 123,\n \"averageMetric\": 123\n }\n ],\n \"computedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"isActive\": true,\n \"metric\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-CB-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.closebot.com/bot/{id}")
.header("X-CB-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"favorite\": true,\n \"trash\": true,\n \"locked\": true,\n \"rescheduling\": true,\n \"name\": \"<string>\",\n \"folderId\": \"<string>\",\n \"category\": \"<string>\",\n \"followUpActive\": true,\n \"followUpSequences\": [\n {\n \"order\": 123,\n \"duration\": 123,\n \"unit\": \"<string>\"\n }\n ],\n \"smartFollowUp\": true,\n \"followUpRepeat\": true,\n \"followUpVarianceMinutes\": 123,\n \"followUpExtraPrompt\": \"<string>\",\n \"followUpStates\": [\n {\n \"name\": \"<string>\",\n \"isDefault\": true,\n \"sequences\": [\n {\n \"order\": 123,\n \"duration\": 123,\n \"unit\": \"<string>\"\n }\n ],\n \"repeatFinal\": true,\n \"extraPrompt\": \"<string>\",\n \"order\": 123\n }\n ],\n \"personaIds\": [\n \"<string>\"\n ],\n \"personaWeights\": {},\n \"personaSplitTest\": {\n \"startedAt\": \"2023-11-07T05:31:56Z\",\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"personas\": [\n {\n \"personaId\": \"<string>\",\n \"weight\": 123,\n \"order\": 123,\n \"results\": {\n \"personaId\": \"<string>\",\n \"personaName\": \"<string>\",\n \"splitWeight\": 123,\n \"totalInstances\": 123,\n \"responseCount\": 123,\n \"averageMetric\": 123,\n \"sources\": [\n {\n \"sourceId\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"totalInstances\": 123,\n \"responseCount\": 123,\n \"averageMetric\": 123\n }\n ],\n \"computedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"isActive\": true,\n \"metric\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.closebot.com/bot/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-CB-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"favorite\": true,\n \"trash\": true,\n \"locked\": true,\n \"rescheduling\": true,\n \"name\": \"<string>\",\n \"folderId\": \"<string>\",\n \"category\": \"<string>\",\n \"followUpActive\": true,\n \"followUpSequences\": [\n {\n \"order\": 123,\n \"duration\": 123,\n \"unit\": \"<string>\"\n }\n ],\n \"smartFollowUp\": true,\n \"followUpRepeat\": true,\n \"followUpVarianceMinutes\": 123,\n \"followUpExtraPrompt\": \"<string>\",\n \"followUpStates\": [\n {\n \"name\": \"<string>\",\n \"isDefault\": true,\n \"sequences\": [\n {\n \"order\": 123,\n \"duration\": 123,\n \"unit\": \"<string>\"\n }\n ],\n \"repeatFinal\": true,\n \"extraPrompt\": \"<string>\",\n \"order\": 123\n }\n ],\n \"personaIds\": [\n \"<string>\"\n ],\n \"personaWeights\": {},\n \"personaSplitTest\": {\n \"startedAt\": \"2023-11-07T05:31:56Z\",\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"personas\": [\n {\n \"personaId\": \"<string>\",\n \"weight\": 123,\n \"order\": 123,\n \"results\": {\n \"personaId\": \"<string>\",\n \"personaName\": \"<string>\",\n \"splitWeight\": 123,\n \"totalInstances\": 123,\n \"responseCount\": 123,\n \"averageMetric\": 123,\n \"sources\": [\n {\n \"sourceId\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"totalInstances\": 123,\n \"responseCount\": 123,\n \"averageMetric\": 123\n }\n ],\n \"computedAt\": \"2023-11-07T05:31:56Z\"\n }\n }\n ],\n \"id\": \"<string>\",\n \"isActive\": true,\n \"metric\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"modifiedAt": "<string>",
"modifiedBy": "<string>",
"versions": [
{
"version": "<string>",
"name": "<string>",
"published": true,
"modifiedAt": "2023-11-07T05:31:56Z",
"modifiedBy": "<string>"
}
],
"sources": [
{
"id": "<string>",
"category": "<string>",
"key": "<string>",
"name": "<string>",
"tags": [
{
"name": "<string>",
"approveDeny": true,
"id": "<string>"
}
],
"tagFilterConfig": {
"operator": "<string>",
"groups": [
{
"operator": "<string>",
"rules": [
{
"tagName": "<string>",
"tagId": "<string>",
"condition": "<string>"
}
]
}
]
},
"channelList": [
"<string>"
],
"channelRules": {
"channels": [
{
"channel": "<string>",
"type": "<string>",
"rules": [
{
"operator": "<string>",
"value": "<string>"
}
]
}
]
},
"personaNameOverride": "<string>",
"enabled": true,
"flowVariableValues": {}
}
],
"personaIds": [
"<string>"
],
"personaWeights": {},
"favorited": true,
"locked": true,
"reschedulingEnabled": true,
"category": "<string>",
"folderId": "<string>",
"followUpActive": true,
"followUpSequences": [
{
"order": 123,
"duration": 123,
"unit": "<string>"
}
],
"smartFollowUp": true,
"followUpRepeat": true,
"followUpVarianceMinutes": 123,
"followUpExtraPrompt": "<string>",
"personaSplitTest": {
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"personas": [
{
"personaId": "<string>",
"weight": 123,
"order": 123,
"results": {
"personaId": "<string>",
"personaName": "<string>",
"splitWeight": 123,
"totalInstances": 123,
"responseCount": 123,
"averageMetric": 123,
"sources": [
{
"sourceId": "<string>",
"sourceName": "<string>",
"totalInstances": 123,
"responseCount": 123,
"averageMetric": 123
}
],
"computedAt": "2023-11-07T05:31:56Z"
}
}
],
"id": "<string>",
"isActive": true,
"metric": "<string>"
},
"tools": [
{
"id": "<string>",
"type": "<string>",
"enabled": true,
"options": {}
}
],
"followUpStates": [
{
"id": 123,
"name": "<string>",
"isDefault": true,
"sequences": [
{
"order": 123,
"duration": 123,
"unit": "<string>"
}
],
"repeatFinal": true,
"extraPrompt": "<string>",
"order": 123
}
],
"availableSplitTestMetrics": [
{
"id": "<string>",
"label": "<string>",
"shortLabel": "<string>"
}
]
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
CloseBot API Key Authorization
Path Parameters
The bot ID.
Body
Whether the bot is favorited
Whether the bot is trashed
Whether the bot is locked
Whether the bot has conversation rescheduling enabled
The name of the bot
The folder ID of the bot
The category of the bot
Whether the bot does follow-ups
The follow-up sequences of the bot
Show child attributes
Show child attributes
Whether the bot does smart follow-ups
Whether the bot repeats the last follow-up sequence
The variance minutes for the follow-ups
The extra prompt for the follow-ups
The follow-up states (multi-cadence) for the bot
Show child attributes
Show child attributes
The bot's default persona. Split-test personas are configured separately.
Legacy default persona weight input. Defaults are always saved as 100%.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
OK
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes

