curl --request DELETE \
--url https://api.goyappr.com/carrier-accounts/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.goyappr.com/carrier-accounts/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.goyappr.com/carrier-accounts/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.goyappr.com/carrier-accounts/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.goyappr.com/carrier-accounts/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/carrier-accounts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"telnyx_connection_deleted": true,
"restore": {
"ok": true,
"restored": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "+972501234567",
"changed": true
}
],
"failed": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"code": "PREVIOUS_ROUTING_GONE"
}
],
"remaining": 123
}
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<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>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"restore": {
"ok": true,
"restored": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "+972501234567",
"changed": true
}
],
"failed": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"code": "PREVIOUS_ROUTING_GONE"
}
],
"remaining": 123
}
}Disconnect Carrier Account
Deletes the saved key. If Yappr created the Call Control App, Yappr deletes it
from your Telnyx account too (telnyx_connection_deleted). Yappr never deletes
your API key: delete it in Telnyx yourself. A number still configured to
answer here has to go back to its previous connection first: send
restore_routing=true, or stop answering on each one. Requires
carrier_accounts:manage.
A number nothing points at is deleted. A number with history (a past call, a
campaign, a charge) is kept so that history stays: switched off, its
carrier_state.state is removed (Removed from this workspace, never “gone
from Telnyx”: it may still be in your Telnyx account) and its
carrier_account.status is disconnected.
curl --request DELETE \
--url https://api.goyappr.com/carrier-accounts/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.goyappr.com/carrier-accounts/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.goyappr.com/carrier-accounts/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.goyappr.com/carrier-accounts/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.goyappr.com/carrier-accounts/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/carrier-accounts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"telnyx_connection_deleted": true,
"restore": {
"ok": true,
"restored": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "+972501234567",
"changed": true
}
],
"failed": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"code": "PREVIOUS_ROUTING_GONE"
}
],
"remaining": 123
}
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<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>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"restore": {
"ok": true,
"restored": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "+972501234567",
"changed": true
}
],
"failed": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"code": "PREVIOUS_ROUTING_GONE"
}
],
"remaining": 123
}
}carrier_accounts:manage.
curl -X DELETE "https://api.goyappr.com/carrier-accounts/7c1e…?restore_routing=true" \
-H "Authorization: Bearer ypr_live_..."
{
"success": true,
"id": "7c1e…",
"telnyx_connection_deleted": true,
"restore": {
"ok": true,
"restored": [{ "id": "e2a4…", "number": "+972501234567", "changed": true }],
"failed": [],
"remaining": 0
}
}
restore is there only when you sent ?restore_routing=true:
| Field | Meaning |
|---|---|
ok | Every configured number is back on its own connection, so the account could disconnect. |
restored | The numbers put back by this call: {id, number, changed}. changed: false means the number had already left the app in Telnyx, so nothing was sent. |
failed | The numbers Telnyx would not put back: {id, number, code}, with the code stop answering here would answer (below). |
remaining | Configured numbers this call did not reach. Above 0, send the same request again. |
Numbers that answer in Yappr
A number configured to answer in Yappr has to go back to its own connection first, or its calls would reach nobody. Send?restore_routing=true and Yappr puts each such number back on the connection it was on
before (up to 50 per request), reports it in restore, then disconnects. Without it, the
answer is 409 CARRIER_ACCOUNT_HAS_CONFIGURED_NUMBERS; you can also
stop answering on each one first.
Campaigns and live calls are checked first: if a campaign calls from one of the numbers
(409 CARRIER_NUMBERS_USED_BY_CAMPAIGNS) or a call is in progress
(409 CARRIER_ACCOUNT_HAS_LIVE_CALLS), no number is moved.
If Telnyx will not put a number back, or more than 50 are configured, nothing is
disconnected: the answer is 409 CARRIER_ACCOUNT_HAS_CONFIGURED_NUMBERS with the same
restore object, ok: false. Each number in restore.failed has a code:
PREVIOUS_ROUTING_GONE (pick a connection for it in Telnyx), RESTORE_NOT_APPLIED
(Telnyx accepted the change but the number still reads back on the app; try again in a
minute), TELNYX_KEY_REJECTED (fix the key, or change the numbers in Telnyx yourself;
the rest of the batch is not tried), TELNYX_REFUSED_CHANGE, TELNYX_REFUSED_REQUEST,
TELNYX_UNAVAILABLE or NUMBER_REMOVED_FROM_TELNYX. While restore.remaining is above 0,
send the same request again.
You no longer remove the numbers yourself first (CARRIER_ACCOUNT_HAS_NUMBERS is retired).
The numbers
A number nothing points at is deleted. A number with history (past calls, a campaign, a charge) is kept, so that history stays: it is switched off, itscarrier_state.state is
removed and its carrier_account.status is disconnected. It may still be in your
Telnyx account: connect the account again and its first sync brings back the ones Telnyx
still lists. carrier_state.notes says whether one comes back on: off_until_active, and
the sync switches it back on once Telnyx lists it as active; off_by_owner if someone in
your workspace had switched it off before the disconnect, and it comes back switched off
until someone switches it on. To let another workspace connected to the same Telnyx account
take one, remove it with this account’s
id; its history stays.
The app and the key
If Yappr created the Call Control App for you, Yappr deletes it from your Telnyx account too and reports it intelnyx_connection_deleted (null when the app was yours, false
when Telnyx did not confirm the delete: remove it in Telnyx yourself). Yappr never deletes
your API key: delete it in Telnyx yourself.
Errors
| Status | code | Meaning |
|---|---|---|
| 400 | CARRIER_ACCOUNTS_QUERY_INVALID | A query parameter other than restore_routing. Nothing changed. |
| 403 | CARRIER_ACCOUNTS_NOT_ENABLED | Yappr has switched carrier accounts off for this workspace. Contact Yappr support. |
| 404 | CARRIER_ACCOUNT_NOT_FOUND | Not in this workspace. |
| 409 | CARRIER_ACCOUNT_HAS_CONFIGURED_NUMBERS | Numbers still answer in Yappr. Send ?restore_routing=true, or stop answering on each one first. With ?restore_routing=true, see restore (above). |
| 409 | CARRIER_NUMBERS_USED_BY_CAMPAIGNS | A campaign calls from one of the account’s numbers. Give the campaign another number, or delete it, first. |
| 409 | CARRIER_ACCOUNT_HAS_LIVE_CALLS | A call on the account is in progress. Try again when it ends. |
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).
Query Parameters
Response
Disconnected