# Batch Delete People DELETE https://api.trebellar.app/api/v2/people/batch/delete Content-Type: application/json Permanently remove multiple employee records by their IDs. This operation also removes all associated asset assignments and group memberships. Use with caution as this action cannot be undone. Consider updating employment status to inactive instead of deletion for audit trail purposes. Reference: https://docs.trebellar.app/api-reference/api-resources/people/delete-people-batch ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Batch Delete People version: endpoint_people.deletePeopleBatch paths: /api/v2/people/batch/delete: delete: operationId: delete-people-batch summary: Batch Delete People description: >- Permanently remove multiple employee records by their IDs. This operation also removes all associated asset assignments and group memberships. Use with caution as this action cannot be undone. Consider updating employment status to inactive instead of deletion for audit trail purposes. tags: - - subpackage_people parameters: - name: X-Trebellar-Api-Key in: header required: true schema: type: string responses: '200': description: >- All specified people records deleted successfully along with their assignments content: application/json: schema: $ref: '#/components/schemas/DeletePeopleBatchResponse' '400': description: Bad Request Error content: {} '404': description: Not Found Error content: {} '500': description: Internal Server Error content: {} requestBody: content: application/json: schema: $ref: '#/components/schemas/DeletePeopleBatchRequest' components: schemas: DeletePeopleBatchRequest: type: object properties: peopleIds: type: array items: type: string required: - peopleIds DeletePeopleBatchResponseData: type: object properties: {} DeletePeopleBatchResponse: type: object properties: data: $ref: '#/components/schemas/DeletePeopleBatchResponseData' 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.deletePeopleBatch({ peopleIds: [ "string", ], }); } main(); ``` ```python from trebellar import TrebellarApi client = TrebellarApi( base_url="https://api.trebellar.app", api_key= ) client.people.delete_people_batch( people_ids=[ "string" ] ) ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.trebellar.app/api/v2/people/batch/delete" payload := strings.NewReader("{\n \"peopleIds\": [\n \"string\"\n ]\n}") req, _ := http.NewRequest("DELETE", 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/people/batch/delete") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) request["X-Trebellar-Api-Key"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"peopleIds\": [\n \"string\"\n ]\n}" response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.delete("https://api.trebellar.app/api/v2/people/batch/delete") .header("X-Trebellar-Api-Key", "") .header("Content-Type", "application/json") .body("{\n \"peopleIds\": [\n \"string\"\n ]\n}") .asString(); ``` ```php request('DELETE', 'https://api.trebellar.app/api/v2/people/batch/delete', [ 'body' => '{ "peopleIds": [ "string" ] }', 'headers' => [ 'Content-Type' => 'application/json', 'X-Trebellar-Api-Key' => '', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.trebellar.app/api/v2/people/batch/delete"); var request = new RestRequest(Method.DELETE); request.AddHeader("X-Trebellar-Api-Key", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"peopleIds\": [\n \"string\"\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-Trebellar-Api-Key": "", "Content-Type": "application/json" ] let parameters = ["peopleIds": ["string"]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.trebellar.app/api/v2/people/batch/delete")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "DELETE" 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() ```