List all API logs
Changed onThis endpoint retrieves all existing API logs, which represent the requests made to Lago's API. Logs older than the retention period of your organization are left out. The retention period is 30 days unless another one was set for your organization.
Request
- Base URLhttps://api.getlago.com/api/v1
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
Page number. Defaults to 1. A value that is not a positive integer, such as 0, returns the first page.
Number of records per page. Defaults to 100. The maximum is 200, unless another maximum is configured for your organization. A value above the maximum returns a 422 error with value_is_out_of_range on per_page. A value that is not a positive integer, such as 0, returns the default number of records.
Filter API logs logged at or after this date.
Filter API logs logged at or before this date.
Filter results by HTTP methods.
[ "post", "put" ]
Filter results by HTTP status or by generic request status. When succeeded or failed is passed, the numeric values of the filter are ignored.
[ "failed", "succeeded", 404 ]
Filter results by API version.
Filter results by the path of the request. A value containing * is matched as a wildcard, otherwise the path must match exactly.
[ "/api/v1/billable_metrics", "*billable_metrics*" ]
Filter results by the client that issued the request, as reported by its user agent.
[ "Lago Ruby v1.26.0" ]
Response
List of API logs
Example response
{
"api_logs": [
{
"api_version": "v1",
"client": "Lago Ruby v1.26.0",
"http_method": "post",
"http_status": 200,
"logged_at": "2025-03-31T12:31:44Z",
"request_body": {
"billable_metric": "{\"name\":\"Storage\",\"code\":\"storage\"}"
},
"request_origin": "https://api.getlago.com",
"request_path": "/api/v1/billable_metrics",
"created_at": "2022-04-29T08:59:51Z",
"request_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"request_response": {
"billable_metric": "{\"lago_id\":\"b9155544-e261-4e92-b54e-f65d7609294c\"}"
}
}
],
"meta": {
"current_page": 2,
"next_page": 3,
"prev_page": 1,
"total_pages": 4,
"total_count": 70
}
}Changes
- breaking
the response property
//became nullable for the status - breaking
the
//response's property type changed fromstringtoobject, and format fromobjectto no format for status - breaking
the
//response's property format changed fromuuidto no format for status - breaking
the
//response's property type changed fromstringtoobjectnull, and format fromobjectto no format for status - warning
deleted the
queryrequest parameterrequest_paths - warning
added the new
patchenum value to the//response property for the response status - info
added the new optional
queryrequest parameterclients[] - info
added the new optional
queryrequest parameterrequest_paths[] - info
added the enum value
patchto the propertyitems/of thequeryrequest parameterhttp_methods[] - info
added the non-success response with the status
- info
the response property
//became required for the status
- breaking