POST /usage
Create a new usage event. An event could be anything from functionality within an application, such as a user clicking a button or hitting an endpoint or even infrastructure events like a deployment completing or the current memory used of a server.
For each event order
and values
are required keys. order
represents the
hierarchical order which can be used for filtering later. values
is json
event data. All the keys in order
must exist in values
.
This endpoint requires your project_api_key
.
URL : https://api.trckrspace.com/usage
Method : POST
Auth required : YES
Auth headers : {'X-Api-Key': '{project_api_key}'}
Data constraints
name | type | data type | description |
---|---|---|---|
order | required | array[string] | The hierarchical order of filter keys in the values json. |
values | required | json object | The json event object. Atleast the keys in order must exist in here. |
For filter keys found in order
they key and value must each have length less
than or equal to 49.
Success Response
Code : 200 OK
Request examples
POST /usage --data '{"order": [{key}], "values": {{key}: {value}}'
Content examples
For a successful response with data:
{
'status': 'OK',
}
Error Responses
POST usage without event
or category
Code : 400 BAD_REQUEST
Notes
- Your
project_api_key
can be found in the manage project section of https://app.trckrspace.com (opens in a new tab) - You can add any additional keys which are supported by JSON data types in the
values
object.