curl --request POST \
--url https://your-instance.example.com/api/ai/playground/approval/respond \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"approvalKey": "playground:5f7b1c2e8a1d4e0012c3b4a5:tool-call-7c2a",
"decision": "approve",
"conversation": [
{
"role": "user",
"content": "Please book me for Tuesday at 2pm."
},
{
"role": "assistant",
"content": "I will go ahead and request that slot."
}
],
"promptId": "5f7b1c2e8a1d4e0012c3b4a5",
"conversationId": "64d2f9c5e8a1d4e001a0b1c2",
"modelOverride": {
"provider": "anthropic",
"model": "claude-sonnet-4-6"
}
}
'import requests
url = "https://your-instance.example.com/api/ai/playground/approval/respond"
payload = {
"approvalKey": "playground:5f7b1c2e8a1d4e0012c3b4a5:tool-call-7c2a",
"decision": "approve",
"conversation": [
{
"role": "user",
"content": "Please book me for Tuesday at 2pm."
},
{
"role": "assistant",
"content": "I will go ahead and request that slot."
}
],
"promptId": "5f7b1c2e8a1d4e0012c3b4a5",
"conversationId": "64d2f9c5e8a1d4e001a0b1c2",
"modelOverride": {
"provider": "anthropic",
"model": "claude-sonnet-4-6"
}
}
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({
approvalKey: 'playground:5f7b1c2e8a1d4e0012c3b4a5:tool-call-7c2a',
decision: 'approve',
conversation: [
{role: 'user', content: 'Please book me for Tuesday at 2pm.'},
{role: 'assistant', content: 'I will go ahead and request that slot.'}
],
promptId: '5f7b1c2e8a1d4e0012c3b4a5',
conversationId: '64d2f9c5e8a1d4e001a0b1c2',
modelOverride: {provider: 'anthropic', model: 'claude-sonnet-4-6'}
})
};
fetch('https://your-instance.example.com/api/ai/playground/approval/respond', 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/playground/approval/respond",
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([
'approvalKey' => 'playground:5f7b1c2e8a1d4e0012c3b4a5:tool-call-7c2a',
'decision' => 'approve',
'conversation' => [
[
'role' => 'user',
'content' => 'Please book me for Tuesday at 2pm.'
],
[
'role' => 'assistant',
'content' => 'I will go ahead and request that slot.'
]
],
'promptId' => '5f7b1c2e8a1d4e0012c3b4a5',
'conversationId' => '64d2f9c5e8a1d4e001a0b1c2',
'modelOverride' => [
'provider' => 'anthropic',
'model' => 'claude-sonnet-4-6'
]
]),
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/playground/approval/respond"
payload := strings.NewReader("{\n \"approvalKey\": \"playground:5f7b1c2e8a1d4e0012c3b4a5:tool-call-7c2a\",\n \"decision\": \"approve\",\n \"conversation\": [\n {\n \"role\": \"user\",\n \"content\": \"Please book me for Tuesday at 2pm.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"I will go ahead and request that slot.\"\n }\n ],\n \"promptId\": \"5f7b1c2e8a1d4e0012c3b4a5\",\n \"conversationId\": \"64d2f9c5e8a1d4e001a0b1c2\",\n \"modelOverride\": {\n \"provider\": \"anthropic\",\n \"model\": \"claude-sonnet-4-6\"\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/playground/approval/respond")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"approvalKey\": \"playground:5f7b1c2e8a1d4e0012c3b4a5:tool-call-7c2a\",\n \"decision\": \"approve\",\n \"conversation\": [\n {\n \"role\": \"user\",\n \"content\": \"Please book me for Tuesday at 2pm.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"I will go ahead and request that slot.\"\n }\n ],\n \"promptId\": \"5f7b1c2e8a1d4e0012c3b4a5\",\n \"conversationId\": \"64d2f9c5e8a1d4e001a0b1c2\",\n \"modelOverride\": {\n \"provider\": \"anthropic\",\n \"model\": \"claude-sonnet-4-6\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/ai/playground/approval/respond")
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 \"approvalKey\": \"playground:5f7b1c2e8a1d4e0012c3b4a5:tool-call-7c2a\",\n \"decision\": \"approve\",\n \"conversation\": [\n {\n \"role\": \"user\",\n \"content\": \"Please book me for Tuesday at 2pm.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"I will go ahead and request that slot.\"\n }\n ],\n \"promptId\": \"5f7b1c2e8a1d4e0012c3b4a5\",\n \"conversationId\": \"64d2f9c5e8a1d4e001a0b1c2\",\n \"modelOverride\": {\n \"provider\": \"anthropic\",\n \"model\": \"claude-sonnet-4-6\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"decision": "approve",
"response": "Sent! I just texted Alex the confirmation."
}{
"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."
}{
"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."
}Respond to a playground tool approval card
Resolves a playground approval card by approving or rejecting it. Approving executes the requested tool with the originally captured arguments and resumes the playground turn; rejecting stashes a rejection sentinel so the agent acknowledges and moves on. Returns the resumed AI response and any new approval cards.
curl --request POST \
--url https://your-instance.example.com/api/ai/playground/approval/respond \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"approvalKey": "playground:5f7b1c2e8a1d4e0012c3b4a5:tool-call-7c2a",
"decision": "approve",
"conversation": [
{
"role": "user",
"content": "Please book me for Tuesday at 2pm."
},
{
"role": "assistant",
"content": "I will go ahead and request that slot."
}
],
"promptId": "5f7b1c2e8a1d4e0012c3b4a5",
"conversationId": "64d2f9c5e8a1d4e001a0b1c2",
"modelOverride": {
"provider": "anthropic",
"model": "claude-sonnet-4-6"
}
}
'import requests
url = "https://your-instance.example.com/api/ai/playground/approval/respond"
payload = {
"approvalKey": "playground:5f7b1c2e8a1d4e0012c3b4a5:tool-call-7c2a",
"decision": "approve",
"conversation": [
{
"role": "user",
"content": "Please book me for Tuesday at 2pm."
},
{
"role": "assistant",
"content": "I will go ahead and request that slot."
}
],
"promptId": "5f7b1c2e8a1d4e0012c3b4a5",
"conversationId": "64d2f9c5e8a1d4e001a0b1c2",
"modelOverride": {
"provider": "anthropic",
"model": "claude-sonnet-4-6"
}
}
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({
approvalKey: 'playground:5f7b1c2e8a1d4e0012c3b4a5:tool-call-7c2a',
decision: 'approve',
conversation: [
{role: 'user', content: 'Please book me for Tuesday at 2pm.'},
{role: 'assistant', content: 'I will go ahead and request that slot.'}
],
promptId: '5f7b1c2e8a1d4e0012c3b4a5',
conversationId: '64d2f9c5e8a1d4e001a0b1c2',
modelOverride: {provider: 'anthropic', model: 'claude-sonnet-4-6'}
})
};
fetch('https://your-instance.example.com/api/ai/playground/approval/respond', 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/playground/approval/respond",
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([
'approvalKey' => 'playground:5f7b1c2e8a1d4e0012c3b4a5:tool-call-7c2a',
'decision' => 'approve',
'conversation' => [
[
'role' => 'user',
'content' => 'Please book me for Tuesday at 2pm.'
],
[
'role' => 'assistant',
'content' => 'I will go ahead and request that slot.'
]
],
'promptId' => '5f7b1c2e8a1d4e0012c3b4a5',
'conversationId' => '64d2f9c5e8a1d4e001a0b1c2',
'modelOverride' => [
'provider' => 'anthropic',
'model' => 'claude-sonnet-4-6'
]
]),
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/playground/approval/respond"
payload := strings.NewReader("{\n \"approvalKey\": \"playground:5f7b1c2e8a1d4e0012c3b4a5:tool-call-7c2a\",\n \"decision\": \"approve\",\n \"conversation\": [\n {\n \"role\": \"user\",\n \"content\": \"Please book me for Tuesday at 2pm.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"I will go ahead and request that slot.\"\n }\n ],\n \"promptId\": \"5f7b1c2e8a1d4e0012c3b4a5\",\n \"conversationId\": \"64d2f9c5e8a1d4e001a0b1c2\",\n \"modelOverride\": {\n \"provider\": \"anthropic\",\n \"model\": \"claude-sonnet-4-6\"\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/playground/approval/respond")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"approvalKey\": \"playground:5f7b1c2e8a1d4e0012c3b4a5:tool-call-7c2a\",\n \"decision\": \"approve\",\n \"conversation\": [\n {\n \"role\": \"user\",\n \"content\": \"Please book me for Tuesday at 2pm.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"I will go ahead and request that slot.\"\n }\n ],\n \"promptId\": \"5f7b1c2e8a1d4e0012c3b4a5\",\n \"conversationId\": \"64d2f9c5e8a1d4e001a0b1c2\",\n \"modelOverride\": {\n \"provider\": \"anthropic\",\n \"model\": \"claude-sonnet-4-6\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/ai/playground/approval/respond")
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 \"approvalKey\": \"playground:5f7b1c2e8a1d4e0012c3b4a5:tool-call-7c2a\",\n \"decision\": \"approve\",\n \"conversation\": [\n {\n \"role\": \"user\",\n \"content\": \"Please book me for Tuesday at 2pm.\"\n },\n {\n \"role\": \"assistant\",\n \"content\": \"I will go ahead and request that slot.\"\n }\n ],\n \"promptId\": \"5f7b1c2e8a1d4e0012c3b4a5\",\n \"conversationId\": \"64d2f9c5e8a1d4e001a0b1c2\",\n \"modelOverride\": {\n \"provider\": \"anthropic\",\n \"model\": \"claude-sonnet-4-6\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"decision": "approve",
"response": "Sent! I just texted Alex the confirmation."
}{
"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."
}{
"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
Opaque key for the approval card being resolved. Single-use — consumed atomically; a second call returns approval_expired.
approve runs the tool with the captured args; reject stashes a sentinel so the agent acknowledges and moves on.
approve, reject Prompt id used for the original playground turn; the resumed turn re-runs the same prompt so behavior stays consistent.
Visible playground history at the moment the user clicked the approval card. Replayed on resume; a synthetic resume note is appended server-side.
Show child attributes
Show child attributes
Optional conversation id used for context lookup on the resumed turn; matches the value originally passed to /api/ai/playground.
Optional inline prompt text that replaces the saved prompt for this resumed turn — used by editors testing un-saved edits.
Pin the resumed turn to a specific provider/model (e.g. { provider: 'anthropic', model: 'claude-sonnet-4-6' }) overriding the org's default assignment.
Show child attributes
Show child attributes
{
"provider": "anthropic",
"model": "claude-sonnet-4-6"
}
Response
Approval resolved and playground resumed
Returned after a playground approval is resolved (approve or reject). response carries the resumed agent reply; toolError flags that the underlying tool execution failed.