> 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.

# Detach contacts

POST https://api.modulards.com/api/public/v1/alerts/{alert_id}/contacts/detach

Removes an explicit selection of Contact associations from the configuration; the twin of \"Sync contacts\". Answers **200** the same way: `meta.status`, `meta.updated` and `meta.skipped`.\n\n**Body** (JSON):\n- `contacts` (array of Contact ids, required, 1 to 50), validated for existence only.\n\nRequires a full-access token (read-only tokens answer 403). Body validation runs before authorization: a foreign configuration with an invalid body (e.g. missing `contacts`) answers 422; only a foreign configuration with a valid body answers 404.

Reference: https://api.docs.modulards.com/modular-ds-public-api/notification-configurations/detach-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

### Path parameters

- `alert_id` (string, required)

## Response

### 200

200 - Contact removed

- `jsonapi` (ApiPublicV1AlertsAlertIdContactsDetachPostResponsesContentApplicationJsonSchemaJsonapi, optional)
- `meta` (ApiPublicV1AlertsAlertIdContactsDetachPostResponsesContentApplicationJsonSchemaMeta, optional)

## Types

### ApiPublicV1AlertsAlertIdContactsDetachPostResponsesContentApplicationJsonSchemaJsonapi

- `version` (string, optional)

### ApiPublicV1AlertsAlertIdContactsDetachPostResponsesContentApplicationJsonSchemaMeta

- `skipped` (list of any, optional)
- `status` (string, optional)
- `updated` (list of ApiPublicV1AlertsAlertIdContactsDetachPostResponsesContentApplicationJsonSchemaMetaUpdatedItems, optional)

### ApiPublicV1AlertsAlertIdContactsDetachPostResponsesContentApplicationJsonSchemaMetaUpdatedItems

- `contact_id` (double, optional)
- `site_id` (any, optional, nullable)
- `site_name` (any, optional, nullable)

## Examples

**Response**

```json
{
  "jsonapi": {
    "version": "1.1"
  },
  "meta": {
    "skipped": [],
    "status": "applied",
    "updated": [
      {
        "contact_id": 7,
        "site_id": null,
        "site_name": null
      }
    ]
  }
}
```

**SDK Code**

```python 200 - Contact removed
import requests

url = "https://api.modulards.com/api/public/v1/alerts/alert_id/contacts/detach"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript 200 - Contact removed
const url = 'https://api.modulards.com/api/public/v1/alerts/alert_id/contacts/detach';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

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

```go 200 - Contact removed
package main

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

func main() {

	url := "https://api.modulards.com/api/public/v1/alerts/alert_id/contacts/detach"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 200 - Contact removed
require 'uri'
require 'net/http'

url = URI("https://api.modulards.com/api/public/v1/alerts/alert_id/contacts/detach")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java 200 - Contact removed
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.modulards.com/api/public/v1/alerts/alert_id/contacts/detach")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php 200 - Contact removed
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.modulards.com/api/public/v1/alerts/alert_id/contacts/detach', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp 200 - Contact removed
using RestSharp;

var client = new RestClient("https://api.modulards.com/api/public/v1/alerts/alert_id/contacts/detach");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift 200 - Contact removed
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/alerts/alert_id/contacts/detach")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```