> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.docs.modulards.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.modulards.com/_mcp/server.

# Bulk destroy contacts

DELETE https://api.modulards.com/api/public/v1/contacts/bulk-destroy
Content-Type: application/json

Deletes (soft) an explicit selection of Contacts. Answers **204** with no body.

**Body** (JSON):
- `ids` (integer array, required, 1 to 50) - exact contact ids.

Every id is resolved through the organization-scoped query and authorized one by one before anything is deleted: an id that is unreachable, a Client, or not deletable by the actor (a collaborator's selection includes a Contact they did not create) fails the **whole call** as 404 and nothing is deleted. Requires a full-access token.

Reference: https://api.docs.modulards.com/modular-ds-public-api/contacts/bulk-destroy-contacts

## 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 - Contacts deleted

## Errors

### 404 Not Found Error

404 Not Found - One id is a Client

- `errors` (list of ApiPublicV1ContactsBulkDestroyDeleteResponsesContentApplicationJsonSchemaErrorsItems, optional)
- `jsonapi` (ApiPublicV1ContactsBulkDestroyDeleteResponsesContentApplicationJsonSchemaJsonapi, optional)

## Types

### ApiPublicV1ContactsBulkDestroyDeleteResponsesContentApplicationJsonSchemaErrorsItems

- `detail` (string, optional)
- `status` (string, optional)
- `title` (string, optional)

### ApiPublicV1ContactsBulkDestroyDeleteResponsesContentApplicationJsonSchemaJsonapi

- `version` (string, optional)

## Examples

**Request**

```json
{
  "ids": [
    201,
    202
  ]
}
```

**SDK Code**

```python Bulk destroy contacts
import requests

url = "https://api.modulards.com/api/public/v1/contacts/bulk-destroy"

payload = { "ids": [201, 202] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.delete(url, json=payload, headers=headers)

print(response.json())
```

```javascript Bulk destroy contacts
const url = 'https://api.modulards.com/api/public/v1/contacts/bulk-destroy';
const options = {
  method: 'DELETE',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"ids":[201,202]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Bulk destroy contacts
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.modulards.com/api/public/v1/contacts/bulk-destroy"

	payload := strings.NewReader("{\n  \"ids\": [\n    201,\n    202\n  ]\n}")

	req, _ := http.NewRequest("DELETE", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	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 Bulk destroy contacts
require 'uri'
require 'net/http'

url = URI("https://api.modulards.com/api/public/v1/contacts/bulk-destroy")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"ids\": [\n    201,\n    202\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Bulk destroy contacts
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.modulards.com/api/public/v1/contacts/bulk-destroy")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"ids\": [\n    201,\n    202\n  ]\n}")
  .asString();
```

```php Bulk destroy contacts
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.modulards.com/api/public/v1/contacts/bulk-destroy', [
  'body' => '{
  "ids": [
    201,
    202
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Bulk destroy contacts
using RestSharp;

var client = new RestClient("https://api.modulards.com/api/public/v1/contacts/bulk-destroy");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"ids\": [\n    201,\n    202\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Bulk destroy contacts
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["ids": [201, 202]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/contacts/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()
```