Thrust Carbon

Segment: Update

PUT
/projects/{projectId}/segments/{segmentId}

Updates an existing segment.

Want access to emissions data without a Thrust Calculator subscription? You should use our emissions API instead, which is a cheaper, non-persistent way to access emissions.

AuthorizationBearer <token>

Your API Key must be provided as a bearer token. To do this, create an 'Authorization' header with a value of 'Bearer {your-api-key}' (e.g. "Authorization: Bearer xcvboy23idvh").

In: header

Path Parameters

projectId*string
Formatuuid
segmentId*string
Formatuuid

Request Body

application/json

Please ignore the fields that say they are required. These fields are not required on a PUT operation.

TypeScript Definitions

Use the request body type in TypeScript.

Note: we are constantly adding more segment request types all the time, and our documentation may lag this. Please reach out to your account manager if you believe a segment type is missing.

Response Body

application/json

curl -X PUT "https://example.com/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/segments/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{    "type": "air",    "passengers": 1,    "travel_class": "economy",    "carrier": "BA",    "aircraft_type": "788",    "flight_number": "BA 112",    "record_locator": "D89BE",    "grouping": {      "cost-centre": [        "12345"      ]    },    "emitted_at": "2021-01-09",    "traveller_ref": "JOE-BLOGG-1",    "metadata": {      "invoice-number": "0081214"    },    "price": 120,    "price_currency": "USD",    "origin": {      "iata": "LHR"    },    "destination": {      "iata": "JFK"    }  }'
{  "id": "d4a8d9b4-6cf7-4b86-8804-36652a1a1e72",  "type": "air",  "passengers": 1,  "travel_class": "economy",  "carrier": "BA",  "aircraft_type": "788",  "flight_number": "BA 112",  "grouping": {    "{grouping-type-slug}": [      "string"    ]  },  "emitted_at": "2021-01-09",  "traveller_ref": "string",  "metadata": {    "key": "string"  },  "price": 0,  "price_currency": "USD,GBP",  "origin": {    "iata": "LHR"  },  "destination": {    "iata": "JFK"  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "tonnes_of_emissions": 0}