curl --request POST \
--url https://api.botpress.cloud/v1/admin/bots \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"states": {},
"events": {},
"recurringEvents": {},
"actions": {},
"configuration": {
"data": {},
"schema": {}
},
"user": {
"tags": {}
},
"conversation": {
"tags": {}
},
"message": {
"tags": {}
},
"tags": {},
"code": "<string>",
"name": "<string>",
"description": "<string>",
"medias": [
{
"url": "<string>",
"name": "<string>"
}
],
"url": "<string>",
"secrets": {},
"dev": true
}
'import requests
url = "https://api.botpress.cloud/v1/admin/bots"
payload = {
"states": {},
"events": {},
"recurringEvents": {},
"actions": {},
"configuration": {
"data": {},
"schema": {}
},
"user": { "tags": {} },
"conversation": { "tags": {} },
"message": { "tags": {} },
"tags": {},
"code": "<string>",
"name": "<string>",
"description": "<string>",
"medias": [
{
"url": "<string>",
"name": "<string>"
}
],
"url": "<string>",
"secrets": {},
"dev": True
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-workspace-id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
states: {},
events: {},
recurringEvents: {},
actions: {},
configuration: {data: {}, schema: {}},
user: {tags: {}},
conversation: {tags: {}},
message: {tags: {}},
tags: {},
code: '<string>',
name: '<string>',
description: '<string>',
medias: [{url: '<string>', name: '<string>'}],
url: '<string>',
secrets: {},
dev: true
})
};
fetch('https://api.botpress.cloud/v1/admin/bots', 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.botpress.cloud/v1/admin/bots",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'states' => [
],
'events' => [
],
'recurringEvents' => [
],
'actions' => [
],
'configuration' => [
'data' => [
],
'schema' => [
]
],
'user' => [
'tags' => [
]
],
'conversation' => [
'tags' => [
]
],
'message' => [
'tags' => [
]
],
'tags' => [
],
'code' => '<string>',
'name' => '<string>',
'description' => '<string>',
'medias' => [
[
'url' => '<string>',
'name' => '<string>'
]
],
'url' => '<string>',
'secrets' => [
],
'dev' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-workspace-id: <x-workspace-id>"
],
]);
$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.botpress.cloud/v1/admin/bots"
payload := strings.NewReader("{\n \"states\": {},\n \"events\": {},\n \"recurringEvents\": {},\n \"actions\": {},\n \"configuration\": {\n \"data\": {},\n \"schema\": {}\n },\n \"user\": {\n \"tags\": {}\n },\n \"conversation\": {\n \"tags\": {}\n },\n \"message\": {\n \"tags\": {}\n },\n \"tags\": {},\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"medias\": [\n {\n \"url\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"url\": \"<string>\",\n \"secrets\": {},\n \"dev\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.botpress.cloud/v1/admin/bots")
.header("x-workspace-id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"states\": {},\n \"events\": {},\n \"recurringEvents\": {},\n \"actions\": {},\n \"configuration\": {\n \"data\": {},\n \"schema\": {}\n },\n \"user\": {\n \"tags\": {}\n },\n \"conversation\": {\n \"tags\": {}\n },\n \"message\": {\n \"tags\": {}\n },\n \"tags\": {},\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"medias\": [\n {\n \"url\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"url\": \"<string>\",\n \"secrets\": {},\n \"dev\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.botpress.cloud/v1/admin/bots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"states\": {},\n \"events\": {},\n \"recurringEvents\": {},\n \"actions\": {},\n \"configuration\": {\n \"data\": {},\n \"schema\": {}\n },\n \"user\": {\n \"tags\": {}\n },\n \"conversation\": {\n \"tags\": {}\n },\n \"message\": {\n \"tags\": {}\n },\n \"tags\": {},\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"medias\": [\n {\n \"url\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"url\": \"<string>\",\n \"secrets\": {},\n \"dev\": true\n}"
response = http.request(request)
puts response.read_body{
"bot": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"signingSecret": "<string>",
"integrations": {},
"plugins": {},
"user": {
"tags": {}
},
"conversation": {
"tags": {}
},
"message": {
"tags": {}
},
"states": {},
"configuration": {
"data": {},
"schema": {}
},
"events": {},
"recurringEvents": {},
"subscriptions": {
"events": {}
},
"actions": {},
"tags": {},
"name": "<string>",
"dev": true,
"secrets": [
"<string>"
],
"alwaysAlive": true,
"medias": [
{
"url": "<string>",
"name": "<string>"
}
],
"maxExecutionTime": 123,
"description": "<string>",
"deployedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>"
}
}{
"bot": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"signingSecret": "<string>",
"integrations": {},
"plugins": {},
"user": {
"tags": {}
},
"conversation": {
"tags": {}
},
"message": {
"tags": {}
},
"states": {},
"configuration": {
"data": {},
"schema": {}
},
"events": {},
"recurringEvents": {},
"subscriptions": {
"events": {}
},
"actions": {},
"tags": {},
"name": "<string>",
"dev": true,
"secrets": [
"<string>"
],
"alwaysAlive": true,
"medias": [
{
"url": "<string>",
"name": "<string>"
}
],
"maxExecutionTime": 123,
"description": "<string>",
"deployedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>"
}
}Create bot
curl --request POST \
--url https://api.botpress.cloud/v1/admin/bots \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"states": {},
"events": {},
"recurringEvents": {},
"actions": {},
"configuration": {
"data": {},
"schema": {}
},
"user": {
"tags": {}
},
"conversation": {
"tags": {}
},
"message": {
"tags": {}
},
"tags": {},
"code": "<string>",
"name": "<string>",
"description": "<string>",
"medias": [
{
"url": "<string>",
"name": "<string>"
}
],
"url": "<string>",
"secrets": {},
"dev": true
}
'import requests
url = "https://api.botpress.cloud/v1/admin/bots"
payload = {
"states": {},
"events": {},
"recurringEvents": {},
"actions": {},
"configuration": {
"data": {},
"schema": {}
},
"user": { "tags": {} },
"conversation": { "tags": {} },
"message": { "tags": {} },
"tags": {},
"code": "<string>",
"name": "<string>",
"description": "<string>",
"medias": [
{
"url": "<string>",
"name": "<string>"
}
],
"url": "<string>",
"secrets": {},
"dev": True
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-workspace-id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
states: {},
events: {},
recurringEvents: {},
actions: {},
configuration: {data: {}, schema: {}},
user: {tags: {}},
conversation: {tags: {}},
message: {tags: {}},
tags: {},
code: '<string>',
name: '<string>',
description: '<string>',
medias: [{url: '<string>', name: '<string>'}],
url: '<string>',
secrets: {},
dev: true
})
};
fetch('https://api.botpress.cloud/v1/admin/bots', 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.botpress.cloud/v1/admin/bots",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'states' => [
],
'events' => [
],
'recurringEvents' => [
],
'actions' => [
],
'configuration' => [
'data' => [
],
'schema' => [
]
],
'user' => [
'tags' => [
]
],
'conversation' => [
'tags' => [
]
],
'message' => [
'tags' => [
]
],
'tags' => [
],
'code' => '<string>',
'name' => '<string>',
'description' => '<string>',
'medias' => [
[
'url' => '<string>',
'name' => '<string>'
]
],
'url' => '<string>',
'secrets' => [
],
'dev' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-workspace-id: <x-workspace-id>"
],
]);
$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.botpress.cloud/v1/admin/bots"
payload := strings.NewReader("{\n \"states\": {},\n \"events\": {},\n \"recurringEvents\": {},\n \"actions\": {},\n \"configuration\": {\n \"data\": {},\n \"schema\": {}\n },\n \"user\": {\n \"tags\": {}\n },\n \"conversation\": {\n \"tags\": {}\n },\n \"message\": {\n \"tags\": {}\n },\n \"tags\": {},\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"medias\": [\n {\n \"url\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"url\": \"<string>\",\n \"secrets\": {},\n \"dev\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.botpress.cloud/v1/admin/bots")
.header("x-workspace-id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"states\": {},\n \"events\": {},\n \"recurringEvents\": {},\n \"actions\": {},\n \"configuration\": {\n \"data\": {},\n \"schema\": {}\n },\n \"user\": {\n \"tags\": {}\n },\n \"conversation\": {\n \"tags\": {}\n },\n \"message\": {\n \"tags\": {}\n },\n \"tags\": {},\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"medias\": [\n {\n \"url\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"url\": \"<string>\",\n \"secrets\": {},\n \"dev\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.botpress.cloud/v1/admin/bots")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"states\": {},\n \"events\": {},\n \"recurringEvents\": {},\n \"actions\": {},\n \"configuration\": {\n \"data\": {},\n \"schema\": {}\n },\n \"user\": {\n \"tags\": {}\n },\n \"conversation\": {\n \"tags\": {}\n },\n \"message\": {\n \"tags\": {}\n },\n \"tags\": {},\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"medias\": [\n {\n \"url\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"url\": \"<string>\",\n \"secrets\": {},\n \"dev\": true\n}"
response = http.request(request)
puts response.read_body{
"bot": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"signingSecret": "<string>",
"integrations": {},
"plugins": {},
"user": {
"tags": {}
},
"conversation": {
"tags": {}
},
"message": {
"tags": {}
},
"states": {},
"configuration": {
"data": {},
"schema": {}
},
"events": {},
"recurringEvents": {},
"subscriptions": {
"events": {}
},
"actions": {},
"tags": {},
"name": "<string>",
"dev": true,
"secrets": [
"<string>"
],
"alwaysAlive": true,
"medias": [
{
"url": "<string>",
"name": "<string>"
}
],
"maxExecutionTime": 123,
"description": "<string>",
"deployedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>"
}
}{
"bot": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"signingSecret": "<string>",
"integrations": {},
"plugins": {},
"user": {
"tags": {}
},
"conversation": {
"tags": {}
},
"message": {
"tags": {}
},
"states": {},
"configuration": {
"data": {},
"schema": {}
},
"events": {},
"recurringEvents": {},
"subscriptions": {
"events": {}
},
"actions": {},
"tags": {},
"name": "<string>",
"dev": true,
"secrets": [
"<string>"
],
"alwaysAlive": true,
"medias": [
{
"url": "<string>",
"name": "<string>"
}
],
"maxExecutionTime": 123,
"description": "<string>",
"deployedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Workspace ID
Whether the client supports bots with multiple instances of the same integration. Set to "true" to receive integration instances keyed by their alias instead of their id. This header will be removed in the future, and the API will always return multiple instances keyed by alias.
Body
Bot metadata
A mapping of states to their definition
Show child attributes
Show child attributes
Events definition
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Subscriptions of the bot
Show child attributes
Show child attributes
Actions definition
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
JavaScript code of the bot
Optional name for the bot, if not provided will be auto-generated
1Optional description for the bot
2000Secrets are values available in the code via environment variables formatted with a SECRET_ prefix followed by your secret name. A secret name must respect SCREAMING_SNAKE casing.
Show child attributes
Show child attributes
Response
Success
Show child attributes
Show child attributes
Was this page helpful?