# List all People Groups GET https://api.trebellar.app/api/v2/people/groups Reference: https://docs.trebellar.app/api-reference/api-resources/people-groups/list-people-groups ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: List all People Groups version: endpoint_peopleGroups.listPeopleGroups paths: /api/v2/people/groups: get: operationId: list-people-groups summary: List all People Groups tags: - - subpackage_peopleGroups parameters: - name: X-Trebellar-Api-Key in: header required: true schema: type: string responses: '200': description: Successful operation content: application/json: schema: $ref: >- #/components/schemas/peopleGroups_listPeopleGroups_Response_200 '404': description: Not Found Error content: {} components: schemas: 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 peopleGroups_listPeopleGroups_Response_200: type: object properties: data: type: array items: $ref: '#/components/schemas/PeopleGroup' 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.peopleGroups.listPeopleGroups(); } main(); ``` ```python from trebellar import TrebellarApi client = TrebellarApi( base_url="https://api.trebellar.app", api_key= ) client.people_groups.list_people_groups() ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.trebellar.app/api/v2/people/groups" 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/groups") 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/groups") .header("X-Trebellar-Api-Key", "") .asString(); ``` ```php request('GET', 'https://api.trebellar.app/api/v2/people/groups', [ 'headers' => [ 'X-Trebellar-Api-Key' => '', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.trebellar.app/api/v2/people/groups"); 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/groups")! 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() ```