Auditable Reporting

SQUAKE provides auditable reporting capabilities to bring transparency, traceability, and confidence to your carbon calculations. With Audit Logs, you can retrieve detailed records of each calculation request and its outcome, supporting compliance and verification needs.


✅ What is Audit Logging?

Audit logging is a core feature of the SQUAKE API that creates immutable records of your calculation requests. These logs store details including:

  • Input parameters (e.g., activity type, route, methodology)

  • Results (carbon quantities, units, breakdown per activity if applicable)

  • Methodology references (including document sources and versions)

  • Calculation specifics (e.g., emission factors, distance corrections, assumptions applied)

  • Timestamps of the calculation event


🚀 How do I enable Audit Logging?

Audit logging is automatically included when enabled for your account by your Account Manager. Please contact [email protected] or your dedicated account manager to activate.


🧭 When to Use Audit Mode — Past Activities vs Future / Pre‑booking Activities

Rule of thumb: Past/post‑validated = use audit mode; Future/pre‑booking = no audit mode.

Past Activities (use audit mode)

Finalized, non‑mutable records such as:

  • Ticketed & already‑flown flights

  • Completed hotel stays or trips

  • Backfills of historical data

  • Invoice reconciliation, true‑ups, and post‑issuance corrections

Future / Pre‑booking Activities (do not use audit mode)

Non‑final scenarios expected to change, including:

  • Shopping/quotes and fare searches

  • Draft or tentative itineraries

  • Forecasting, scenario planning, or sandbox testing

  • Points‑of‑sale (POS) value requests and other preview/estimation calls

Audit logs are immutable. Only use them when the calculation is final and must be retained for audit/compliance.

Quick reference

Activity timing
Examples
Audit mode

Past / post‑validated

flown ticket, completed stay, invoice true‑up, historical backfill

Use audit mode

Future / pre‑booking

quote/shopping, draft itinerary, forecast, POS/preview

Do not use


🧩 Operational Notes

  • Post‑booking (post‑validated) calculations MUST be performed with audit mode enabled.

  • Pre‑booking (non‑audit) calculated values must not be carried over into post‑booking reporting; once the activity is finalized, the calculation must be re‑run with audit mode enabled.

  • Requests that handle points‑of‑sale (POS) values MUST be sent without audit mode.


🔗 API Endpoints Overview

Endpoint
Description
Requires Audit Logging Enabled

GET /v2/audits

Retrieve a list of all audit logs for your account

GET /v2/audits/{id}

Retrieve detailed information of a specific audit log


🔐 Authentication

All requests require Bearer Token authentication. Example:

curl --request GET https://api.squake.earth/v2/audits \
 --header "Authorization: Bearer YOUR_ACCESS_TOKEN"

📥 Retrieve Audit Logs List

Retrieve the list of audit logs for your account:

GET https://api.squake.earth/v2/audits

Successful Response Example:

[
  {
    "id": "0194d6b4-8711-7873-899d-c8133cd742f8",
    "request": { "...": "..." },
    "response": { "...": "..." },
    "calculated_at": "2025-02-18T16:39:10Z"
  }
]

📥 Retrieve Specific Audit Log

Retrieve the detailed breakdown of a specific log entry:

GET https://api.squake.earth/v2/audits/{id}

Example Response:

{
  "id": "0194d6b4-8711-7873-899d-c8133cd742f8",
  "request": { "...": "..." },
  "response": { "...": "..." },
  "methodology": { "...": "..." },
  "calculation": { "...": "..." },
  "calculated_at": "2025-02-18T16:39:10Z"
}

💡 Example Calculation Requests

Past Activity (use audit: true)

{
  "expand": ["items"],
  "audit_for": "d3427e0d-5a3c-40ce-842e-5552e77caa4f"
  "items": [
    {
      "audit": true,
      "type": "flight",
      "methodology": "tim",
      "external_reference": "INV-2025-0211-A",
      "origin": "FRA",
      "destination": "JFK",
      "booking_class": "business",
      "airline": "LH"
    },
    {
      "audit": true,
      "type": "hotel",
      "methodology": "HCMI",
      "external_reference": "INV-2025-0211-B",
      "country": "US",
      "stars": 5,
      "number_of_nights": 3
    },
    {
      "audit": true,
      "type": "flight",
      "methodology": "tim",
      "external_reference": "INV-2025-0211-C",
      "origin": "JFK",
      "destination": "FRA",
      "booking_class": "business",
      "airline": "LH"
    }
  ]
}

Future‑Looking Quote (use audit: false or omit the flag)

{
  "expand": ["items"],
  "items": [
    {
      "type": "flight",
      "methodology": "tim",
      "external_reference": "QUOTE-REF-123",
      "origin": "FRA",
      "destination": "JFK",
      "booking_class": "economy",
      "airline": "UA"
    }
  ]
}

🔍 What Data Is Included in an Audit Log?

Section
Details Included

id

Unique audit log ID (UUID)

calculated_at

Timestamp (ISO 8601) when the calculation was performed

request

Input parameters: activity type, origin, destination, methodology, etc.

response

Carbon quantity, unit, detailed per activity if applicable

methodology

Methodology name, version, source URL

calculation

Calculation details: distances, emission factors, corrections, assumptions


📊 Process Flow

flowchart TD
    A[Calculation Request<br/>audit=true for post-booking (post-validated)] --> B[Audit Log Created<br/>with request & response details]
    A2[Calculation Request<br/>pre-booking (no audit)] --> B2[No audit log created]
    B --> C[Retrieve Logs List<br/>GET /v2/audits]
    C --> D[Select Log ID]
    D --> E[Retrieve Full Log Details<br/>GET /v2/audits/:id]
    E --> F[Use for Reporting,<br/>Compliance, Verification]
    B2 --> G[Do not carry pre-booking values into post-booking reporting]

📎 Useful References


Last updated

Was this helpful?