curl --request POST \
--url https://api.goyappr.com/carrier-accounts/{id}/numbers/{phone_number_id}/configure \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"confirm": true
}
'import requests
url = "https://api.goyappr.com/carrier-accounts/{id}/numbers/{phone_number_id}/configure"
payload = { "confirm": True }
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({confirm: true})
};
fetch('https://api.goyappr.com/carrier-accounts/{id}/numbers/{phone_number_id}/configure', 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}/numbers/{phone_number_id}/configure",
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([
'confirm' => true
]),
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}/numbers/{phone_number_id}/configure"
payload := strings.NewReader("{\n \"confirm\": true\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}/numbers/{phone_number_id}/configure")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"confirm\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/carrier-accounts/{id}/numbers/{phone_number_id}/configure")
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 \"confirm\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "+972551234567",
"friendly_name": "<string>",
"provider": "telnyx",
"status": "active",
"is_active": true,
"inbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"inbound_split": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"percent": 50
},
"outbound_split": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"percent": 50
},
"sip_inbound_configured": true,
"sip_outbound_configured": true,
"country_code": "<string>",
"monthly_cost": 123,
"rent": {
"included": true,
"reason": "own_carrier",
"monthly_price_cents": 123,
"last_charged_at": "2023-11-07T05:31:56Z"
},
"next_renewal_at": "2023-11-07T05:31:56Z",
"scheduled_release_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"phone_system": {
"sip_endpoint_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sip_endpoint_name": "<string>"
},
"carrier_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"provider": "telnyx",
"status": "untested"
},
"carrier_state": {
"state": "ready",
"telnyx_status": "<string>",
"current_connection_name": "<string>",
"previous_connection_name": "<string>",
"blockers": [
"forwarding_always"
],
"notes": [
"number_recording"
],
"removed_at": "2023-11-07T05:31:56Z"
},
"ownership_verified_at": "2023-11-07T05:31:56Z"
},
"changed": true,
"warnings": [
"forwarding_on_failure"
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"warnings": [
"forwarding_on_failure"
],
"current_connection_name": "Office PBX"
}{
"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>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}Answer a Number's Calls in Yappr
Moves the number’s calls to Yappr. In your Telnyx account, the number’s
connection changes from where its calls go today to the account’s Call
Control App, and its inbound agent answers them. That connection is the only
setting Yappr changes. Yappr checks the number with Telnyx first, makes the
change, then reads it back, and remembers the connection it replaced so
Stop answering here can put
it back. On a number already configured it changes nothing. Requires
carrier_accounts:manage. Limit: 200 per workspace per day.
Ask first. Send the request once without confirm (an empty body): nothing
changes, and the answer is 400 CONFIRM_REQUIRED with warnings, read from
your Telnyx account as it answers (voicemail included), and
current_connection_name. What Telnyx does not answer just then comes from the
last sync, which does not read voicemail. Show them, then send {"confirm": true}.
What changes: calls to the number stop reaching the connection it was on, and the inbound agent you pick in Yappr answers them instead. Until the number has an inbound agent, its callers are turned away.
What stays the same: messaging, the emergency address, caller name (CNAM),
tags, number-level recording, forwarding on failure, call screening, voicemail,
and calls out from your own phone system that show this number. Settings of
these that are on come back in warnings.
Cost: Telnyx bills your account for these calls; Yappr bills the agent minutes as usual.
curl --request POST \
--url https://api.goyappr.com/carrier-accounts/{id}/numbers/{phone_number_id}/configure \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"confirm": true
}
'import requests
url = "https://api.goyappr.com/carrier-accounts/{id}/numbers/{phone_number_id}/configure"
payload = { "confirm": True }
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({confirm: true})
};
fetch('https://api.goyappr.com/carrier-accounts/{id}/numbers/{phone_number_id}/configure', 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}/numbers/{phone_number_id}/configure",
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([
'confirm' => true
]),
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}/numbers/{phone_number_id}/configure"
payload := strings.NewReader("{\n \"confirm\": true\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}/numbers/{phone_number_id}/configure")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"confirm\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/carrier-accounts/{id}/numbers/{phone_number_id}/configure")
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 \"confirm\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "+972551234567",
"friendly_name": "<string>",
"provider": "telnyx",
"status": "active",
"is_active": true,
"inbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"inbound_split": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"percent": 50
},
"outbound_split": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"percent": 50
},
"sip_inbound_configured": true,
"sip_outbound_configured": true,
"country_code": "<string>",
"monthly_cost": 123,
"rent": {
"included": true,
"reason": "own_carrier",
"monthly_price_cents": 123,
"last_charged_at": "2023-11-07T05:31:56Z"
},
"next_renewal_at": "2023-11-07T05:31:56Z",
"scheduled_release_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"phone_system": {
"sip_endpoint_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sip_endpoint_name": "<string>"
},
"carrier_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"provider": "telnyx",
"status": "untested"
},
"carrier_state": {
"state": "ready",
"telnyx_status": "<string>",
"current_connection_name": "<string>",
"previous_connection_name": "<string>",
"blockers": [
"forwarding_always"
],
"notes": [
"number_recording"
],
"removed_at": "2023-11-07T05:31:56Z"
},
"ownership_verified_at": "2023-11-07T05:31:56Z"
},
"changed": true,
"warnings": [
"forwarding_on_failure"
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"warnings": [
"forwarding_on_failure"
],
"current_connection_name": "Office PBX"
}{
"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>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}carrier_accounts:manage. Limit: 200
per workspace per day.
Pick the inbound agent with POST /phone-numbers/configure
(inbound_agent_id) before or after. Calls out from the number work whether it is
configured or not. The numbers come from a sync:
phone_number_id is a number’s id in the account’s numbers.
curl -X POST https://api.goyappr.com/carrier-accounts/7c1e…/numbers/e2a4…/configure \
-H "Authorization: Bearer ypr_live_..." \
-H "Content-Type: application/json" \
-d '{ "confirm": true }'
{
"data": {
"id": "e2a4…",
"number": "+972501234567",
"provider": "external",
"inbound_agent_id": "5b0f…",
"sip_inbound_configured": true,
"carrier_state": {
"state": "ready",
"telnyx_status": "active",
"current_connection_name": "Yappr",
"previous_connection_name": "Office PBX",
"blockers": [],
"notes": ["number_recording"],
"removed_at": null
}
},
"changed": true,
"warnings": ["number_recording", "connection_change"]
}
carrier_state.state reads ready, or paused while the account is paused because Telnyx
refused calls (that pause does not stop configuring).
Ask first
Send the request once withoutconfirm (an empty body, or {}). Nothing changes: the
answer is 400 CONFIRM_REQUIRED with warnings and current_connection_name, where the
number’s calls go today. Show them to whoever decides, then send {"confirm": true}.
curl -X POST https://api.goyappr.com/carrier-accounts/7c1e…/numbers/e2a4…/configure \
-H "Authorization: Bearer ypr_live_..."
{
"error": "Send {\"confirm\": true}. This changes the number's connection in your Telnyx account, so its calls stop reaching where they go today.",
"code": "CONFIRM_REQUIRED",
"warnings": ["number_recording", "voicemail", "connection_change"],
"current_connection_name": "Office PBX"
}
warnings from your Telnyx account with your key, as it answers:
the number’s connection, its voice settings and its voicemail. Whatever Telnyx does not
answer just then (or a number the sync has not read a Telnyx id for yet) comes from the
last sync instead, and the last sync does not read
voicemail, so voicemail can be missing from that answer. The 200 reads them all again,
live, as the change is made.
Read this before you send confirm: true
What changes
- Calls to the number stop reaching the connection it is on today
(
carrier_state.current_connection_name, for example your office phone system). The inbound agent you pick in Yappr answers them instead. - Until the number has an inbound agent, its callers are turned away.
- Calls to it are handled like calls to a number bought from Yappr: your credit, your call time windows and Yappr’s capacity all apply, and a call Yappr turns away does not go on to your old connection.
- Messaging, the emergency address, caller name (CNAM) and tags.
- Calls out from your own phone system that show this number.
- Everything else in your Telnyx account, including the number’s own settings below.
carrier_state.previous_connection_name), or on
no connection if it had none. You can also change the connection yourself in Telnyx, under
Numbers → My Numbers.
Warnings
connection_change is the one thing that changes:
warnings | What it means |
|---|---|
connection_change | Calls to the number stop reaching the connection they reach today (current_connection_name) and come to Yappr. Not listed for a number on no connection, or already on the app. |
warnings lists it:
warnings | What it means |
|---|---|
number_recording | Telnyx records calls to this number too, so each call is recorded, and billed, twice. You can turn it off in Telnyx. |
forwarding_on_failure | Your “forward on failure” setting stays on. |
voicemail | Telnyx voicemail stays on for the number. |
call_screening | Telnyx screens callers before Yappr gets the call. |
number_recording, forwarding_on_failure and call_screening also show on the number
itself, in carrier_state.notes.
Three settings make Yappr refuse instead, because Yappr would never get the calls, or
could not tell which number they were for: forwarding every call elsewhere
(422 NUMBER_FORWARDS_ALL_CALLS), a translated number (422 NUMBER_HAS_TRANSLATED_NUMBER)
and a tech prefix added to the dialled number (422 NUMBER_HAS_TECH_PREFIX). The number
shows blocked with the reason in carrier_state.blockers. Turn the setting off in Telnyx,
sync, then try again.
How it is done
- Yappr asks Telnyx, with your key, for the number’s status, connection and settings, live.
- It changes the number’s connection to the account’s Call Control App. Nothing else is sent to Telnyx.
- It reads the number back. If Telnyx shows another connection, the answer is
502 CONFIGURE_NOT_APPLIED. - It remembers the connection it replaced, for stop answering here.
changed: false), so sending it twice is safe.
Errors
| Status | code | Meaning |
|---|---|---|
| 400 | CONFIRM_REQUIRED | The body is not {"confirm": true}, so nothing changed. It carries warnings and current_connection_name: the ask-first answer (above). |
| 403 | CARRIER_ACCOUNTS_NOT_ENABLED | Yappr has switched carrier accounts off for this workspace. Contact Yappr support. |
| 404 | CARRIER_ACCOUNT_NOT_FOUND, NUMBER_NOT_FOUND | Not in this workspace, or not a number of this account. |
| 404 | RESOURCE_ID_INVALID | The account or the number segment is not an id at all. |
| 409 | CONNECTION_REQUIRED | Choose the Call Control App first. |
| 409 | NUMBER_REMOVED_FROM_TELNYX | Telnyx no longer lists the number in your account. |
| 409 | NUMBER_NOT_READY | Its status in Telnyx is not active yet (for example, a port is pending). |
| 409 | CARRIER_ACCOUNT_PAUSED | Telnyx refused the key, or the Call Control App is gone. Fix it, then turn the account back on. A pause for refused calls does not stop this. |
| 409 | NUMBER_ON_YAPPR_PLATFORM | The number is on a connection Yappr itself uses. Yappr does not move it. |
| 409 | VOICE_NOT_READY | Yappr cannot answer calls on your numbers right now, for example during an update. Nothing changed; try again in a few minutes. |
| 422 | NUMBER_FORWARDS_ALL_CALLS | Telnyx forwards every call to this number elsewhere, so Yappr would never get them. Turn off call forwarding for it in Telnyx, then sync. |
| 422 | NUMBER_HAS_TRANSLATED_NUMBER | Telnyx delivers its calls as another number. Remove the translated number in Telnyx, then sync. |
| 422 | NUMBER_HAS_TECH_PREFIX | Telnyx adds a tech prefix to the dialled number before the call arrives, so Yappr could not match it. Turn off the tech prefix for this number in Telnyx, then sync. |
| 422 | TELNYX_REFUSED_CHANGE | Telnyx refused the change. Nothing changed. |
| 422 | TELNYX_REFUSED_REQUEST | Telnyx accepted the key but refused to read or change the number. Check the key’s permissions in Telnyx. Nothing changed, and the account does not pause. |
| 422 | TELNYX_KEY_REJECTED | Telnyx refused the saved key. The account pauses. |
| 429 | RATE_LIMITED | 200 numbers configured in this workspace today. Retry-After says when the day’s window resets. |
| 502 | CONFIGURE_NOT_APPLIED | Telnyx took the change, but the number reads back on another connection. Check it in Telnyx (Numbers → My Numbers), then try again. |
| 503 | TELNYX_UNAVAILABLE | Telnyx did not answer. Try again. |
Authorizations
Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).
Body
Response
Configured: calls to the number reach Yappr. carrier_state.state is ready,
or paused while the account is paused because Telnyx refused calls (that
pause does not stop configuring).
The same list the ask-first answer gave, read again as the change
was made: connection_change when the number moved, and the
settings Yappr left on (carrier_state.notes shows those too,
except voicemail).
forwarding_on_failure, number_recording, call_screening, voicemail, connection_change