TerraBog
DocsAPI Reference
v1 · REST
ChangelogSign inDashboard
Analytics API
GET/v1/analytics/revenue

Get Revenue Metrics

Returns aggregated revenue metrics including MRR, ARR, and net revenue retention for the specified time range. Supports daily, weekly, and monthly granularity with optional segment breakdowns.

Base URL:https://api.terrabog.com/v1
Auth:Bearer token

Parameters

NameTypeRequiredDescription
source_idquery
string
required
Unique identifier of the connected data source.
fromquery
string
required
Start of the reporting period — ISO 8601 date format.
toquery
string
required
End of the reporting period — ISO 8601 date format.
granularityquery
enum
optional
Aggregation interval. One of: day, week, month.Defaults to day.
segmentquery
string
optional
Segment dimension: plan, region, or channel.
include_forecastquery
boolean
optional
Append AI-generated forecast for the next period.Defaults to false.

Request

cURL
curl -G https://api.terrabog.com/v1/analytics/revenue \  -H "Authorization: Bearer $TERRABOG_API_KEY" \  -d "source_id=src_abc123" \  -d "from=2025-01-01" \  -d "to=2025-12-31" \  -d "granularity=month"

Response200 OK

JSON
{  "data": {    "summary": {      "mrr": 284750.00,      "arr": 3417000.00,      "net_revenue_retention": 118.4,      "growth_rate": 0.124,      "total_customers": 847    },    "series": [      {        "date": "2025-01-01",        "mrr": 241200.00,        "new_mrr": 18400.00,        "expansion_mrr": 9200.00,        "churned_mrr": -3200.00,        "net_new_mrr": 24400.00      }    ],    "period": {      "from": "2025-01-01",      "to": "2025-12-31",      "granularity": "month"    }  },  "meta": {    "request_id": "req_7xKm4nPqR8vY",    "generated_at": "2026-02-24T14:30:00Z",    "cached": false  }}

Status Codes

CodeStatusDescription
200OKSuccessful response with revenue data.
400Bad RequestInvalid or missing parameters. See error.details.
401UnauthorizedMissing, malformed, or expired API key.
403ForbiddenAPI key lacks access to the specified source.
404Not Foundsource_id does not exist or was deleted.
429Too Many RequestsRate limit hit. Check X-RateLimit-Reset header.
500Internal Server ErrorUnexpected error. Contact support with request_id.