> 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-websites/remove-websites-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 websites from a notification configuration POST https://api.modulards.com/api/public/v1/alerts/{alert_id}/sites/detach Content-Type: application/json Removes the websites you list in `sites` from a notification configuration. It is the counterpart of "Add websites to a notification configuration" and answers the same way. `meta.status` is `applied` when at least one website was removed and `skipped` when none was. Websites that cannot be processed are reported in `meta.skipped`, each with a `reason_code` and a message, and do not fail the call. A website is skipped as `ALREADY_APPLIED` when it is not in the configuration, and as `PERMISSION_DENIED` (with a null `site_name`) when your token cannot reach it; a member who reaches only some websites leaves the others in place. **Body** - `sites` (array of integers, required): ids of the websites to remove, 1 to 50. Each must be an existing website. **Errors** - **422**: `sites` is missing, empty, has more than 50 ids or contains an id that is not a website. 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-websites/remove-websites-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. - `sites` (list of double, optional) ## Response ### 200 200 - Website removed - `jsonapi` (ApiPublicV1AlertsAlertIdSitesDetachPostResponsesContentApplicationJsonSchemaJsonapi, optional) - `meta` (ApiPublicV1AlertsAlertIdSitesDetachPostResponsesContentApplicationJsonSchemaMeta, optional) ## Errors ### 404 Not Found Error 404 - Foreign configuration - `errors` (list of ApiPublicV1AlertsAlertIdSitesDetachPostResponsesContentApplicationJsonSchemaErrorsItems, optional) - `jsonapi` (ApiPublicV1AlertsAlertIdSitesDetachPostResponsesContentApplicationJsonSchemaJsonapi, optional) ## Types ### ApiPublicV1AlertsAlertIdSitesDetachPostResponsesContentApplicationJsonSchemaJsonapi - `version` (string, optional) ### ApiPublicV1AlertsAlertIdSitesDetachPostResponsesContentApplicationJsonSchemaMeta - `skipped` (list of ApiPublicV1AlertsAlertIdSitesDetachPostResponsesContentApplicationJsonSchemaMetaSkippedItems, optional) - `status` (enum, optional) — `applied` when at least one entry changed, `skipped` when none did. - Allowed values: `applied`, `skipped` - `updated` (list of ApiPublicV1AlertsAlertIdSitesDetachPostResponsesContentApplicationJsonSchemaMetaUpdatedItems, optional) ### ApiPublicV1AlertsAlertIdSitesDetachPostResponsesContentApplicationJsonSchemaErrorsItems - `detail` (string, optional) - `status` (string, optional) - `title` (string, optional) ### ApiPublicV1AlertsAlertIdSitesDetachPostResponsesContentApplicationJsonSchemaMetaSkippedItems - `site_id` (integer, optional, nullable) — Id of the website that was skipped. - `site_name` (string, optional, nullable) — Name of the skipped website; null when it is outside your reach. - `alert_id` (integer, optional, nullable) — Id of the notification configuration; null when the website is outside your reach. - `reason_code` (string, optional) — `ALREADY_APPLIED` or `PERMISSION_DENIED`. - `message` (string, optional) — Sentence explaining the reason. ### ApiPublicV1AlertsAlertIdSitesDetachPostResponsesContentApplicationJsonSchemaMetaUpdatedItems - `alert_id` (integer, optional) — Id of the notification configuration. - `site_id` (integer, optional, nullable) — Id of the website that changed. - `site_name` (string, optional, nullable) — Name of the website that changed. ## Examples ### 200 - Website removed **Response** ```json { "jsonapi": { "version": "1.1" }, "meta": { "skipped": [], "status": "applied", "updated": [ { "alert_id": 12, "site_id": 12, "site_name": "Reachable" } ] } } ``` **SDK Code** ```python 200 - Website removed import requests url = "https://api.modulards.com/api/public/v1/alerts/alert_id/sites/detach" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript 200 - Website removed const url = 'https://api.modulards.com/api/public/v1/alerts/alert_id/sites/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 - Website removed package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.modulards.com/api/public/v1/alerts/alert_id/sites/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 - Website removed require 'uri' require 'net/http' url = URI("https://api.modulards.com/api/public/v1/alerts/alert_id/sites/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 - Website 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/sites/detach") .header("Authorization", "Bearer ") .asString(); ``` ```php 200 - Website removed request('POST', 'https://api.modulards.com/api/public/v1/alerts/alert_id/sites/detach', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp 200 - Website removed using RestSharp; var client = new RestClient("https://api.modulards.com/api/public/v1/alerts/alert_id/sites/detach"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift 200 - Website removed import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/alerts/alert_id/sites/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 websites from a notification configuration **Request** ```json { "sites": [ 34 ] } ``` **Response** ```json { "jsonapi": { "version": "1.1" }, "meta": { "skipped": [], "status": "applied", "updated": [ { "alert_id": 12, "site_id": 12, "site_name": "Reachable" } ] } } ``` **SDK Code** ```python Remove websites from a notification configuration import requests url = "https://api.modulards.com/api/public/v1/alerts/alert_id/sites/detach" payload = { "sites": [34] } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Remove websites from a notification configuration const url = 'https://api.modulards.com/api/public/v1/alerts/alert_id/sites/detach'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"sites":[34]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Remove websites 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/sites/detach" payload := strings.NewReader("{\n \"sites\": [\n 34\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 websites from a notification configuration require 'uri' require 'net/http' url = URI("https://api.modulards.com/api/public/v1/alerts/alert_id/sites/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 \"sites\": [\n 34\n ]\n}" response = http.request(request) puts response.read_body ``` ```java Remove websites 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/sites/detach") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"sites\": [\n 34\n ]\n}") .asString(); ``` ```php Remove websites from a notification configuration request('POST', 'https://api.modulards.com/api/public/v1/alerts/alert_id/sites/detach', [ 'body' => '{ "sites": [ 34 ] }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Remove websites from a notification configuration using RestSharp; var client = new RestClient("https://api.modulards.com/api/public/v1/alerts/alert_id/sites/detach"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"sites\": [\n 34\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Remove websites from a notification configuration import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["sites": [34]] 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/sites/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() ```