Access API usage logs for monitoring, auditing, and insights
The Clara Logs API offers structured access to historical API logs, allowing clients to retrieve request-level data and usage statistics within a defined temporal scope. This is especially useful for monitoring, auditing, billing analytics, and debugging purposes.
๐ Access Control
- Logs API access is restricted by design.
- Requests must include date-based filters: year, month, and optionally day.
- No endpoint available to list all logs without any time constraint.
๐ Endpoints Overview
Endpoint | Description |
---|---|
/api/v1/logs/yyyy/MM | Get logs for a specific month (year and month required). |
/api/v1/logs/yyyy/MM/dd | Get logs for a specific day. |
/api/v1/logs/current | Get logs for the current month. |
๐ Filtering Rules
- year and month required
- day-level filtering is optional
- No wildcard or unbounded access to the full log history.
This structure ensures controlled data volumes and better performance.
๐ฆ Response Structure
Every response contains two main components:
1๏ธโฃ Stats:
total
: Total number of requestschargeable
: Number of requests marked as chargeablenonChargeable
: Requests that are not chargeable
2๏ธโฃ Requests (list of detailed logs):
id
: Unique identifier of the log entryresponseStatus
: HTTP status code returnedprojectTokenId
: Project identifier for the requestrequestUri
: URI requested by the clientmethod
: HTTP method used (GET, POST, etc)chargeable
: Boolean flag indicating billing impactinstant
: Timestamp of the request (epoch milliseconds)
๐งพ Example Response
{
"stats": {
"total": 1,
"chargeable": 1,
"nonChargeable": 0
},
"requests": [
{
"id": "1",
"responseStatus": "200",
"projectTokenId": "project-123",
"requestUri": "/api/v1/charge",
"method": "POST",
"chargeable": true,
"instant": 123141241
}
]
}