Thrust Carbon

Groupings: Batch Add

POST
/groupings/batch

This add endpoint will create or overwrite a batch of groupings.


Description of grouping endpoints

Grouping endpoints let you set additional details for each grouping key. These additional details are use in other Thrust Carbon products, such as correct grouping names on Thrust Calculator reports or in the Thrust Engage dashboard.

For example, a grouping with key '123' may have the name 'US HR' attached, and a description of 'Human Resources department for United States'. Since the grouping id of '123' is not understandable to most users, the name can be used instead.


Online interface

You may create/read/update/delete groupings manually via your account settings at https://app.thrustcarbon.com


Considerations

  • Please add data in chronological order (e.g. inputting parents before child departments). A child grouping cannot be saved against a parent_id if that parent does not exist.
  • Please make requests to this endpoint sequentially, not concurrently. You otherwise risk inserting an item before its parent is fully loaded.
  • Please use the batch endpoint if you wish to add many groupings. You may otherwise hit our rate-limiter.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/groupings/batch" \  -H "Content-Type: application/json" \  -d '{    "key": "123",    "name": "US HR",    "description": "Human Resources for the United States"  }'
[  {    "valid_departments": {      "0": {        "key": "3852",        "title": "Marketing",        "description": "Marketing team for worldwide operations",        "parent_key": null      },      "1": {        "key": "3852A",        "title": "EU Marketing",        "description": "Marketing team for EU operations",        "parent_key": "3852"      },      "3": {        "key": "3852B",        "title": "US Marketing",        "description": "Marketing team for US operations",        "parent_key": "3852"      }    },    "invalid_departments": {      "2": {        "title": [          "The title field is required."        ]      }    }  }]