Retrieve a specific Audit log

Retrieve Specific Audit Log

The Audit Log Details API allows authenticated clients to retrieve detailed information about a specific audit log entry using its unique identifier.

Endpoint

GET /v2/audits/{id}

Retrieves the details of a specific audit log entry.

Authentication

  • Requires Bearer Token authentication.

  • Audit logging must be enabled for the account (contact SQUAKE support for activation).

Path Parameters

Parameter
Type
Required
Description

id

string (UUID)

βœ… Yes

The unique identifier of the audit log to retrieve.

Response Structure

Successful Response (200 OK)

Returns a JSON object containing audit log details:

{
  "id": "0194d6b4-8711-7873-899d-c8133cd742f8",
  "request": {
    "type": "flight",
    "origin": "SAF",
    "destination": "ATL",
    "methodology": "ICAO"
  },
  "response": {
    "carbon_unit": "kilogram",
    "carbon_quantity": 302.75
  },
  "methodology": {
    "name": "ICAO",
    "source": "https://applications.icao.int/icec/Methodology%20ICAO%20Carbon%20Emissions%20Calculator_v13_Final.pdf",
    "version": "1.0"
  },
  "calculation": {
    "distance": {
      "original": {
        "distance": 3437.83,
        "distance_unit": "kilometer"
      },
      "corrected": {
        "distance": 3438,
        "distance_unit": "kilometer"
      }
    },
    "emission_factors": {
      "flight_type": "long_haul",
      "co2_per_passenger": 0.5
    }
  },
  "calculated_at": "2025-02-18T16:39:10Z"
}

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 parameters used for the calculation (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: Breakdown of calculation parameters:

    • 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.

Error Handling

Status Code
Meaning

200 OK

The request was successful, and audit details were returned.

404 Not Found

The specified audit log ID does not exist.

Example API Request (cURL)

curl \ 
 --request GET https://api.squake.earth/v2/audits/{id} \ 
 --header "Authorization: Bearer $ACCESS_TOKEN"

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?