How it works
- Record usage — send a usage entry with a meter name and amount whenever a billable or trackable event occurs.
- Query summaries — retrieve aggregated usage and event counts grouped by meter for a given date range.
Record a usage entry
Send a POST request to the meter usage endpoint with the following body:201 response with the created entry:
Validation
- Meter must be a non-empty string.
- Usage must be numeric and greater than 0.
- OccurredAt, if provided, must be a valid Unix timestamp integer.
422 response with details about which fields failed.
Get a usage summary
Send a GET request to the meter usage endpoint withfrom and to query parameters in YYYY-MM-DD format:
Query parameters
The
to date must be on or after the from date. Both parameters are required — omitting either returns a 422 error.Built-in meters
Sailia automatically records usage entries for certain platform events. These meters appear in your usage summaries alongside any custom meters you define — no additional setup is required.Example summary with built-in meters
Built-in meter entries include an
ExtraInfo field with a JSON-encoded payload containing contextual identifiers. You can use these to cross-reference events with other parts of the system.