AnalyticsUsage
Get Usage
Returns metered spend for the project over a date window, broken down by day, app, and upstream service. This is the cost side of the ledger. See Get Balance Transactions for how that spend drew down the credit balance.
Authorization
Authorization AuthorizationBearer <token>
In: header
Path Parameters
projectIdrequiredstring
ID of the project to report usage for.
Query Parameters
dateFromstring
Start of the window as a YYYY-MM-DD date, inclusive and read in UTC.
dateTostring
End of the window as a YYYY-MM-DD date, inclusive and read in UTC.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://www.saasco.com/api/v2/projects/string/analytics/usage"{
"meta": [
{
"name": "string",
"type": "string"
}
],
"rows": 0,
"statistics": {
"bytes_read": 0,
"elapsed": 0,
"rows_read": 0
},
"usage": {
"cost": 0,
"duration": 0,
"metricCount": 0
},
"data": [
{
"app": "string",
"cost": 0,
"date": "string",
"service": "string"
}
]
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}