Connect Telnyx or update phone capabilities
curl --request PATCH \
--url https://api.contactbutton.com/v1/workspaces/{workspace}/telephony \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "<string>",
"webhook_public_key": "<string>",
"inbound_calls": true,
"call_forwarding": true,
"outbound_calling": true,
"sms_lead_alerts": true,
"default_sms_sender": "<string>"
}
'import requests
url = "https://api.contactbutton.com/v1/workspaces/{workspace}/telephony"
payload = {
"api_key": "<string>",
"webhook_public_key": "<string>",
"inbound_calls": True,
"call_forwarding": True,
"outbound_calling": True,
"sms_lead_alerts": True,
"default_sms_sender": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_key: '<string>',
webhook_public_key: '<string>',
inbound_calls: true,
call_forwarding: true,
outbound_calling: true,
sms_lead_alerts: true,
default_sms_sender: '<string>'
})
};
fetch('https://api.contactbutton.com/v1/workspaces/{workspace}/telephony', 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/workspaces/{workspace}/telephony",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'api_key' => '<string>',
'webhook_public_key' => '<string>',
'inbound_calls' => true,
'call_forwarding' => true,
'outbound_calling' => true,
'sms_lead_alerts' => true,
'default_sms_sender' => '<string>'
]),
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://api.contactbutton.com/v1/workspaces/{workspace}/telephony"
payload := strings.NewReader("{\n \"api_key\": \"<string>\",\n \"webhook_public_key\": \"<string>\",\n \"inbound_calls\": true,\n \"call_forwarding\": true,\n \"outbound_calling\": true,\n \"sms_lead_alerts\": true,\n \"default_sms_sender\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.contactbutton.com/v1/workspaces/{workspace}/telephony")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": \"<string>\",\n \"webhook_public_key\": \"<string>\",\n \"inbound_calls\": true,\n \"call_forwarding\": true,\n \"outbound_calling\": true,\n \"sms_lead_alerts\": true,\n \"default_sms_sender\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contactbutton.com/v1/workspaces/{workspace}/telephony")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key\": \"<string>\",\n \"webhook_public_key\": \"<string>\",\n \"inbound_calls\": true,\n \"call_forwarding\": true,\n \"outbound_calling\": true,\n \"sms_lead_alerts\": true,\n \"default_sms_sender\": \"<string>\"\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": {}
}Connect Telnyx or update phone capabilities
Initial bring-your-own-carrier setup requires both the Telnyx API V2 key and the account Ed25519 public key. Later updates may omit either credential to keep the stored value. The API key is encrypted and never returned.
PATCH
/
workspaces
/
{workspace}
/
telephony
Connect Telnyx or update phone capabilities
curl --request PATCH \
--url https://api.contactbutton.com/v1/workspaces/{workspace}/telephony \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "<string>",
"webhook_public_key": "<string>",
"inbound_calls": true,
"call_forwarding": true,
"outbound_calling": true,
"sms_lead_alerts": true,
"default_sms_sender": "<string>"
}
'import requests
url = "https://api.contactbutton.com/v1/workspaces/{workspace}/telephony"
payload = {
"api_key": "<string>",
"webhook_public_key": "<string>",
"inbound_calls": True,
"call_forwarding": True,
"outbound_calling": True,
"sms_lead_alerts": True,
"default_sms_sender": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_key: '<string>',
webhook_public_key: '<string>',
inbound_calls: true,
call_forwarding: true,
outbound_calling: true,
sms_lead_alerts: true,
default_sms_sender: '<string>'
})
};
fetch('https://api.contactbutton.com/v1/workspaces/{workspace}/telephony', 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/workspaces/{workspace}/telephony",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'api_key' => '<string>',
'webhook_public_key' => '<string>',
'inbound_calls' => true,
'call_forwarding' => true,
'outbound_calling' => true,
'sms_lead_alerts' => true,
'default_sms_sender' => '<string>'
]),
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://api.contactbutton.com/v1/workspaces/{workspace}/telephony"
payload := strings.NewReader("{\n \"api_key\": \"<string>\",\n \"webhook_public_key\": \"<string>\",\n \"inbound_calls\": true,\n \"call_forwarding\": true,\n \"outbound_calling\": true,\n \"sms_lead_alerts\": true,\n \"default_sms_sender\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.contactbutton.com/v1/workspaces/{workspace}/telephony")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": \"<string>\",\n \"webhook_public_key\": \"<string>\",\n \"inbound_calls\": true,\n \"call_forwarding\": true,\n \"outbound_calling\": true,\n \"sms_lead_alerts\": true,\n \"default_sms_sender\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contactbutton.com/v1/workspaces/{workspace}/telephony")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key\": \"<string>\",\n \"webhook_public_key\": \"<string>\",\n \"inbound_calls\": true,\n \"call_forwarding\": true,\n \"outbound_calling\": true,\n \"sms_lead_alerts\": true,\n \"default_sms_sender\": \"<string>\"\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": {}
}Authorizations
A Contact Button scoped bearer key. Send Authorization: Bearer <token>.
Token abilities are enforced independently of workspace membership; both checks must pass.
REST requires a Sanctum API key. Separately, interactive MCP clients can use registered
OAuth applications with PKCE and audience-bound workspace grants; those tokens are not REST credentials.
Headers
Body
application/json
Initial setup requires both credentials. Omit saved credentials on later capability updates.
Was this page helpful?