VocalDocscontracts 1.65.0

Forecast the month's usage against the spend cap

GET /v1/analytics/forecast

PropertyValue
Operationget_forecast
GroupCall trace and analytics
Scopeusage:read
Route classread
IdempotencyNo Idempotency-Key
AuditNot audited: A metadata read; the forecast carries amounts only.
Released in1.57.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Forecasts the current UTC month's live usage (1.57.0): month to date plus, per remaining day, the mean of the same weekday over the last four weeks, banded by their lowest and highest, against the Organization's spend cap, with every input. The platform fee is a separate line and not included. The prepaid balance and its date of exhaustion are P2.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the usage:read scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl "$VOCAL_API/v1/analytics/forecast" \
  -H "Authorization: Bearer $VOCAL_API_KEY"

Responses

StatusContent typeShapeError codes
200application/jsonForecast
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is Forecast.

FieldTypeRequiredDescription
as_ofstringyesThe instant of the latest rollup the forecast read, RFC 3339.
currency"USD"yes
daysarray of ForecastDayyesOne input per remaining day, in order.
estimatetrueyesAlways true: an estimate from list prices and past usage, not a bill.
exceeds_capboolean or nullyesTrue when forecast_micros is above the cap; null without a cap.
forecast_microsintegeryesMonth to date plus the mean of every remaining day.
high_microsintegeryesWhole micro-USD.
low_microsintegeryesWhole micro-USD.
monthstringyesThe current UTC month.
month_to_date_microsintegeryesThe month's live usage so far.
object"forecast"yes
spend_cap_microsinteger or nullyesThe Organization's spend cap; null when it has none.