Create Travel Data Items
Ingest trip records with nested activities via POST /v2/travel-data.
Push one or more complete trip records into SQUAKE for emissions calculation, reporting, and carbon accounting.
Endpoint
POST /v2/travel-data
POST /v2/travel-dataAuthentication
Bearer Token or HTTP Basic Auth (API key as username, no password).
Content-Type
Content-Type: application/jsonEnvironments
Sandbox
https://api.sandbox.squake.earth
Production
https://api.squake.earth
Request envelope
{
"trips": [ <Trip>, ... ]
}You can send multiple trips per request. Each trip must include at least one activity and a start_date_utc.
Trip fields
activities
array
β
One or more activity objects.
start_date_utc
string (ISO 8601)
β
Trip start date. Format: YYYY-MM-DD.
end_date_utc
string (ISO 8601)
β
Trip end date.
trip_reference
string
β
Your unique ID for this trip. Reusing a trip_reference appends activities to the existing trip rather than creating a new one.
trip_name
string
β
Human-readable label (e.g. "Business trip to London").
trip_purpose
string
β
Purpose of the trip (e.g. "Customer workshop").
trip_status
string
β
Status of the trip (e.g. "completed").
booking_provider
string
β
TMC or booking platform name.
pnr
string
β
Passenger Name Record (common in flight bookings).
amount_in_cents
integer
β
Total trip cost in the smallest currency unit.
currency
string
β
ISO 4217 currency code (e.g. "EUR").
cost_center
object
β
Cost center for attribution. See below.
audit_for
string
β
UUID of an Auditable entity β associates the trip with a legal entity in audit logs.
metadata
object
β
Arbitrary key-value pairs for your own use.
project_reference
string
β
Internal project or campaign reference.
booking_id
string
β
Booking system ID.
external_source
string
β
Name of the external system that created the trip.
external_source_id
string
β
ID of the trip in that external system.
trip_referenceand upsert behaviour If you send a request with atrip_referencethat already exists, the new activities are appended to that trip β no duplicate is created. Useful for incremental imports where segments are ticketed at different times. Omittingtrip_referencecreates a new trip on every call.
Cost center fields
name
string
β
Name of the cost center.
email
string
β
Contact email.
purpose
string
β
Description or purpose.
department
string
β
Department name β available as a filter in the SQUAKE UI.
business_unit
string
β
Business unit.
city
string
β
City.
country_alpha2
string
β
ISO 3166-1 alpha-2 country code (e.g. "DE").
Activity fields
All activities share a common base, then add type-specific fields.
Common fields
type
string
β
flight, hotel, car, or train.
methodology
string
β
Calculation methodology for this activity type.
external_reference
string
β
Your reference ID for this leg β echoed back in the response.
start_date_utc
string
β
Activity start date (YYYY-MM-DD).
end_date_utc
string
β
Activity end date (YYYY-MM-DD).
traveler
object
β
Traveler attached to this activity.
Traveler fields
name
string
β
Full name.
email
string
β
Email address.
traveler_type
string
β
employee, contractor, or guest.
department
string
β
Traveler's department.
Flight-specific fields
origin
IATA airport code (e.g. "BER").
destination
IATA airport code (e.g. "LHR").
airline
IATA airline code (e.g. "LH").
flight_number
Flight number (e.g. "LH2472").
booking_class
economy, premium_economy, business, or first.
departure_date
Departure date (YYYY-MM-DD).
number_of_travelers
Passenger count.
Methodologies: ADEME, BASE-EMPREINTE, CO2-EMISSIEFACTOREN-NL, DEFRA, GATE4, ICAO, TIM, TU-CHALMERS, US-EPA.
Hotel-specific fields
name
Hotel name β supports supplier analytics in the SQUAKE UI.
country
ISO 3166-1 alpha-2 country code (e.g. "GB").
city
City name.
number_of_nights
Length of stay.
number_of_travelers
Guest count.
stars
Star rating (used by some methodologies).
Methodologies: DEFRA, HCMI, GREENVIEW.
Car-specific fields
origin
Pickup location (free-text address, e.g. "London Heathrow Airport, United Kingdom").
destination
Drop-off location.
fuel_type
e.g. diesel, petrol, hev, electricity.
car_type
e.g. average, large.
usage_type
rental, taxi, company, or personal_car. Determines GHG scope.
provider_company
Rental or ride-hailing company (e.g. "Hertz", "Uber").
number_of_days
Rental duration in days.
Methodologies: ACRISS, BASIC, DEFRA, EU-EEA, US-EPA.
Train-specific fields
origin
Origin station or city.
destination
Destination station or city.
number_of_travelers
Passenger count.
train_type
e.g. high_speed, mainline, light, international.
fare_class
e.g. first_class, second_class.
fuel_type
Fuel type if applicable.
operator_name
Operator identifier (e.g. "sncf", "db").
Methodologies: ADEME, BASE-EMPREINTE, CO2-EMISSIEFACTOREN-NL, DEFRA, GREEN-TRAVEL-PLEDGE, SQUAKE, US-EPA.
Request example
A complete business trip: outbound flight BER β LHR, hotel in London, taxi from Heathrow, and the return flight.
Response
200 OK β Example
Response fields
carbon_quantity
Total emissions across all activities, in carbon_unit.
carbon_unit
Unit for all carbon values β typically kilogram.
items
Per-activity breakdown, one entry per activity in the request.
items[].external_reference
Echoed from your request β use this to match results to input.
items[].type
Activity type (flight, hotel, car, train).
items[].carbon_quantity
Emissions for this activity.
items[].distance
Calculated or geocoded distance (where applicable).
items[].methodology
Detailed breakdown: carbon, distance, emission factors, methodology name.
items[].methodology.errors
Present only if this activity could not be calculated.
Errors
200
Success β check methodology.errors per item for partial failures.
400
Malformed request or missing required field.
401
Missing or invalid API key.
500
Internal server error.
cURL
Implementation notes
Always set external_reference on every activity. It is the only way to reliably match response items to your input records, and it makes debugging much easier.
Dates use ISO 8601 (YYYY-MM-DD). The _utc suffix means SQUAKE stores and interprets them as UTC. For same-day legs, start_date_utc and end_date_utc may be identical.
trip_reference is your idempotency key for trip identity. Reuse it to incrementally add activities to a trip as segments get ticketed. Omit it to always create a new trip.
usage_type determines GHG scope for car activities. Use rental or taxi for Scope 3.6 (third-party vehicles), company for Scope 1 (company fleet), and personal_car for Scope 3.6 (employee reimbursement).
Partial failures don't fail the whole request. An activity with an unrecognised or missing field returns methodology.errors β the HTTP status is still 200. Check each item individually in error-sensitive workflows.
Last updated