Start preview chat
curl --request POST \
--url https://release0.com/api/v1/agents/{agentId}/preview/start \
--header 'Content-Type: application/json' \
--data '
{
"isStreamEnabled": false,
"message": {
"type": "text",
"text": "<string>",
"attachedFileUrls": [
"<string>"
]
},
"isOnlyRegistering": false,
"agent": "<unknown>",
"startFrom": {
"type": "group",
"groupId": "<string>"
},
"initialContext": {
"First name": "John",
"Email": "john@gmail.com"
},
"sessionId": "<string>",
"password": "<string>",
"textBubbleContentFormat": "richText"
}
'import requests
url = "https://release0.com/api/v1/agents/{agentId}/preview/start"
payload = {
"isStreamEnabled": False,
"message": {
"type": "text",
"text": "<string>",
"attachedFileUrls": ["<string>"]
},
"isOnlyRegistering": False,
"agent": "<unknown>",
"startFrom": {
"type": "group",
"groupId": "<string>"
},
"initialContext": {
"First name": "John",
"Email": "john@gmail.com"
},
"sessionId": "<string>",
"password": "<string>",
"textBubbleContentFormat": "richText"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
isStreamEnabled: false,
message: {type: 'text', text: '<string>', attachedFileUrls: ['<string>']},
isOnlyRegistering: false,
agent: '<unknown>',
startFrom: {type: 'group', groupId: '<string>'},
initialContext: {'First name': 'John', Email: 'john@gmail.com'},
sessionId: '<string>',
password: '<string>',
textBubbleContentFormat: 'richText'
})
};
fetch('https://release0.com/api/v1/agents/{agentId}/preview/start', 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://release0.com/api/v1/agents/{agentId}/preview/start",
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([
'isStreamEnabled' => false,
'message' => [
'type' => 'text',
'text' => '<string>',
'attachedFileUrls' => [
'<string>'
]
],
'isOnlyRegistering' => false,
'agent' => '<unknown>',
'startFrom' => [
'type' => 'group',
'groupId' => '<string>'
],
'initialContext' => [
'First name' => 'John',
'Email' => 'john@gmail.com'
],
'sessionId' => '<string>',
'password' => '<string>',
'textBubbleContentFormat' => 'richText'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://release0.com/api/v1/agents/{agentId}/preview/start"
payload := strings.NewReader("{\n \"isStreamEnabled\": false,\n \"message\": {\n \"type\": \"text\",\n \"text\": \"<string>\",\n \"attachedFileUrls\": [\n \"<string>\"\n ]\n },\n \"isOnlyRegistering\": false,\n \"agent\": \"<unknown>\",\n \"startFrom\": {\n \"type\": \"group\",\n \"groupId\": \"<string>\"\n },\n \"initialContext\": {\n \"First name\": \"John\",\n \"Email\": \"john@gmail.com\"\n },\n \"sessionId\": \"<string>\",\n \"password\": \"<string>\",\n \"textBubbleContentFormat\": \"richText\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://release0.com/api/v1/agents/{agentId}/preview/start")
.header("Content-Type", "application/json")
.body("{\n \"isStreamEnabled\": false,\n \"message\": {\n \"type\": \"text\",\n \"text\": \"<string>\",\n \"attachedFileUrls\": [\n \"<string>\"\n ]\n },\n \"isOnlyRegistering\": false,\n \"agent\": \"<unknown>\",\n \"startFrom\": {\n \"type\": \"group\",\n \"groupId\": \"<string>\"\n },\n \"initialContext\": {\n \"First name\": \"John\",\n \"Email\": \"john@gmail.com\"\n },\n \"sessionId\": \"<string>\",\n \"password\": \"<string>\",\n \"textBubbleContentFormat\": \"richText\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://release0.com/api/v1/agents/{agentId}/preview/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"isStreamEnabled\": false,\n \"message\": {\n \"type\": \"text\",\n \"text\": \"<string>\",\n \"attachedFileUrls\": [\n \"<string>\"\n ]\n },\n \"isOnlyRegistering\": false,\n \"agent\": \"<unknown>\",\n \"startFrom\": {\n \"type\": \"group\",\n \"groupId\": \"<string>\"\n },\n \"initialContext\": {\n \"First name\": \"John\",\n \"Email\": \"john@gmail.com\"\n },\n \"sessionId\": \"<string>\",\n \"password\": \"<string>\",\n \"textBubbleContentFormat\": \"richText\"\n}"
response = http.request(request)
puts response.read_body{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Start preview chat
API endpoint to start a preview chat session with an unpublished agent for testing purposes.
POST
/
v1
/
agents
/
{agentId}
/
preview
/
start
Start preview chat
curl --request POST \
--url https://release0.com/api/v1/agents/{agentId}/preview/start \
--header 'Content-Type: application/json' \
--data '
{
"isStreamEnabled": false,
"message": {
"type": "text",
"text": "<string>",
"attachedFileUrls": [
"<string>"
]
},
"isOnlyRegistering": false,
"agent": "<unknown>",
"startFrom": {
"type": "group",
"groupId": "<string>"
},
"initialContext": {
"First name": "John",
"Email": "john@gmail.com"
},
"sessionId": "<string>",
"password": "<string>",
"textBubbleContentFormat": "richText"
}
'import requests
url = "https://release0.com/api/v1/agents/{agentId}/preview/start"
payload = {
"isStreamEnabled": False,
"message": {
"type": "text",
"text": "<string>",
"attachedFileUrls": ["<string>"]
},
"isOnlyRegistering": False,
"agent": "<unknown>",
"startFrom": {
"type": "group",
"groupId": "<string>"
},
"initialContext": {
"First name": "John",
"Email": "john@gmail.com"
},
"sessionId": "<string>",
"password": "<string>",
"textBubbleContentFormat": "richText"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
isStreamEnabled: false,
message: {type: 'text', text: '<string>', attachedFileUrls: ['<string>']},
isOnlyRegistering: false,
agent: '<unknown>',
startFrom: {type: 'group', groupId: '<string>'},
initialContext: {'First name': 'John', Email: 'john@gmail.com'},
sessionId: '<string>',
password: '<string>',
textBubbleContentFormat: 'richText'
})
};
fetch('https://release0.com/api/v1/agents/{agentId}/preview/start', 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://release0.com/api/v1/agents/{agentId}/preview/start",
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([
'isStreamEnabled' => false,
'message' => [
'type' => 'text',
'text' => '<string>',
'attachedFileUrls' => [
'<string>'
]
],
'isOnlyRegistering' => false,
'agent' => '<unknown>',
'startFrom' => [
'type' => 'group',
'groupId' => '<string>'
],
'initialContext' => [
'First name' => 'John',
'Email' => 'john@gmail.com'
],
'sessionId' => '<string>',
'password' => '<string>',
'textBubbleContentFormat' => 'richText'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://release0.com/api/v1/agents/{agentId}/preview/start"
payload := strings.NewReader("{\n \"isStreamEnabled\": false,\n \"message\": {\n \"type\": \"text\",\n \"text\": \"<string>\",\n \"attachedFileUrls\": [\n \"<string>\"\n ]\n },\n \"isOnlyRegistering\": false,\n \"agent\": \"<unknown>\",\n \"startFrom\": {\n \"type\": \"group\",\n \"groupId\": \"<string>\"\n },\n \"initialContext\": {\n \"First name\": \"John\",\n \"Email\": \"john@gmail.com\"\n },\n \"sessionId\": \"<string>\",\n \"password\": \"<string>\",\n \"textBubbleContentFormat\": \"richText\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://release0.com/api/v1/agents/{agentId}/preview/start")
.header("Content-Type", "application/json")
.body("{\n \"isStreamEnabled\": false,\n \"message\": {\n \"type\": \"text\",\n \"text\": \"<string>\",\n \"attachedFileUrls\": [\n \"<string>\"\n ]\n },\n \"isOnlyRegistering\": false,\n \"agent\": \"<unknown>\",\n \"startFrom\": {\n \"type\": \"group\",\n \"groupId\": \"<string>\"\n },\n \"initialContext\": {\n \"First name\": \"John\",\n \"Email\": \"john@gmail.com\"\n },\n \"sessionId\": \"<string>\",\n \"password\": \"<string>\",\n \"textBubbleContentFormat\": \"richText\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://release0.com/api/v1/agents/{agentId}/preview/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"isStreamEnabled\": false,\n \"message\": {\n \"type\": \"text\",\n \"text\": \"<string>\",\n \"attachedFileUrls\": [\n \"<string>\"\n ]\n },\n \"isOnlyRegistering\": false,\n \"agent\": \"<unknown>\",\n \"startFrom\": {\n \"type\": \"group\",\n \"groupId\": \"<string>\"\n },\n \"initialContext\": {\n \"First name\": \"John\",\n \"Email\": \"john@gmail.com\"\n },\n \"sessionId\": \"<string>\",\n \"password\": \"<string>\",\n \"textBubbleContentFormat\": \"richText\"\n}"
response = http.request(request)
puts response.read_body{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Path Parameters
Identifier of the agent.
Body
application/json
- Text
- Audio
Show child attributes
Show child attributes
If set to true, the session will only be registered and the bot will not be started.
If provided, overrides the agent used to start the chat.
- Option 1
- Option 2
Show child attributes
Show child attributes
Initial context used to prefill variables when starting the session.
Show child attributes
Show child attributes
Example:
{
"First name": "John",
"Email": "john@gmail.com"
}
If provided, it will be used as the session identifier and will overwrite any existing session with the same ID.
Password required if the agent was created with password protection.
Available options:
richText, markdown Response
Successful response