> 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/notification-configurations/configuration-contacts/remove-contacts-from-a-notification-configuration/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.modulards.com/_mcp/server. # Remove contacts from a notification configuration POST https://api.modulards.com/api/public/v1/alerts/{alert_id}/contacts/detach Content-Type: application/json Removes the contacts you list in `contacts` from a notification configuration. It is the counterpart of "Add contacts to a notification configuration" and answers the same way. **Body** - `contacts` (array of integers, required): ids of the contacts to remove, 1 to 50. Each must be an existing contact. **Errors** - **422**: `contacts` is missing, empty, has more than 50 ids or contains an id that is not a contact. The body is checked before the configuration, so a configuration of another organization answers 404 only when the body is valid. Reference: https://api.docs.modulards.com/modular-ds-public-api/notification-configurations/configuration-contacts/remove-contacts-from-a-notification-configuration ## 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) ### Body (application/json) This endpoint expects an object. - `contacts` (list of double, optional) ## Response ### 200 200 - Contact removed - `jsonapi` (ApiPublicV1AlertsAlertIdContactsDetachPostResponsesContentApplicationJsonSchemaJsonapi, optional) - `meta` (ApiPublicV1AlertsAlertIdContactsDetachPostResponsesContentApplicationJsonSchemaMeta, optional) ## Types ### ApiPublicV1AlertsAlertIdContactsDetachPostResponsesContentApplicationJsonSchemaJsonapi - `version` (string, optional) ### ApiPublicV1AlertsAlertIdContactsDetachPostResponsesContentApplicationJsonSchemaMeta - `skipped` (list of ApiPublicV1AlertsAlertIdContactsDetachPostResponsesContentApplicationJsonSchemaMetaSkippedItems, optional) - `status` (enum, optional) — `applied` when at least one entry changed, `skipped` when none did. - Allowed values: `applied`, `skipped` - `updated` (list of ApiPublicV1AlertsAlertIdContactsDetachPostResponsesContentApplicationJsonSchemaMetaUpdatedItems, optional) ### ApiPublicV1AlertsAlertIdContactsDetachPostResponsesContentApplicationJsonSchemaMetaSkippedItems - `site_id` (integer, optional, nullable) — Id of the website that was skipped. Always null here. - `site_name` (string, optional, nullable) — Always null here. - `contact_id` (integer, optional, nullable) — Id of the contact that was skipped. - `reason_code` (string, optional) — `ALREADY_APPLIED` or `PERMISSION_DENIED`. - `message` (string, optional) — Sentence explaining the reason. ### ApiPublicV1AlertsAlertIdContactsDetachPostResponsesContentApplicationJsonSchemaMetaUpdatedItems - `contact_id` (integer, optional) — Id of the contact that changed. - `site_id` (integer, optional, nullable) — Id of the website that changed. Always null here. - `site_name` (string, optional, nullable) — Name of the website that changed. Always null here. ## Examples ### 200 - Contact removed **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 "} 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 '}}; 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 ") 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 ' 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 response = Unirest.post("https://api.modulards.com/api/public/v1/alerts/alert_id/contacts/detach") .header("Authorization", "Bearer ") .asString(); ``` ```php 200 - Contact removed request('POST', 'https://api.modulards.com/api/public/v1/alerts/alert_id/contacts/detach', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); 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 "); IRestResponse response = client.Execute(request); ``` ```swift 200 - Contact removed import Foundation let headers = ["Authorization": "Bearer "] 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() ``` ### Remove contacts from a notification configuration **Request** ```json { "contacts": [ 8 ] } ``` **Response** ```json { "jsonapi": { "version": "1.1" }, "meta": { "skipped": [], "status": "applied", "updated": [ { "contact_id": 7, "site_id": null, "site_name": null } ] } } ``` **SDK Code** ```python Remove contacts from a notification configuration import requests url = "https://api.modulards.com/api/public/v1/alerts/alert_id/contacts/detach" payload = { "contacts": [8] } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Remove contacts from a notification configuration const url = 'https://api.modulards.com/api/public/v1/alerts/alert_id/contacts/detach'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"contacts":[8]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Remove contacts from a notification configuration package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.modulards.com/api/public/v1/alerts/alert_id/contacts/detach" payload := strings.NewReader("{\n \"contacts\": [\n 8\n ]\n}") req, _ := http.NewRequest("POST", 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 Remove contacts from a notification configuration 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 ' request["Content-Type"] = 'application/json' request.body = "{\n \"contacts\": [\n 8\n ]\n}" response = http.request(request) puts response.read_body ``` ```java Remove contacts from a notification configuration import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.modulards.com/api/public/v1/alerts/alert_id/contacts/detach") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"contacts\": [\n 8\n ]\n}") .asString(); ``` ```php Remove contacts from a notification configuration request('POST', 'https://api.modulards.com/api/public/v1/alerts/alert_id/contacts/detach', [ 'body' => '{ "contacts": [ 8 ] }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Remove contacts from a notification configuration 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 "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"contacts\": [\n 8\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Remove contacts from a notification configuration import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["contacts": [8]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) 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 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() ```