Public APIAPI ReferenceBilling

Get team usage and costs.

Beta API

The /v1 API contract may change, including breaking changes without compatibility aliases.

GET/v1/teams/{teamId}/usage

Accessible to users with the owner, member, or billing role. The date range is limited to 366 days, and the cost preview covers the entire team even when the app_id filter is used.

Authorization

bearerAuth
AuthorizationBearer <token>

Use an access token obtained by logging in or exchanging an API token. First exchange an ntro_ API token for an access token through the login server.

In: header

Path Parameters

teamId*string

Query Parameters

app_id?string
from?string
granularity?string
to?string

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/teams/string/usage"
{  "by_app": [    {      "app_id": "string",      "app_name": "string",      "app_slug": "string",      "metrics": {        "property1": {          "billing_units": "string",          "raw": 0,          "unit": "string"        },        "property2": {          "billing_units": "string",          "raw": 0,          "unit": "string"        }      }    }  ],  "by_region": [    {      "app_id": "string",      "bucket": "2019-08-24T14:15:22Z",      "metrics": {        "property1": {          "billing_units": "string",          "raw": 0,          "unit": "string"        },        "property2": {          "billing_units": "string",          "raw": 0,          "unit": "string"        }      },      "region": "string"    }  ],  "cost_preview": {    "currency": "string",    "currency_minor_digits": 0,    "lines": [      {        "amount_minor": 0,        "description": "string",        "kind": "string",        "metric": "string",        "quantity": "string",        "region": "string",        "unit": "string",        "unit_price": "string"      }    ],    "period_end": "2019-08-24T14:15:22Z",    "period_start": "2019-08-24T14:15:22Z",    "plan": "string",    "team_id": "string",    "total_minor": 0  },  "cost_preview_scope": "string",  "cost_preview_unavailable_reason": "string",  "from": "2019-08-24T14:15:22Z",  "granularity": "string",  "series": [    {      "app_id": "string",      "bucket": "2019-08-24T14:15:22Z",      "metrics": {        "property1": {          "billing_units": "string",          "raw": 0,          "unit": "string"        },        "property2": {          "billing_units": "string",          "raw": 0,          "unit": "string"        }      },      "region": "string"    }  ],  "to": "2019-08-24T14:15:22Z",  "totals": {    "property1": {      "billing_units": "string",      "raw": 0,      "unit": "string"    },    "property2": {      "billing_units": "string",      "raw": 0,      "unit": "string"    }  }}