> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://api.docs.modulards.com/modular-ds-public-api/clients/manage-clients/delete-clients/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.modulards.com/_mcp/server. # Delete clients DELETE https://api.modulards.com/api/public/v1/clients/bulk-destroy Content-Type: application/json Deletes the clients you list in `ids`, up to 50 ids in one call. Every id is checked before anything is deleted. **Body** - `ids` (array of integers, required): ids of the clients to delete, 1 to 50. **Errors** - **404**: an id is not a client you can reach, is a contact, or is a client a collaborator did not create. One such id refuses the whole call and nothing is deleted. - **422**: `ids` is missing, empty, has more than 50 ids or contains an id that does not exist. Reference: https://api.docs.modulards.com/modular-ds-public-api/clients/manage-clients/delete-clients ## Authentication - `Authorization` header (bearer token, required) — Personal access token created in the Modular DS dashboard; read-only tokens can only call GET endpoints. ## Request ### Body (application/json) This endpoint expects an object. - `ids` (list of double, optional) ## Response ### 204 204 - Clients deleted ## Errors ### 404 Not Found Error 404 Not Found - One id is a Contact - `errors` (list of ApiPublicV1ClientsBulkDestroyDeleteResponsesContentApplicationJsonSchemaErrorsItems, optional) - `jsonapi` (ApiPublicV1ClientsBulkDestroyDeleteResponsesContentApplicationJsonSchemaJsonapi, optional) ## Types ### ApiPublicV1ClientsBulkDestroyDeleteResponsesContentApplicationJsonSchemaErrorsItems - `detail` (string, optional) - `status` (string, optional) - `title` (string, optional) ### ApiPublicV1ClientsBulkDestroyDeleteResponsesContentApplicationJsonSchemaJsonapi - `version` (string, optional) ## Examples **Request** ```json { "ids": [ 101, 102 ] } ``` **SDK Code** ```python Delete clients import requests url = "https://api.modulards.com/api/public/v1/clients/bulk-destroy" payload = { "ids": [101, 102] } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Delete clients const url = 'https://api.modulards.com/api/public/v1/clients/bulk-destroy'; const options = { method: 'DELETE', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"ids":[101,102]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Delete clients package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.modulards.com/api/public/v1/clients/bulk-destroy" payload := strings.NewReader("{\n \"ids\": [\n 101,\n 102\n ]\n}") req, _ := http.NewRequest("DELETE", url, payload) req.Header.Add("Authorization", "Bearer ") 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 Delete clients require 'uri' require 'net/http' url = URI("https://api.modulards.com/api/public/v1/clients/bulk-destroy") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"ids\": [\n 101,\n 102\n ]\n}" response = http.request(request) puts response.read_body ``` ```java Delete clients import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.modulards.com/api/public/v1/clients/bulk-destroy") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"ids\": [\n 101,\n 102\n ]\n}") .asString(); ``` ```php Delete clients request('DELETE', 'https://api.modulards.com/api/public/v1/clients/bulk-destroy', [ 'body' => '{ "ids": [ 101, 102 ] }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Delete clients using RestSharp; var client = new RestClient("https://api.modulards.com/api/public/v1/clients/bulk-destroy"); var request = new RestRequest(Method.DELETE); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"ids\": [\n 101,\n 102\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Delete clients import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["ids": [101, 102]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/clients/bulk-destroy")! 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() ```