# Bulk Seat Assignments by People Group POST https://api.trebellar.app/api/v2/assets/seat-assignments/bulk Content-Type: application/json Set shared and dedicated seat assignment counts by people group for one or more assets in a single batch request. Reference: https://docs.trebellar.app/api-reference/api-resources/assets/bulk-seat-assignments ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Bulk Seat Assignments by People Group version: endpoint_assets.bulkSeatAssignments paths: /api/v2/assets/seat-assignments/bulk: post: operationId: bulk-seat-assignments summary: Bulk Seat Assignments by People Group description: >- Set shared and dedicated seat assignment counts by people group for one or more assets in a single batch request. tags: - - subpackage_assets parameters: - name: X-Trebellar-Api-Key in: header required: true schema: type: string responses: '200': description: Seat assignments updated successfully content: application/json: schema: $ref: '#/components/schemas/BulkSeatAssignmentsResponse' '400': description: Bad Request Error content: {} '500': description: Internal Server Error content: {} requestBody: content: application/json: schema: $ref: '#/components/schemas/BulkSeatAssignmentsRequest' components: schemas: GenericId: type: string SeatsAssigned: type: object properties: shared: type: integer dedicated: type: integer required: - shared - dedicated SeatAssignmentByGroup: type: object properties: id: $ref: '#/components/schemas/GenericId' peopleGroupId: type: string seatsAssigned: $ref: '#/components/schemas/SeatsAssigned' required: - id - peopleGroupId - seatsAssigned BulkSeatAssignmentsRequest: type: object properties: assignments: type: array items: $ref: '#/components/schemas/SeatAssignmentByGroup' timestampMs: type: number format: double required: - assignments BulkSeatAssignmentsResponse: type: object properties: success: type: boolean updatedCount: type: integer required: - success ``` ## SDK Code Examples ```typescript import { TrebellarApiClient } from "@trebellar/api-sdk"; async function main() { const client = new TrebellarApiClient({ environment: "https://api.trebellar.app", }); await client.assets.bulkSeatAssignments({ assignments: [ { id: "eid:sfo-001", peopleGroupId: "string", seatsAssigned: { shared: 1, dedicated: 1, }, }, ], }); } main(); ``` ```python from trebellar import TrebellarApi client = TrebellarApi( base_url="https://api.trebellar.app", api_key= ) client.assets.bulk_seat_assignments( assignments=[ { "id": "eid:sfo-001", "people_group_id": "string", "seats_assigned": { "shared": 1, "dedicated": 1 } } ] ) ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.trebellar.app/api/v2/assets/seat-assignments/bulk" payload := strings.NewReader("{\n \"assignments\": [\n {\n \"id\": \"eid:sfo-001\",\n \"peopleGroupId\": \"string\",\n \"seatsAssigned\": {\n \"shared\": 1,\n \"dedicated\": 1\n }\n }\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-Trebellar-Api-Key", "") req.Header.Add("Content-Type", "application/json") 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/assets/seat-assignments/bulk") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-Trebellar-Api-Key"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"assignments\": [\n {\n \"id\": \"eid:sfo-001\",\n \"peopleGroupId\": \"string\",\n \"seatsAssigned\": {\n \"shared\": 1,\n \"dedicated\": 1\n }\n }\n ]\n}" response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.post("https://api.trebellar.app/api/v2/assets/seat-assignments/bulk") .header("X-Trebellar-Api-Key", "") .header("Content-Type", "application/json") .body("{\n \"assignments\": [\n {\n \"id\": \"eid:sfo-001\",\n \"peopleGroupId\": \"string\",\n \"seatsAssigned\": {\n \"shared\": 1,\n \"dedicated\": 1\n }\n }\n ]\n}") .asString(); ``` ```php request('POST', 'https://api.trebellar.app/api/v2/assets/seat-assignments/bulk', [ 'body' => '{ "assignments": [ { "id": "eid:sfo-001", "peopleGroupId": "string", "seatsAssigned": { "shared": 1, "dedicated": 1 } } ] }', 'headers' => [ 'Content-Type' => 'application/json', 'X-Trebellar-Api-Key' => '', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.trebellar.app/api/v2/assets/seat-assignments/bulk"); var request = new RestRequest(Method.POST); request.AddHeader("X-Trebellar-Api-Key", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"assignments\": [\n {\n \"id\": \"eid:sfo-001\",\n \"peopleGroupId\": \"string\",\n \"seatsAssigned\": {\n \"shared\": 1,\n \"dedicated\": 1\n }\n }\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-Trebellar-Api-Key": "", "Content-Type": "application/json" ] let parameters = ["assignments": [ [ "id": "eid:sfo-001", "peopleGroupId": "string", "seatsAssigned": [ "shared": 1, "dedicated": 1 ] ] ]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.trebellar.app/api/v2/assets/seat-assignments/bulk")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data 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() ```