curl --request POST \
--url https://api.goyappr.com/carrier-accounts/{id}/connection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": "<string>"
}
'import requests
url = "https://api.goyappr.com/carrier-accounts/{id}/connection"
payload = { "connection_id": "<string>" }
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({connection_id: '<string>'})
};
fetch('https://api.goyappr.com/carrier-accounts/{id}/connection', 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.goyappr.com/carrier-accounts/{id}/connection",
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([
'connection_id' => '<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.goyappr.com/carrier-accounts/{id}/connection"
payload := strings.NewReader("{\n \"connection_id\": \"<string>\"\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://api.goyappr.com/carrier-accounts/{id}/connection")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/carrier-accounts/{id}/connection")
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 \"connection_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Main Telnyx account",
"provider": "telnyx",
"api_key_last4": "9XyZ",
"api_key_updated_at": "2023-11-07T05:31:56Z",
"public_key_set": true,
"signature_verified": true,
"connection": {
"id": "2890000000000000001",
"created_by_yappr": true,
"outbound_voice_profile_id": "<string>"
},
"status": "untested",
"pause_reason": "key_rejected",
"last_error": {
"code": "<string>",
"sip_code": "403",
"at": "2023-11-07T05:31:56Z"
},
"last_success_at": "2023-11-07T05:31:56Z",
"last_tested_at": "2023-11-07T05:31:56Z",
"numbers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "+972551234567",
"friendly_name": "<string>",
"provider": "<string>",
"status": "active",
"is_active": true,
"inbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sip_inbound_configured": true,
"sip_outbound_configured": true,
"country_code": "<string>",
"monthly_cost": 123,
"created_at": "2023-11-07T05:31:56Z",
"carrier_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"provider": "telnyx",
"status": "untested"
},
"ownership_verified_at": "2023-11-07T05:31:56Z"
}
],
"webhook_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Calling out through your own Telnyx account is switched off for this workspace. Contact Yappr support.",
"code": "CARRIER_ACCOUNTS_NOT_ENABLED",
"enabled": false
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Choose the Call Control App
Choose the Call Control App Yappr places calls through: let Yappr create one
in your account on an outbound voice profile you pick (create), or give one
you made (connection_id). Yappr never creates or changes an outbound voice
profile. Requires carrier_accounts:manage. Limit: 10 per workspace per day.
curl --request POST \
--url https://api.goyappr.com/carrier-accounts/{id}/connection \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": "<string>"
}
'import requests
url = "https://api.goyappr.com/carrier-accounts/{id}/connection"
payload = { "connection_id": "<string>" }
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({connection_id: '<string>'})
};
fetch('https://api.goyappr.com/carrier-accounts/{id}/connection', 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.goyappr.com/carrier-accounts/{id}/connection",
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([
'connection_id' => '<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.goyappr.com/carrier-accounts/{id}/connection"
payload := strings.NewReader("{\n \"connection_id\": \"<string>\"\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://api.goyappr.com/carrier-accounts/{id}/connection")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/carrier-accounts/{id}/connection")
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 \"connection_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Main Telnyx account",
"provider": "telnyx",
"api_key_last4": "9XyZ",
"api_key_updated_at": "2023-11-07T05:31:56Z",
"public_key_set": true,
"signature_verified": true,
"connection": {
"id": "2890000000000000001",
"created_by_yappr": true,
"outbound_voice_profile_id": "<string>"
},
"status": "untested",
"pause_reason": "key_rejected",
"last_error": {
"code": "<string>",
"sip_code": "403",
"at": "2023-11-07T05:31:56Z"
},
"last_success_at": "2023-11-07T05:31:56Z",
"last_tested_at": "2023-11-07T05:31:56Z",
"numbers": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "+972551234567",
"friendly_name": "<string>",
"provider": "<string>",
"status": "active",
"is_active": true,
"inbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sip_inbound_configured": true,
"sip_outbound_configured": true,
"country_code": "<string>",
"monthly_cost": 123,
"created_at": "2023-11-07T05:31:56Z",
"carrier_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"provider": "telnyx",
"status": "untested"
},
"ownership_verified_at": "2023-11-07T05:31:56Z"
}
],
"webhook_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "Calling out through your own Telnyx account is switched off for this workspace. Contact Yappr support.",
"code": "CARRIER_ACCOUNTS_NOT_ENABLED",
"enabled": false
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}carrier_accounts:manage.
Let Yappr create it on an outbound voice profile of yours. Yappr creates an app
named “Yappr outbound” with its webhook URL set, and never creates or changes an
outbound voice profile: its countries and spend limits stay your decision.
curl -X POST https://api.goyappr.com/carrier-accounts/7c1e…/connection \
-H "Authorization: Bearer ypr_live_..." \
-H "Content-Type: application/json" \
-d '{ "create": { "outbound_voice_profile_id": "2890…" } }'
webhook_url (returned when you connected, or by
get with a carrier_accounts:manage key), it
must have an outbound voice profile, and it must be switched on.
curl -X POST https://api.goyappr.com/carrier-accounts/7c1e…/connection \
-H "Authorization: Bearer ypr_live_..." \
-H "Content-Type: application/json" \
-d '{ "connection_id": "2890…" }'
connection set. Next: add your numbers.
Errors
| Status | code | Meaning |
|---|---|---|
| 400 | INVALID_CONNECTION_REQUEST, INVALID_JSON | Send exactly one of create or connection_id. |
| 404 | CARRIER_ACCOUNT_NOT_FOUND | Not in this workspace. |
| 409 | CONNECTION_ALREADY_CONNECTED | The account already has its app. Disconnect and connect again to change it. |
| 422 | OUTBOUND_PROFILE_NOT_FOUND | That outbound voice profile is not in your account. |
| 422 | CONNECTION_CREATE_REJECTED | Telnyx refused to create the app. Check your account’s limits. |
| 422 | CONNECTION_NOT_FOUND | No app with that id in your account. |
| 422 | CONNECTION_WEBHOOK_MISMATCH | The app’s webhook URL is not the account’s. The error body carries webhook_url. |
| 422 | CONNECTION_HAS_NO_OUTBOUND_PROFILE | Attach an outbound voice profile to the app. |
| 422 | CONNECTION_INACTIVE | The app is switched off in Telnyx. |
| 422 | TELNYX_KEY_REJECTED | Telnyx refused the saved key. |
| 429 | RATE_LIMITED | 10 per workspace per day. |
| 503 | TELNYX_UNAVAILABLE | Telnyx did not answer. Nothing changed. |
Authorizations
Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys.
Path Parameters
Body
Send exactly one of create or connection_id.
Yappr creates a Call Control App named "Yappr outbound" in your account, on this outbound voice profile.
Show child attributes
Show child attributes
A Call Control App you made just for Yappr. Its webhook URL must be exactly
this account's webhook_url, it must have an outbound voice profile, and it
must be switched on.
Response
App connected
Your own Telnyx account, connected so agents can call from the numbers you own there. Yappr places each call on your Call Control App, with your API key, so the call runs on your Telnyx account and Telnyx bills you for it. The API key is write-only: no response ever contains it.
Show child attributes
Show child attributes