curl --request POST \
--url https://your-instance.example.com/api/ai/calendar-playground \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "Can we book me in for Tuesday at 2pm?",
"promptOverride": "<calendarAgent>You are a scheduling assistant. Ask clarifying questions and confirm before booking.</calendarAgent>",
"conversation": [
{
"role": "user",
"content": "I would like to schedule a tour."
},
{
"role": "assistant",
"content": "Sure — which day works for you?"
}
]
}
'import requests
url = "https://your-instance.example.com/api/ai/calendar-playground"
payload = {
"message": "Can we book me in for Tuesday at 2pm?",
"promptOverride": "<calendarAgent>You are a scheduling assistant. Ask clarifying questions and confirm before booking.</calendarAgent>",
"conversation": [
{
"role": "user",
"content": "I would like to schedule a tour."
},
{
"role": "assistant",
"content": "Sure — which day works for you?"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: 'Can we book me in for Tuesday at 2pm?',
promptOverride: '<calendarAgent>You are a scheduling assistant. Ask clarifying questions and confirm before booking.</calendarAgent>',
conversation: [
{role: 'user', content: 'I would like to schedule a tour.'},
{role: 'assistant', content: 'Sure — which day works for you?'}
]
})
};
fetch('https://your-instance.example.com/api/ai/calendar-playground', 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://your-instance.example.com/api/ai/calendar-playground",
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([
'message' => 'Can we book me in for Tuesday at 2pm?',
'promptOverride' => '<calendarAgent>You are a scheduling assistant. Ask clarifying questions and confirm before booking.</calendarAgent>',
'conversation' => [
[
'role' => 'user',
'content' => 'I would like to schedule a tour.'
],
[
'role' => 'assistant',
'content' => 'Sure — which day works for you?'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://your-instance.example.com/api/ai/calendar-playground"
payload := strings.NewReader("{\n \"message\": \"Can we book me in for Tuesday at 2pm?\",\n \"promptOverride\": \"<calendarAgent>You are a scheduling assistant. Ask clarifying questions and confirm before booking.</calendarAgent>\",\n \"conversation\": [\n {\n \"role\": \"user\",\n \"content\": \"I would like to schedule a tour.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Sure — which day works for you?\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://your-instance.example.com/api/ai/calendar-playground")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Can we book me in for Tuesday at 2pm?\",\n \"promptOverride\": \"<calendarAgent>You are a scheduling assistant. Ask clarifying questions and confirm before booking.</calendarAgent>\",\n \"conversation\": [\n {\n \"role\": \"user\",\n \"content\": \"I would like to schedule a tour.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Sure — which day works for you?\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/ai/calendar-playground")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"Can we book me in for Tuesday at 2pm?\",\n \"promptOverride\": \"<calendarAgent>You are a scheduling assistant. Ask clarifying questions and confirm before booking.</calendarAgent>\",\n \"conversation\": [\n {\n \"role\": \"user\",\n \"content\": \"I would like to schedule a tour.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Sure — which day works for you?\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"response": "Great — I can book you for Friday at 2pm. Want me to send a confirmation text?",
"messageMetric": {
"organizationId": "64a1b2c3d4e5f60012345678",
"metricRunId": "run_64d2f9c5e8a1d4e001a0b1c2",
"aiAgentName": "Leasing Specialist",
"aiCalls": [],
"toolCalls": []
}
}{
"success": false,
"error": "approval_expired",
"message": "This approval request has expired or was already handled. Please send a new playground message to retry."
}{
"success": false,
"error": "approval_expired",
"message": "This approval request has expired or was already handled. Please send a new playground message to retry."
}{
"success": false,
"error": "approval_expired",
"message": "This approval request has expired or was already handled. Please send a new playground message to retry."
}{
"success": false,
"error": "approval_expired",
"message": "This approval request has expired or was already handled. Please send a new playground message to retry."
}Generate calendar agent playground response
Runs a one-off calendar-agent turn for the prompt editor. No promptId is required; the caller supplies the calendar instructions directly via promptOverride. Calendar tools are injected when the ENABLE_CALENDAR_TOOLS feature flag is enabled, so schedulers can exercise booking flows without a live conversation.
curl --request POST \
--url https://your-instance.example.com/api/ai/calendar-playground \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "Can we book me in for Tuesday at 2pm?",
"promptOverride": "<calendarAgent>You are a scheduling assistant. Ask clarifying questions and confirm before booking.</calendarAgent>",
"conversation": [
{
"role": "user",
"content": "I would like to schedule a tour."
},
{
"role": "assistant",
"content": "Sure — which day works for you?"
}
]
}
'import requests
url = "https://your-instance.example.com/api/ai/calendar-playground"
payload = {
"message": "Can we book me in for Tuesday at 2pm?",
"promptOverride": "<calendarAgent>You are a scheduling assistant. Ask clarifying questions and confirm before booking.</calendarAgent>",
"conversation": [
{
"role": "user",
"content": "I would like to schedule a tour."
},
{
"role": "assistant",
"content": "Sure — which day works for you?"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: 'Can we book me in for Tuesday at 2pm?',
promptOverride: '<calendarAgent>You are a scheduling assistant. Ask clarifying questions and confirm before booking.</calendarAgent>',
conversation: [
{role: 'user', content: 'I would like to schedule a tour.'},
{role: 'assistant', content: 'Sure — which day works for you?'}
]
})
};
fetch('https://your-instance.example.com/api/ai/calendar-playground', 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://your-instance.example.com/api/ai/calendar-playground",
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([
'message' => 'Can we book me in for Tuesday at 2pm?',
'promptOverride' => '<calendarAgent>You are a scheduling assistant. Ask clarifying questions and confirm before booking.</calendarAgent>',
'conversation' => [
[
'role' => 'user',
'content' => 'I would like to schedule a tour.'
],
[
'role' => 'assistant',
'content' => 'Sure — which day works for you?'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://your-instance.example.com/api/ai/calendar-playground"
payload := strings.NewReader("{\n \"message\": \"Can we book me in for Tuesday at 2pm?\",\n \"promptOverride\": \"<calendarAgent>You are a scheduling assistant. Ask clarifying questions and confirm before booking.</calendarAgent>\",\n \"conversation\": [\n {\n \"role\": \"user\",\n \"content\": \"I would like to schedule a tour.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Sure — which day works for you?\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://your-instance.example.com/api/ai/calendar-playground")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Can we book me in for Tuesday at 2pm?\",\n \"promptOverride\": \"<calendarAgent>You are a scheduling assistant. Ask clarifying questions and confirm before booking.</calendarAgent>\",\n \"conversation\": [\n {\n \"role\": \"user\",\n \"content\": \"I would like to schedule a tour.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Sure — which day works for you?\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/ai/calendar-playground")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"Can we book me in for Tuesday at 2pm?\",\n \"promptOverride\": \"<calendarAgent>You are a scheduling assistant. Ask clarifying questions and confirm before booking.</calendarAgent>\",\n \"conversation\": [\n {\n \"role\": \"user\",\n \"content\": \"I would like to schedule a tour.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"Sure — which day works for you?\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"response": "Great — I can book you for Friday at 2pm. Want me to send a confirmation text?",
"messageMetric": {
"organizationId": "64a1b2c3d4e5f60012345678",
"metricRunId": "run_64d2f9c5e8a1d4e001a0b1c2",
"aiAgentName": "Leasing Specialist",
"aiCalls": [],
"toolCalls": []
}
}{
"success": false,
"error": "approval_expired",
"message": "This approval request has expired or was already handled. Please send a new playground message to retry."
}{
"success": false,
"error": "approval_expired",
"message": "This approval request has expired or was already handled. Please send a new playground message to retry."
}{
"success": false,
"error": "approval_expired",
"message": "This approval request has expired or was already handled. Please send a new playground message to retry."
}{
"success": false,
"error": "approval_expired",
"message": "This approval request has expired or was already handled. Please send a new playground message to retry."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Response
Calendar playground response generated
Playground turn result. approvalCards is only set when the agent paused for tool approval; messageMetric is only set for ADMIN/SUPERADMIN.
true Show child attributes
Show child attributes
MessageMetric snapshot captured for the playground turn — only included for ADMIN/SUPERADMIN callers. Surfaces underlying AI calls and tool calls for debugging.
Show child attributes
Show child attributes
{
"organizationId": "64a1b2c3d4e5f60012345678",
"metricRunId": "run_64d2f9c5e8a1d4e001a0b1c2",
"aiAgentName": "Leasing Specialist",
"aiCalls": [
{
"provider": "anthropic",
"model": "claude-sonnet-4-6",
"inputTokens": 412,
"outputTokens": 88,
"durationMs": 1742
}
],
"toolCalls": [
{
"name": "getContact",
"args": { "phone": "+14165550100" },
"durationMs": 84
}
]
}