> 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-integrations/test-a-slack-or-discord-integration/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.modulards.com/_mcp/server. # Test a Slack or Discord integration POST https://api.modulards.com/api/public/v1/alerts/{alert_id}/integrations/{integration_type}/test Content-Type: application/json Sends a real test message to a URL without saving it, and reports whether the provider accepted it. Use it to check a URL before you save it with "Create a Slack or Discord integration" or "Update a Slack or Discord integration". The `integration_type` in the path is `slack` or `discord`. `meta.valid` is `true` only when the provider answers with a 2xx status. Each attempt waits at most 5 seconds; a connection failure, a timeout or a 5xx answer is retried up to three attempts in total, and a 4xx answer is not retried. An unresponsive URL therefore answers within about 15 seconds, and a rejected one after a single attempt. The body is checked before the configuration, so an invalid body answers 422 first, and a configuration of another organization answers 404 only when the body is valid. Sending a test is limited to 10 test messages per minute per token. **Body** - `url` (string, required): the same rules as in "Update a Slack or Discord integration". **Errors** - **404**: the organization's plan does not include the channel, or your role cannot edit notification configurations. - **422**: `url` is empty or not valid for the type: an empty URL answers 422 instead of a failed test. - **429**: more than 10 test messages in a minute; the eleventh answers 429 and sends nothing. Reference: https://api.docs.modulards.com/modular-ds-public-api/notification-configurations/configuration-integrations/test-a-slack-or-discord-integration ## 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) - `integration_type` (string, required) ### Body (application/json) This endpoint expects an object. - `url` (string, optional) ## Response ### 200 200 - Valid (provider 2xx) / 200 - Not valid (provider failure) - `jsonapi` (ApiPublicV1AlertsAlertIdIntegrationsIntegrationTypeTestPostResponsesContentApplicationJsonSchemaJsonapi, optional) - `meta` (ApiPublicV1AlertsAlertIdIntegrationsIntegrationTypeTestPostResponsesContentApplicationJsonSchemaMeta, optional) ## Errors ### 404 Not Found Error 404 - Unknown integration type in the path - `errors` (list of ApiPublicV1AlertsAlertIdIntegrationsIntegrationTypeTestPostResponsesContentApplicationJsonSchemaErrorsItems, optional) - `jsonapi` (ApiPublicV1AlertsAlertIdIntegrationsIntegrationTypeTestPostResponsesContentApplicationJsonSchemaJsonapi, optional) ### 422 Unprocessable Entity Error 422 - Empty URL - `errors` (list of ApiPublicV1AlertsAlertIdIntegrationsIntegrationTypeTestPostResponsesContentApplicationJsonSchemaErrorsItems, optional) - `jsonapi` (ApiPublicV1AlertsAlertIdIntegrationsIntegrationTypeTestPostResponsesContentApplicationJsonSchemaJsonapi, optional) ### 429 Too Many Requests Error 429 - Too many test messages this minute - `errors` (list of ApiPublicV1AlertsAlertIdIntegrationsIntegrationTypeTestPostResponsesContentApplicationJsonSchemaErrorsItems, optional) - `jsonapi` (ApiPublicV1AlertsAlertIdIntegrationsIntegrationTypeTestPostResponsesContentApplicationJsonSchemaJsonapi, optional) ## Types ### ApiPublicV1AlertsAlertIdIntegrationsIntegrationTypeTestPostResponsesContentApplicationJsonSchemaJsonapi - `version` (string, optional) ### ApiPublicV1AlertsAlertIdIntegrationsIntegrationTypeTestPostResponsesContentApplicationJsonSchemaMeta - `valid` (boolean, optional) — `true` only when the provider answered the test message with a 2xx status. ### ApiPublicV1AlertsAlertIdIntegrationsIntegrationTypeTestPostResponsesContentApplicationJsonSchemaErrorsItems - `detail` (string, optional) - `status` (string, optional) - `title` (string, optional) ## Examples ### 200 - Not valid (provider failure) **Response** ```json { "jsonapi": { "version": "1.1" }, "meta": { "valid": false } } ``` **SDK Code** ```python 200 - Not valid (provider failure) import requests url = "https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript 200 - Not valid (provider failure) const url = 'https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test'; 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 - Not valid (provider failure) package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test" 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 - Not valid (provider failure) require 'uri' require 'net/http' url = URI("https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test") 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 - Not valid (provider failure) 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/integrations/integration_type/test") .header("Authorization", "Bearer ") .asString(); ``` ```php 200 - Not valid (provider failure) request('POST', 'https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp 200 - Not valid (provider failure) using RestSharp; var client = new RestClient("https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift 200 - Not valid (provider failure) import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test")! 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() ``` ### 200 - Valid (provider 2xx) **Response** ```json { "jsonapi": { "version": "1.1" }, "meta": { "valid": true } } ``` **SDK Code** ```python 200 - Valid (provider 2xx) import requests url = "https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test" headers = {"Authorization": "Bearer "} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript 200 - Valid (provider 2xx) const url = 'https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test'; 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 - Valid (provider 2xx) package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test" 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 - Valid (provider 2xx) require 'uri' require 'net/http' url = URI("https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test") 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 - Valid (provider 2xx) 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/integrations/integration_type/test") .header("Authorization", "Bearer ") .asString(); ``` ```php 200 - Valid (provider 2xx) request('POST', 'https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp 200 - Valid (provider 2xx) using RestSharp; var client = new RestClient("https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift 200 - Valid (provider 2xx) import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test")! 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() ``` ### Test a Slack or Discord integration **Request** ```json { "url": "https://hooks.slack.com/services/EXAMPLE/EXAMPLE/EXAMPLE" } ``` **Response** ```json { "jsonapi": { "version": "1.1" }, "meta": { "valid": false } } ``` **SDK Code** ```python Test a Slack or Discord integration import requests url = "https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test" payload = { "url": "https://hooks.slack.com/services/EXAMPLE/EXAMPLE/EXAMPLE" } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Test a Slack or Discord integration const url = 'https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"url":"https://hooks.slack.com/services/EXAMPLE/EXAMPLE/EXAMPLE"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Test a Slack or Discord integration package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test" payload := strings.NewReader("{\n \"url\": \"https://hooks.slack.com/services/EXAMPLE/EXAMPLE/EXAMPLE\"\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 Test a Slack or Discord integration require 'uri' require 'net/http' url = URI("https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test") 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 \"url\": \"https://hooks.slack.com/services/EXAMPLE/EXAMPLE/EXAMPLE\"\n}" response = http.request(request) puts response.read_body ``` ```java Test a Slack or Discord integration 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/integrations/integration_type/test") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"url\": \"https://hooks.slack.com/services/EXAMPLE/EXAMPLE/EXAMPLE\"\n}") .asString(); ``` ```php Test a Slack or Discord integration request('POST', 'https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test', [ 'body' => '{ "url": "https://hooks.slack.com/services/EXAMPLE/EXAMPLE/EXAMPLE" }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Test a Slack or Discord integration using RestSharp; var client = new RestClient("https://api.modulards.com/api/public/v1/alerts/alert_id/integrations/integration_type/test"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"url\": \"https://hooks.slack.com/services/EXAMPLE/EXAMPLE/EXAMPLE\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Test a Slack or Discord integration import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["url": "https://hooks.slack.com/services/EXAMPLE/EXAMPLE/EXAMPLE"] 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/integrations/integration_type/test")! 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() ```