curl --request GET \
--url https://api.goyappr.com/billing/consumption \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.goyappr.com/billing/consumption"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.goyappr.com/billing/consumption', 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/billing/consumption",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/billing/consumption"
req, _ := http.NewRequest("GET", 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.get("https://api.goyappr.com/billing/consumption")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/billing/consumption")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"product": "voice_call",
"total_amount_cents": 123,
"count": 123,
"period": "2026-05-07",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "Dental intake",
"agent": {
"id": "00000000-0000-4000-8000-0000000000a1",
"name": "Dental intake",
"archived_at": null
},
"disposition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"disposition": "Interested",
"source": "shared_link",
"phone_number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "+12025550143",
"provider": "external",
"carrier_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"carrier_account": {
"id": "00000000-0000-4000-8000-00000000ca01",
"name": "Client A - Telnyx"
},
"input_tokens": 34645047,
"output_tokens": 205402,
"total_tokens": 34850449
}
],
"range": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"group_by": "<string>",
"product": "<string>",
"timezone": "Asia/Jerusalem",
"sort": "amount"
}
}{
"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>"
}
]
}Billing Consumption
Charges to your account, bucketed by date and product. Useful for usage dashboards,
monthly invoice reconciliation, and anomaly detection. Required scope billing:read.
Amounts are signed the ledger’s way: a charge is positive, credits added are negative.
By default, credit purchases (top-ups and credits from Yappr) are excluded — pass
include_topups=true to include them as topup. For the balance as a statement, signed
for the account holder, read GET /billing/transactions.
curl --request GET \
--url https://api.goyappr.com/billing/consumption \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.goyappr.com/billing/consumption"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.goyappr.com/billing/consumption', 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/billing/consumption",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/billing/consumption"
req, _ := http.NewRequest("GET", 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.get("https://api.goyappr.com/billing/consumption")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/billing/consumption")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"product": "voice_call",
"total_amount_cents": 123,
"count": 123,
"period": "2026-05-07",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "Dental intake",
"agent": {
"id": "00000000-0000-4000-8000-0000000000a1",
"name": "Dental intake",
"archived_at": null
},
"disposition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"disposition": "Interested",
"source": "shared_link",
"phone_number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": "+12025550143",
"provider": "external",
"carrier_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"carrier_account": {
"id": "00000000-0000-4000-8000-00000000ca01",
"name": "Client A - Telnyx"
},
"input_tokens": 34645047,
"output_tokens": 205402,
"total_tokens": 34850449
}
],
"range": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"group_by": "<string>",
"product": "<string>",
"timezone": "Asia/Jerusalem",
"sort": "amount"
}
}{
"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>"
}
]
}total_amount_cents, and credits added are negative. By default, credit purchases are excluded — pass include_topups=true to fold them in as topup.
For the balance itself — every top-up, credit, refund and adjustment beside each day’s usage, with an opening and closing balance — read GET /billing/transactions.
What a row counts
count is the number of charged entries in the row: one per charge in the ledger. A call’s
minutes are one entry, so on voice_call it is the number of call charges, not minutes; a call
with no charge in the ledger is not in it, so it can be lower than the calls GET /calls lists.
A charge is dated when it was debited from the balance, and the report’s days and months
are those dates. A call is charged when it settles, so a call that started at 23:58 and ended
after midnight is counted on the next day, and from / to select charges by that moment too.
Common queries
# This month's voice-call spend, day by day
curl "https://api.goyappr.com/billing/consumption?from=2026-05-01T00:00:00Z&group_by=day&product=voice_call" \
-H "Authorization: Bearer $YAPPR_API_KEY"
# Eval spend for the year, monthly
curl "https://api.goyappr.com/billing/consumption?from=2026-01-01T00:00:00Z&group_by=month&product=eval_run" \
-H "Authorization: Bearer $YAPPR_API_KEY"
# Per-agent voice-call spend last 30 days
curl "https://api.goyappr.com/billing/consumption?group_by=agent&product=voice_call" \
-H "Authorization: Bearer $YAPPR_API_KEY"
# Per-agent voice-call spend AND how those calls ended — the whole of a
# per-client report in one read
curl "https://api.goyappr.com/billing/consumption?group_by=agent,disposition&product=voice_call" \
-H "Authorization: Bearer $YAPPR_API_KEY"
# What testing cost versus what the shared link cost versus the API's calls
curl "https://api.goyappr.com/billing/consumption?group_by=source&product=voice_call" \
-H "Authorization: Bearer $YAPPR_API_KEY"
# Total spend for one specific suite_run (no native filter — query eval_runs and sum)
# (use `GET /agent-eval/runs?suite_run_id=...` and sum `total_cost_cents` client-side)
Cost and outcomes together
group_by=agent,disposition returns one row per agent per outcome, each with its own count
and total_amount_cents. That is both columns of a per-client report — what an agent cost, and
how its calls ended — without joining GET /calls and GET /dispositions by hand.
curl "https://api.goyappr.com/billing/consumption?group_by=agent,disposition&product=voice_call&from=2026-09-01T00:00:00Z" \
-H "Authorization: Bearer $YAPPR_API_KEY"
{
"data": [
{ "agent_id": "a1…", "agent_name": "Dental intake", "agent": { "id": "a1…", "name": "Dental intake", "archived_at": null }, "disposition_id": "d1…", "disposition": "Booked", "product": "voice_call", "total_amount_cents": 1420, "count": 63 },
{ "agent_id": "a1…", "agent_name": "Dental intake", "agent": { "id": "a1…", "name": "Dental intake", "archived_at": null }, "disposition_id": "d2…", "disposition": "Not interested", "product": "voice_call", "total_amount_cents": 845, "count": 40 },
{ "agent_id": "a1…", "agent_name": "Dental intake", "agent": { "id": "a1…", "name": "Dental intake", "archived_at": null }, "disposition_id": null, "disposition": null, "product": "voice_call", "total_amount_cents": 0, "count": 2 }
],
"range": { "from": "…", "to": "…", "group_by": "agent,disposition", "product": "voice_call", "timezone": "Asia/Jerusalem", "sort": "amount" }
}
group_by=disposition gives the same breakdown for the workspace as a whole.
An outcome is a fact about the call a charge belongs to, so a charge with no call behind it
— a number’s monthly rent, a top-up, an eval run — comes back as disposition: null. A call
nobody has dispositioned lands in the same bucket; the row’s own agent_id tells the two apart.
For the calls themselves, one per row, export them from
GET /calls/export.
Cost by where the call came from
group_by=source returns one row per call origin, so a workspace’s own rehearsals are
separated from the calls it was paid for without exporting the call log once per source and
adding the totals up by hand. agent,source answers the same question per agent.
The values are the ones GET /calls reports and
GET /calls?source= filters by — test, shared_link, api, phone_inbound,
phone_outbound — so the two reads agree call for call.
curl "https://api.goyappr.com/billing/consumption?group_by=source&product=voice_call&from=2026-08-01T00:00:00Z&to=2026-09-01T00:00:00Z" \
-H "Authorization: Bearer $YAPPR_API_KEY"
{
"data": [
{ "source": "phone_outbound", "product": "voice_call", "total_amount_cents": 2410, "count": 188 },
{ "source": "shared_link", "product": "voice_call", "total_amount_cents": 512, "count": 47 },
{ "source": "test", "product": "voice_call", "total_amount_cents": 116, "count": 31 }
],
"range": { "from": "…", "to": "…", "group_by": "source", "product": "voice_call", "timezone": "Asia/Jerusalem", "sort": "amount" }
}
source: null. A call
recorded before origins were written down comes back as source: "unknown".
Cost by number, and whose carrier it is
group_by=phone_number returns one row per workspace number per product: the number a call
used (the number it called from, or the number that answered it) and the number a monthly
rent was for. A call counts once, under the workspace number it ran on: a call your carrier
number made to one of your Yappr numbers is an incoming call on that Yappr number, and counts
there, not under the carrier number. provider says whose carrier the number is on — the number’s own provider
from GET /phone-numbers, the same word a call from it
carries on GET /calls:
external— a number in your own Telnyx account, added to a carrier account. Telnyx billed you for these calls’ phone minutes on your Telnyx account; the row’s amount is Yappr’s charge beside that bill, at the phone-call price, the same price as a call from a number bought from Yappr. Yappr charges no monthly rent for these numbers.telnyx— a number bought from Yappr.
curl "https://api.goyappr.com/billing/consumption?group_by=phone_number&product=voice_call&from=2026-09-01T00:00:00Z" \
-H "Authorization: Bearer $YAPPR_API_KEY"
{
"data": [
{ "phone_number_id": "c0ffee00-…", "phone_number": "+12025550143", "provider": "external", "product": "voice_call", "total_amount_cents": 71, "count": 6 },
{ "phone_number_id": "1c9d2f4e-…", "phone_number": "+972501234567", "provider": "telnyx", "product": "voice_call", "total_amount_cents": 412, "count": 29 },
{ "phone_number_id": null, "phone_number": null, "provider": null, "product": "voice_call", "total_amount_cents": 38, "count": 12 }
],
"range": { "from": "…", "to": "…", "group_by": "phone_number", "product": "voice_call", "timezone": "Asia/Jerusalem", "sort": "amount" }
}
phone_number_id: null. To list the calls behind an external row, filter
GET /calls by carrier_account_id.
A number you remove — from a carrier account,
or a number bought from Yappr that you release — keeps its row and its phone_number_id, so
its spend stays where it was. phone_number is the number its calls carry, and provider says
whose account they ran on; a removed number’s rent keeps the id with phone_number and
provider null. One exception: a number removed from a carrier account before 27 September
2026 did not keep its id. Its calls still come back under their own row, with its
phone_number, provider: "external" and phone_number_id: null, and never in the row of
charges with no number.
Every charge in the window is counted, however many there are. If a charge’s call or number
cannot be read, the report answers 500 rather than counting it under no number.
Cost by carrier account
group_by=carrier_account returns one row per carrier account
per product: the Telnyx account each call ran on, with the account itself in carrier_account.
An agency that keeps a Telnyx account per client reads each client’s carrier calls in one row,
however many numbers the account has, and even for a number removed before 27 September 2026,
whose phone_number row cannot carry an id: the call itself keeps the account it ran on.
curl "https://api.goyappr.com/billing/consumption?group_by=carrier_account&product=voice_call&from=2026-09-01&to=2026-09-30" \
-H "Authorization: Bearer $YAPPR_API_KEY"
{
"data": [
{ "carrier_account_id": "00000000-0000-4000-8000-00000000ca01", "carrier_account": { "id": "00000000-0000-4000-8000-00000000ca01", "name": "Client A - Telnyx" }, "provider": "external", "product": "voice_call", "total_amount_cents": 71, "count": 6 },
{ "carrier_account_id": null, "carrier_account": null, "provider": "telnyx", "product": "voice_call", "total_amount_cents": 412, "count": 29 },
{ "carrier_account_id": null, "carrier_account": null, "provider": null, "product": "voice_call", "total_amount_cents": 38, "count": 12 }
],
"range": { "from": "2026-08-31T21:00:00.000Z", "to": "2026-09-30T20:59:59.999999Z", "group_by": "carrier_account", "product": "voice_call", "timezone": "Asia/Jerusalem", "sort": "amount" }
}
carrier_account_id, as GET /calls
reports it, else the account of the number it used. A charge on Yappr’s carrier — a call on a
number bought from Yappr, and that number’s rent — is the row with carrier_account_id: null
and provider: "telnyx"; a charge with no carrier at all — a browser call, a call on a SIP
endpoint, an eval run — is the row with provider: null. An account that is no longer this
workspace’s keeps its carrier_account_id with carrier_account: null. To list a row’s calls,
filter GET /calls by carrier_account_id.
Names, order, and the rows nobody owns
Rows grouped by agent carryagent — the agent itself, { "id", "name", "archived_at" },
archived agents included — and agent_name beside agent_id, so a per-client report needs no
second read of GET /agents. Two agents can share a name; the id is
what tells them apart. agent is null where agent_id is, and for an agent that is not this
workspace’s: a call this workspace was charged for on another workspace’s agent keeps that
agent_id, which GET /agents/{id} answers 404 for, and is not named here.
sort sets the order: amount (largest first — the default, and the order the report has
always used), period (oldest first, for group_by=day or month), or name (agent, then
outcome, then origin, then number, then carrier account, then product, A to Z). period on a grouping with no dates, and name on
day or month rows, are refused with 400 CONSUMPTION_QUERY_INVALID, as is any other value.
Days and months with no charge are not rows: a month by day lists the days something was
charged.
Some spend belongs to no agent or no known origin, and it is still counted — never dropped:
| Row | What it is |
|---|---|
agent_id: null, agent_name: null, a non-call product | A charge with no call behind it: a number’s monthly rent, an eval run, a top-up. |
agent_id: null on voice_call | A call whose agent has since been deleted. The call keeps its charge; deleting an agent clears its link on the call. Browser test calls of deleted test agents land here too. |
source: "unknown" on voice_call | A call whose origin was never written down — calls from before origins were recorded, and browser calls started by a path that did not record one. GET /calls reports the same unknown, and ?source=unknown is not a filter. |
agent and source together (group_by=agent,source) to see which of these a
figure holds.
Products
| Product | What it covers |
|---|---|
voice_call | Paid call minutes (inbound + outbound + web). Per-agent grouping populates here. |
eval_run | Agent-eval runs. |
phone_number | Number purchases and monthly rent. Paid by card, not from the balance; a card refund of a number comes back negative. |
topup | Every credit purchase, excluded by default: paid top-ups and credits from Yappr alike, negative because they put credits in, and a refunded or disputed top-up’s reversal, positive because it takes them back out. GET /billing/transactions names the three apart (top_up, gift, refund). |
refund | A refund entry in the ledger. A refunded top-up is not one: it is reversed inside topup. |
adjustment | Manual corrections to the balance, in either direction. |
product filter takes and the only values product comes back as.
Parameters
The report takesfrom, to, group_by, product, include_topups, timezone and sort, each at most once.
group_by is day when left out. group_by=total returns one row per product for the whole
window, period: "total": the period’s spend on calls, eval runs and numbers in one read.
Anything else is refused with 400 CONSUMPTION_QUERY_INVALID, naming it, rather than ignored.
That matters most for a per-client bill: there is no agent filter, and ?agent_id= used to
answer with the whole workspace’s spend as if it were one client’s. Ask for group_by=agent
(or agent,disposition) and read that client’s row instead. include_topups is true or
false; any other value is refused rather than read as false.
product is one of the names under Products (the underlying type names, such as
voice_usage, are accepted too); anything else — minutes, voice — is refused with the list,
where it used to answer 500. from and to must be real ISO 8601 timestamps: 2026-02-30 and
Aug 2026 are refused, not answered 500. And from after to is refused rather than
answered with nothing in it — a report with the dates swapped used to read as a month that cost
$0.
to is inclusive, and a date-only to covers that whole day on the report’s clock (below):
from=2026-08-01&to=2026-08-31 is all of August, up to the last moment of the 31st.
With from left out the window starts 30 × 24 hours before now. That is not the dashboard’s
Last 30 days, which is 30 whole days on the workspace’s clock, today included: to read the
same days, send from as the date 29 days before today.
Days on your clock
Days and months are the workspace’s own — the clock set withtimezone on
PUT /call-windows, and the one the
dashboard shows the same money on. A charge at 22:30 UTC on 30 September is 1 October in an
Asia/Jerusalem workspace, and group_by=day puts it there. A date-only from or to is a whole
day on that clock too; a value with a time in it means that moment, whatever the zone.
A workspace that never set its clock is on UTC (GET /call-windows answers timezone_set: false),
so its days are UTC days. The dashboard then shows the same report on the reader’s browser clock and
says so; set the clock to make both read the same days.
Pass timezone to read the report on another clock — timezone=UTC gives the UTC days this report
used before it followed the workspace. It is an IANA name (Asia/Jerusalem, Europe/London,
UTC); an offset such as +03:00 or a name the API does not know is refused with
400 CONSUMPTION_QUERY_INVALID. range.timezone in the response names the clock that was used,
and range.from and range.to the window that was read, as instants: a date-only to ends at
that day’s last microsecond on the clock, …T23:59:59.999999Z on UTC and
…T20:59:59.999999Z on Asia/Jerusalem in summer, the same form
GET /billing/transactions gives.
curl "https://api.goyappr.com/billing/consumption?group_by=day&from=2026-09-01&to=2026-09-30&timezone=Asia/Jerusalem" \
-H "Authorization: Bearer $YAPPR_API_KEY"
Token usage
Buckets for token-metered products carryinput_tokens, output_tokens and total_tokens alongside the amount. Today that means eval_run — eval charges are a direct function of tokens consumed, so these fields are what explain a given line.
Products that don’t meter tokens omit these fields entirely rather than returning 0, so total_tokens being absent means “not applicable here”, never “nothing was used”.
curl "https://api.goyappr.com/billing/consumption?group_by=day&product=eval_run" \
-H "Authorization: Bearer $YAPPR_API_KEY"
{
"data": [
{
"period": "2026-08-13",
"product": "eval_run",
"total_amount_cents": 7448,
"count": 328,
"input_tokens": 34645047,
"output_tokens": 205402,
"total_tokens": 34850449
}
],
"range": { "from": "...", "to": "...", "group_by": "day", "product": "eval_run", "timezone": "Asia/Jerusalem", "sort": "amount" }
}
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
The clock days, months and date-only windows are read on, as an IANA name. Defaults to the workspace's clock (set with timezone on PUT /call-windows); timezone=UTC reads UTC days. An offset such as +03:00, or a name the API does not know, is 400 CONSUMPTION_QUERY_INVALID. The response names the clock used in range.timezone.
"Asia/Jerusalem"
Bucket granularity, day when left out. total returns one row per product for
the whole window, with period: "total". agent returns one row per agent_id (currently only populated
for voice_call). disposition returns one row per outcome, and
agent,disposition one row per agent per outcome — cost and outcomes on the same
row, which is the whole of a per-client report in one read.
source returns one row per call origin — test, shared_link, api,
phone_inbound, phone_outbound — which is what separates a workspace's own
rehearsals from the calls it was paid for, and agent,source answers it per
agent. The values are the ones GET /calls reports and GET /calls?source=
filters by, so the two reads agree call for call.
An outcome, and an origin, are facts about the CALL a charge belongs to. A charge
with no call behind it — a number's monthly rent, a top-up, an eval run — buckets
as disposition: null / source: null, and so does a call nobody has
dispositioned; the row's own agent_id tells the two apart.
phone_number returns one row per workspace number per product, with provider
saying whose carrier it is: external rows are the calls placed on your own
Telnyx account, whose phone minutes Telnyx billed you for separately; Yappr charges
no rent for them. A call counts under the workspace number it ran on - the number it
was placed from, or the workspace number that answered it - so a call your carrier
number made to one of your Yappr numbers counts under that Yappr number. A charge with no number
behind it — a browser call, a SIP endpoint call, an eval run, a top-up — buckets as
phone_number_id: null. A number removed since keeps its row and its id.
carrier_account returns one row per carrier account per product - the Telnyx
account each call ran on, named (carrier_account) - so an agency with an account
per client can rebill each client its carrier calls. Calls on Yappr's carrier and
their numbers' rent are one row (carrier_account_id: null, provider: telnyx), and
charges with no carrier at all - browser and SIP endpoint calls, eval runs - another
(provider: null). A carrier call keeps its account even when its number was removed.
Anything outside this list is 400.
day, month, total, agent, product, disposition, agent,disposition, source, agent,source, phone_number, carrier_account Row order. amount — largest first (the default). period — oldest first; only with group_by=day or month. name — by agent name, then outcome, then origin, then number, then carrier account, then product, A to Z, with the unowned bucket last; not with day or month. Any other value, or one that does not fit the grouping, is 400 CONSUMPTION_QUERY_INVALID.
amount, period, name