Retrieve the list of Audit logs
Retrieving Audit Logs
The Audit Logs API allows authenticated clients to retrieve logs for calculation requests when audit logging is enabled. This feature provides transparency by storing details of each calculation, including inputs, results, and methodology references.
Endpoint
GET /v2/audits
Retrieves a list of audit logs for the authenticated client.
Authentication
Requires Bearer Token authentication.
Audit logging must be enabled for the account (contact SQUAKE support for activation).
Response Structure
Successful Response (200 OK)
Returns an array of audit log entries with the following structure:
Key Attributes
General Information
id
(UUID): Unique identifier for the audit log.calculated_at
(ISO 8601): Timestamp of when the calculation was performed.
Request Details
request
: Contains the original parameters used in the calculation request (e.g., type, origin, destination, methodology).
Response Details
response
: Stores the carbon emissions results, including:carbon_quantity
: Total emissions calculated.carbon_unit
: The unit of measurement (e.g., kilogram).
Calculation Details
calculation
: Additional breakdown of calculation parameters, including:distance
: The original and corrected distances used.emission_factors
: Methodology-specific emission factors.
Methodology Information
methodology
: Metadata about the calculation methodology, including:name
: Methodology used (e.g., ICAO, DEFRA).version
: Version of the methodology applied.source
: URL linking to the official methodology documentation.
How to Use the API
Example Request (cURL)
Enabling Audit Logging
Audit logs are available only if this feature is enabled for your account. Contact SQUAKE support to activate audit logging.
For more details, refer to the official SQUAKE API documentation.
Last updated
Was this helpful?