Thrust Carbon

Traveller Groupings: Add

POST
/traveller-groupings

When reporting on travel data, it's useful to be able to group and categorize segments. Groupings are an easy and a flexible way for you to attach categories and structure your data. An example of a grouping type might be 'Departments', and a few of those groupings might be 'Sales', 'Engineering', 'Product'.

We provide tooling to attach groupings directly to your segments as they are added. However, sometimes these groupings can be missing, or inconsistent. Traveller groupings are a way for you to associate particular groupings to a given traveller, meaning that whenever we receive a segment for that given traveller, we will automatically associate the groupings relevant to that traveller.

Request Body

application/json

Enter the employee ID as the traveller_ref field.

In the context of a live feed, the standard use case will be to only pass a traveller_ref, grouping_type_slug and key. This will create a traveller grouping record with a start date of the current date, and any future created segments for this traveller will automatically have the given grouping associated.

When an employee leaves the company, send a key value of null. This will set an end_date to any existing traveller grouping records.

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/traveller-groupings" \  -H "Content-Type: application/json" \  -d '{    "traveller_ref": "string",    "start_date": "2024-01-01",    "end_date": null,    "grouping_type_id": 817,    "grouping": "143223"  }'
{  "id": 1423,  "traveller_ref": "string",  "start_date": "2024-01-01",  "end_date": null,  "grouping_type_id": 817,  "grouping": "143223"}