GET /usage
Get usage events. This endpoint retrieves usage from your projects for a given date range. The API supports path based hierarchical filtering by any keys and values you have previously saved to trckspace.
This endpoint requires your user_api_key
.
URL : https://api.trckrspace.com/usage
Method : GET
Auth required : YES
Auth headers : {'Authorization': 'Bearer {user_api_key}'}
Query Parameters
name | type | data type | description |
---|---|---|---|
startDt | required | string | Date in ISO format. E.g. 2023-12-31 |
endDt | required | string | Date in ISO format. Must be less than startDt . E.g. 2024-01-01 |
category | optional | string | A category to filter the data by. |
event | optional | string | An event to filter the data by. Requires category . |
Path Parameters
name | type | data type | description |
---|---|---|---|
{proxy}+ | optional -- | string | Query keys and values to filter your search by. These are your order keys and values submitted in a post request. Each key and value has max length of 49. |
Success Response
Code : 200 OK
Request examples
GET /usage?startDt={date1}&endDt={date2}
GET /usage/category?startDt={date1}&endDt={date2}
GET /usage/category/authentication?startDt={date1}&endDt={date2}
Content examples
For a successful response with data:
{
'status': 'OK',
'result': [
{
'dateTime': '2023-09-17T11:56:46.586306'
'category': 'authentication',
'event': 'user-sign-in',
'user_uuid': '123456789',
'location': 'London',
'2fa': true,
}
]
}
For a successful response where no data was found:
{
'status': 'OK',
'result': []
}
Error Responses
Get usage without startDt
or endDt
Code : 400 BAD_REQUEST
Request examples
GET /usage?startDt={date}
GET /usage?endDt={date}
GET /usage/category
Content examples
Request with no endDt
:
{
'message': 'Missing required request parameters: [endDt]'
}
Request with no startDt
:
{
'message': 'Missing required request parameters: [startDt]'
}
Request with neither startDt
or endDt
:
{
'message': 'Missing required request parameters: [startDt, endDt]'
}
Notes
- Your
user_api_key
can be found in the API Key section of https://app.trckrspace.com (opens in a new tab)