Start an Inbox-routed native Chat
curl --request POST \
--url https://api.contactbutton.com/v1/public/apps/{app}/chat/conversations \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"suggested_reply_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"visitor_name": "<string>",
"visitor_email": "jsmith@example.com",
"visitor_phone": "<string>",
"phone_country": "<string>",
"source_url": "<string>",
"chat_consent": true,
"button": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"app": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.contactbutton.com/v1/public/apps/{app}/chat/conversations"
payload = {
"message": "<string>",
"suggested_reply_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"visitor_name": "<string>",
"visitor_email": "jsmith@example.com",
"visitor_phone": "<string>",
"phone_country": "<string>",
"source_url": "<string>",
"chat_consent": True,
"button": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"app": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
message: '<string>',
suggested_reply_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
visitor_name: '<string>',
visitor_email: 'jsmith@example.com',
visitor_phone: '<string>',
phone_country: '<string>',
source_url: '<string>',
chat_consent: true,
button: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
app: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.contactbutton.com/v1/public/apps/{app}/chat/conversations', 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.contactbutton.com/v1/public/apps/{app}/chat/conversations",
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' => '<string>',
'suggested_reply_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'visitor_name' => '<string>',
'visitor_email' => 'jsmith@example.com',
'visitor_phone' => '<string>',
'phone_country' => '<string>',
'source_url' => '<string>',
'chat_consent' => true,
'button' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'app' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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://api.contactbutton.com/v1/public/apps/{app}/chat/conversations"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"suggested_reply_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"visitor_name\": \"<string>\",\n \"visitor_email\": \"jsmith@example.com\",\n \"visitor_phone\": \"<string>\",\n \"phone_country\": \"<string>\",\n \"source_url\": \"<string>\",\n \"chat_consent\": true,\n \"button\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"app\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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://api.contactbutton.com/v1/public/apps/{app}/chat/conversations")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"suggested_reply_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"visitor_name\": \"<string>\",\n \"visitor_email\": \"jsmith@example.com\",\n \"visitor_phone\": \"<string>\",\n \"phone_country\": \"<string>\",\n \"source_url\": \"<string>\",\n \"chat_consent\": true,\n \"button\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"app\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contactbutton.com/v1/public/apps/{app}/chat/conversations")
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 \"message\": \"<string>\",\n \"suggested_reply_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"visitor_name\": \"<string>\",\n \"visitor_email\": \"jsmith@example.com\",\n \"visitor_phone\": \"<string>\",\n \"phone_country\": \"<string>\",\n \"source_url\": \"<string>\",\n \"chat_consent\": true,\n \"button\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"app\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"data": "<unknown>",
"meta": {
"request_id": "<string>",
"next_cursor": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"instance": "<string>",
"request_id": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"instance": "<string>",
"request_id": "<string>",
"errors": {}
}Start an Inbox-routed native Chat
Returns data.id, a one-time participant_token, messages, and human_handoff_available. Routes to Inbox without an AI model call.
POST
/
public
/
apps
/
{app}
/
chat
/
conversations
Start an Inbox-routed native Chat
curl --request POST \
--url https://api.contactbutton.com/v1/public/apps/{app}/chat/conversations \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"suggested_reply_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"visitor_name": "<string>",
"visitor_email": "jsmith@example.com",
"visitor_phone": "<string>",
"phone_country": "<string>",
"source_url": "<string>",
"chat_consent": true,
"button": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"app": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.contactbutton.com/v1/public/apps/{app}/chat/conversations"
payload = {
"message": "<string>",
"suggested_reply_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"visitor_name": "<string>",
"visitor_email": "jsmith@example.com",
"visitor_phone": "<string>",
"phone_country": "<string>",
"source_url": "<string>",
"chat_consent": True,
"button": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"app": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
message: '<string>',
suggested_reply_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
visitor_name: '<string>',
visitor_email: 'jsmith@example.com',
visitor_phone: '<string>',
phone_country: '<string>',
source_url: '<string>',
chat_consent: true,
button: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
app: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.contactbutton.com/v1/public/apps/{app}/chat/conversations', 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.contactbutton.com/v1/public/apps/{app}/chat/conversations",
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' => '<string>',
'suggested_reply_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'visitor_name' => '<string>',
'visitor_email' => 'jsmith@example.com',
'visitor_phone' => '<string>',
'phone_country' => '<string>',
'source_url' => '<string>',
'chat_consent' => true,
'button' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'app' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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://api.contactbutton.com/v1/public/apps/{app}/chat/conversations"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"suggested_reply_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"visitor_name\": \"<string>\",\n \"visitor_email\": \"jsmith@example.com\",\n \"visitor_phone\": \"<string>\",\n \"phone_country\": \"<string>\",\n \"source_url\": \"<string>\",\n \"chat_consent\": true,\n \"button\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"app\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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://api.contactbutton.com/v1/public/apps/{app}/chat/conversations")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"suggested_reply_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"visitor_name\": \"<string>\",\n \"visitor_email\": \"jsmith@example.com\",\n \"visitor_phone\": \"<string>\",\n \"phone_country\": \"<string>\",\n \"source_url\": \"<string>\",\n \"chat_consent\": true,\n \"button\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"app\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contactbutton.com/v1/public/apps/{app}/chat/conversations")
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 \"message\": \"<string>\",\n \"suggested_reply_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"visitor_name\": \"<string>\",\n \"visitor_email\": \"jsmith@example.com\",\n \"visitor_phone\": \"<string>\",\n \"phone_country\": \"<string>\",\n \"source_url\": \"<string>\",\n \"chat_consent\": true,\n \"button\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"app\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"data": "<unknown>",
"meta": {
"request_id": "<string>",
"next_cursor": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"instance": "<string>",
"request_id": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"instance": "<string>",
"request_id": "<string>",
"errors": {}
}Headers
Body
application/json
- Option 1
- Option 2
Supply message or a current suggested_reply_id. Contact details and privacy consent are required according to the returned chat_policy. source_url is retained only when enabled by the owner.
Was this page helpful?