For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Trebellar Platform
DocsGuidesAPI Reference
DocsGuidesAPI Reference
  • API Reference
    • Introduction
  • API Resources
      • GETList People with Asset Filtering
      • POSTBatch Create/Update People
      • DELBatch Delete People
      • PATCHBatch Assign People to Assets
      • DELBatch Delete People-Asset Associations
      • PATCHBatch Add People to Groups
      • PATCHBatch Remove People from Groups
Trebellar Platform
LogoLogo
API ResourcesPeople

Batch Create/Update People

||View as Markdown|
POST
https://api.trebellar.app/api/v2/people/batch/upsert
POST
/api/v2/people/batch/upsert
1import { TrebellarApiClient } from "@trebellar/api-sdk";
2
3async function main() {
4 const client = new TrebellarApiClient({
5 apiKey: "YOUR_API_KEY_HERE",
6 });
7 await client.people.upsertPeopleBatch({
8 people: [
9 {
10 externalId: "EMP001",
11 name: "Jane Smith",
12 employmentStatus: "active",
13 },
14 {
15 id: "emp_existing_123",
16 name: "John Updated",
17 employmentStatus: "active",
18 },
19 ],
20 });
21}
22main();
1{
2 "data": [
3 {
4 "id": "string",
5 "groups": [
6 {
7 "id": "string",
8 "name": "string",
9 "status": "PEOPLE_GROUP_STATUS_UNKNOWN",
10 "path": "string",
11 "parentId": "string",
12 "avatarUrl": "string",
13 "description": "string",
14 "properties": {
15 "color": "#FF5722"
16 },
17 "externalId": "string"
18 }
19 ],
20 "externalId": "string",
21 "assetId": "st_sf_tower_01",
22 "name": "string",
23 "hireDate": 1.1,
24 "employmentStatus": "active",
25 "terminationDate": 1.1,
26 "address": {
27 "raw": "123 Main St, Apt 4B, San Francisco, CA 94105",
28 "postalCode": "94105",
29 "streetName": "Main St",
30 "city": "San Francisco",
31 "state": "CA",
32 "countryIso": "US"
33 },
34 "properties": {},
35 "createdAt": "string",
36 "updatedAt": "string"
37 }
38 ]
39}

Create new people or update existing employee records in a single batch operation. Use this for HR system integrations, bulk imports, or synchronized employee data updates. Each person record can include employment details, contact information, and initial group assignments. Existing people are matched by ID and updated; new records without IDs are created.

Was this page helpful?
Previous

List People with Asset Filtering

Next

Batch Delete People

Built with

Authentication

X-Trebellar-Api-Keystring
API Key authentication via header
OR
AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
peoplelist of objectsRequired

Response

All people records processed successfully - existing employees updated and new employees created

datalist of objects

Errors

400
Bad Request Error
500
Internal Server Error