Thrust Carbon

Segment: Add Async

POST
/projects/{projectId}/segments/async

This is the async endpoint. You can create a segment synchronously using the standard Add Segment endpoint.

Adds a new segment to a project asynchronously. This is useful if you want to add segments that will require Thrust Carbon to make slow external lookups (e.g. flight number to aircraft type lookups). Your account manager should be able to advise if you should consider this endpoint.

Your request should be a 'Segment Request' payload. You can see examples of all the segment requests here.

Your response will be a validation exception, or a {'status': 'success'} response.

Once the segment is created, you will receive a webhook containing the segment payload.

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

Request Body

application/json

We have a wide variety of segment request types, which can be explored here.

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

curl -X POST "https://example.com/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/segments/async" \  -H "Content-Type: application/json" \  -d '{    "type": "air",    "origin": {      "iata": "LHR"    },    "destination": {      "iata": "JFK"    },    "travel_class": "business",    "emitted_at": "2020-01-01"  }'
{  "status": "success"}