# List People with Asset Filtering GET https://api.trebellar.app/api/v2/people Retrieve a list of people with optional filtering by asset assignments. Use the forAssetIds parameter to filter people who are assigned to specific assets (desks, spaces, etc.). Returns complete employee profiles including contact information, employment status, group memberships, and current asset assignments. Reference: https://docs.trebellar.app/api-reference/api-resources/people/list-people ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: List People with Asset Filtering version: endpoint_people.listPeople paths: /api/v2/people: get: operationId: list-people summary: List People with Asset Filtering description: >- Retrieve a list of people with optional filtering by asset assignments. Use the forAssetIds parameter to filter people who are assigned to specific assets (desks, spaces, etc.). Returns complete employee profiles including contact information, employment status, group memberships, and current asset assignments. tags: - - subpackage_people parameters: - name: forAssetIds in: query required: false schema: type: string - name: X-Trebellar-Api-Key in: header required: true schema: type: string responses: '200': description: >- People list retrieved successfully with complete profiles and asset assignments content: application/json: schema: $ref: '#/components/schemas/ListPeopleResponse' '404': description: No people found matching the specified asset filter criteria content: {} components: schemas: AssetId: type: string PeopleEmploymentStatus: type: string enum: - value: active - value: inactive PeopleAddress: type: object properties: raw: type: string postalCode: type: string streetName: type: string city: type: string state: type: string countryIso: type: string PeopleGroupPropertiesOutput: type: object properties: color: type: string PeopleGroup: type: object properties: id: type: string path: type: string parentId: type: string avatarUrl: type: string name: type: string description: type: string properties: $ref: '#/components/schemas/PeopleGroupPropertiesOutput' externalId: type: string required: - id - name PeopleCreatedAt: oneOf: - type: string - type: number format: double PeopleUpdatedAt: oneOf: - type: string - type: number format: double People: type: object properties: id: type: string externalId: type: string assetId: $ref: '#/components/schemas/AssetId' name: type: string hireDate: type: number format: double employmentStatus: $ref: '#/components/schemas/PeopleEmploymentStatus' terminationDate: type: number format: double address: $ref: '#/components/schemas/PeopleAddress' groups: type: array items: $ref: '#/components/schemas/PeopleGroup' createdAt: $ref: '#/components/schemas/PeopleCreatedAt' updatedAt: $ref: '#/components/schemas/PeopleUpdatedAt' required: - id - groups ListPeopleResponse: type: object properties: data: type: array items: $ref: '#/components/schemas/People' required: - data ``` ## SDK Code Examples ```typescript import { TrebellarApiClient } from "@trebellar/api-sdk"; async function main() { const client = new TrebellarApiClient({ environment: "https://api.trebellar.app", }); await client.people.listPeople({}); } main(); ``` ```python from trebellar import TrebellarApi client = TrebellarApi( base_url="https://api.trebellar.app", api_key= ) client.people.list_people() ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.trebellar.app/api/v2/people" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("X-Trebellar-Api-Key", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.trebellar.app/api/v2/people") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["X-Trebellar-Api-Key"] = '' response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.get("https://api.trebellar.app/api/v2/people") .header("X-Trebellar-Api-Key", "") .asString(); ``` ```php request('GET', 'https://api.trebellar.app/api/v2/people', [ 'headers' => [ 'X-Trebellar-Api-Key' => '', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.trebellar.app/api/v2/people"); var request = new RestRequest(Method.GET); request.AddHeader("X-Trebellar-Api-Key", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["X-Trebellar-Api-Key": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.trebellar.app/api/v2/people")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```