Submit a contact approval/rejection from the webchat widget
curl --request POST \
--url https://your-instance.example.com/api/approval/respond \
--header 'Content-Type: application/json' \
--data '
{
"approvalRequestId": "64d2f9c5e8a1d4e001a0b1c2",
"webchatId": "wc_8f3a1b2c4d5e6f70",
"response": "approved"
}
'import requests
url = "https://your-instance.example.com/api/approval/respond"
payload = {
"approvalRequestId": "64d2f9c5e8a1d4e001a0b1c2",
"webchatId": "wc_8f3a1b2c4d5e6f70",
"response": "approved"
}
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({
approvalRequestId: '64d2f9c5e8a1d4e001a0b1c2',
webchatId: 'wc_8f3a1b2c4d5e6f70',
response: 'approved'
})
};
fetch('https://your-instance.example.com/api/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/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([
'approvalRequestId' => '64d2f9c5e8a1d4e001a0b1c2',
'webchatId' => 'wc_8f3a1b2c4d5e6f70',
'response' => 'approved'
]),
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://your-instance.example.com/api/approval/respond"
payload := strings.NewReader("{\n \"approvalRequestId\": \"64d2f9c5e8a1d4e001a0b1c2\",\n \"webchatId\": \"wc_8f3a1b2c4d5e6f70\",\n \"response\": \"approved\"\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://your-instance.example.com/api/approval/respond")
.header("Content-Type", "application/json")
.body("{\n \"approvalRequestId\": \"64d2f9c5e8a1d4e001a0b1c2\",\n \"webchatId\": \"wc_8f3a1b2c4d5e6f70\",\n \"response\": \"approved\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/approval/respond")
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 \"approvalRequestId\": \"64d2f9c5e8a1d4e001a0b1c2\",\n \"webchatId\": \"wc_8f3a1b2c4d5e6f70\",\n \"response\": \"approved\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status": "approved",
"result": {
"bookingId": "bk_64a1b2c3d4e5f60012345678",
"confirmedAt": "2026-04-22T10:14:00.000Z"
}
}{
"error": "Approval already resolved",
"code": "already_resolved"
}{
"error": "Approval already resolved",
"code": "already_resolved"
}{
"error": "Approval already resolved",
"code": "already_resolved"
}{
"error": "Approval already resolved",
"code": "already_resolved"
}Approval
Submit a contact approval/rejection from the webchat widget
Unauthenticated endpoint called from the webchat widget when a contact taps approve/reject on an approval card. The atomic transition only succeeds for pending CONTACT-type requests whose webchatId matches the supplied value; approvals trigger execution of the deferred tool and (on failure) record a failureReason.
POST
/
api
/
approval
/
respond
Submit a contact approval/rejection from the webchat widget
curl --request POST \
--url https://your-instance.example.com/api/approval/respond \
--header 'Content-Type: application/json' \
--data '
{
"approvalRequestId": "64d2f9c5e8a1d4e001a0b1c2",
"webchatId": "wc_8f3a1b2c4d5e6f70",
"response": "approved"
}
'import requests
url = "https://your-instance.example.com/api/approval/respond"
payload = {
"approvalRequestId": "64d2f9c5e8a1d4e001a0b1c2",
"webchatId": "wc_8f3a1b2c4d5e6f70",
"response": "approved"
}
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({
approvalRequestId: '64d2f9c5e8a1d4e001a0b1c2',
webchatId: 'wc_8f3a1b2c4d5e6f70',
response: 'approved'
})
};
fetch('https://your-instance.example.com/api/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/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([
'approvalRequestId' => '64d2f9c5e8a1d4e001a0b1c2',
'webchatId' => 'wc_8f3a1b2c4d5e6f70',
'response' => 'approved'
]),
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://your-instance.example.com/api/approval/respond"
payload := strings.NewReader("{\n \"approvalRequestId\": \"64d2f9c5e8a1d4e001a0b1c2\",\n \"webchatId\": \"wc_8f3a1b2c4d5e6f70\",\n \"response\": \"approved\"\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://your-instance.example.com/api/approval/respond")
.header("Content-Type", "application/json")
.body("{\n \"approvalRequestId\": \"64d2f9c5e8a1d4e001a0b1c2\",\n \"webchatId\": \"wc_8f3a1b2c4d5e6f70\",\n \"response\": \"approved\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/approval/respond")
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 \"approvalRequestId\": \"64d2f9c5e8a1d4e001a0b1c2\",\n \"webchatId\": \"wc_8f3a1b2c4d5e6f70\",\n \"response\": \"approved\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status": "approved",
"result": {
"bookingId": "bk_64a1b2c3d4e5f60012345678",
"confirmedAt": "2026-04-22T10:14:00.000Z"
}
}{
"error": "Approval already resolved",
"code": "already_resolved"
}{
"error": "Approval already resolved",
"code": "already_resolved"
}{
"error": "Approval already resolved",
"code": "already_resolved"
}{
"error": "Approval already resolved",
"code": "already_resolved"
}Body
application/json
⌘I