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

# Create a notification configuration

POST https://api.modulards.com/api/public/v1/alerts
Content-Type: application/json

Creates a notification configuration with no websites and no contacts. Use it to define which events you want to be told about and through which channels, then add websites and contacts to it.

Sending an event as a key, such as `"uptime.down": true`, is rejected as an unknown field: events go in `items`.

**Body**

* `name` (string, required): at most 30 characters.
* `default` (boolean, optional): makes it the organization's default configuration.
* `status` (`enabled` or `disabled`, optional): whether the configuration is active.
* `email_channel`, `whatsapp_channel`, `slack_channel`, `discord_channel` (boolean, optional): which channels are active. Email is always available. WhatsApp, Slack and Discord depend on the organization's plan: the request is accepted whatever the plan, but a notification goes out through one of them only while the plan includes it, and Slack and Discord also need a saved destination. Saving, deleting or testing a Slack or Discord destination on a plan without that channel answers `404`.
* `items` (array, optional): entries of `{type, status}`, where `type` is a notification event and `status` is `enabled` or `disabled`. The events are `uptime.down`, `uptime.up`, `uptime.ssl.expiration`, `backup.failed`, `site.connection-lost`, `patchstack.connection-lost`, `report.automatic.failed`, `vulnerability.discovered`, `vulnerability.discovered.critical`, `administrator.added`, `administrator.removed`, `malware-scan.threats-found` and `broken-link.issues-found`. Each type appears once.

**Errors**

* **422**: `vulnerability.discovered.critical` is enabled while `vulnerability.discovered` is not enabled, in the same call or already stored.

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

### Body (application/json)

This endpoint expects an object.

- `email_channel` (boolean, optional)
- `items` (list of ApiPublicV1AlertsPostRequestBodyContentApplicationJsonSchemaItemsItems, optional)
- `name` (string, optional)

## Response

### 201

201 Created

- `data` (ApiPublicV1AlertsPostResponsesContentApplicationJsonSchemaData, optional)
- `jsonapi` (ApiPublicV1AlertsPostResponsesContentApplicationJsonSchemaJsonapi, optional)

## Errors

### 422 Unprocessable Entity Error

422 - Critical event without its base event

- `errors` (list of ApiPublicV1AlertsPostResponsesContentApplicationJsonSchemaErrorsItems, optional)
- `jsonapi` (ApiPublicV1AlertsPostResponsesContentApplicationJsonSchemaJsonapi, optional)

## Types

### ApiPublicV1AlertsPostRequestBodyContentApplicationJsonSchemaItemsItems

- `status` (string, optional)
- `type` (string, optional)

### ApiPublicV1AlertsPostResponsesContentApplicationJsonSchemaData

- `attributes` (ApiPublicV1AlertsPostResponsesContentApplicationJsonSchemaDataAttributes, optional)
- `id` (string, optional)
- `links` (ApiPublicV1AlertsPostResponsesContentApplicationJsonSchemaDataLinks, optional)
- `type` (string, optional)

### ApiPublicV1AlertsPostResponsesContentApplicationJsonSchemaJsonapi

- `version` (string, optional)

### ApiPublicV1AlertsPostResponsesContentApplicationJsonSchemaErrorsItems

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

### ApiPublicV1AlertsPostResponsesContentApplicationJsonSchemaDataAttributes

- `created_at` (string, optional)
- `discord_channel` (boolean, optional)
- `email_channel` (boolean, optional)
- `is_default` (boolean, optional)
- `name` (string, optional)
- `slack_channel` (boolean, optional)
- `status` (string, optional)
- `updated_at` (string, optional)
- `whatsapp_channel` (boolean, optional)

### ApiPublicV1AlertsPostResponsesContentApplicationJsonSchemaDataLinks

- `self` (string, optional)

### ApiPublicV1AlertsPostResponsesContentApplicationJsonSchemaErrorsItemsSource

- `parameter` (string, optional)

## Examples

### 201 Created

**Response**

```json
{
  "data": {
    "attributes": {
      "created_at": "2026-09-28T09:00:00.000000Z",
      "discord_channel": false,
      "email_channel": false,
      "is_default": false,
      "name": "Operations",
      "slack_channel": false,
      "status": "enabled",
      "updated_at": "2026-09-28T09:00:00.000000Z",
      "whatsapp_channel": false
    },
    "id": "12",
    "links": {
      "self": "https://api.modulards.com/api/public/v1/alerts/12"
    },
    "type": "alerts"
  },
  "jsonapi": {
    "version": "1.1"
  }
}
```

**SDK Code**

```python 201 Created
import requests

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

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

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

print(response.json())
```

```javascript 201 Created
const url = 'https://api.modulards.com/api/public/v1/alerts';
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 201 Created
package main

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

func main() {

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

	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 201 Created
require 'uri'
require 'net/http'

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

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 201 Created
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")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php 201 Created
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp 201 Created
using RestSharp;

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

```swift 201 Created
import Foundation

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

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

### Create a notification configuration

**Request**

```json
{
  "email_channel": true,
  "items": [
    {
      "status": "enabled",
      "type": "uptime.down"
    },
    {
      "status": "enabled",
      "type": "uptime.up"
    }
  ],
  "name": "Critical outages"
}
```

**Response**

```json
{
  "data": {
    "attributes": {
      "created_at": "2026-09-28T09:00:00.000000Z",
      "discord_channel": false,
      "email_channel": false,
      "is_default": false,
      "name": "Operations",
      "slack_channel": false,
      "status": "enabled",
      "updated_at": "2026-09-28T09:00:00.000000Z",
      "whatsapp_channel": false
    },
    "id": "12",
    "links": {
      "self": "https://api.modulards.com/api/public/v1/alerts/12"
    },
    "type": "alerts"
  },
  "jsonapi": {
    "version": "1.1"
  }
}
```

**SDK Code**

```python Create a notification configuration
import requests

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

payload = {
    "email_channel": True,
    "items": [
        {
            "status": "enabled",
            "type": "uptime.down"
        },
        {
            "status": "enabled",
            "type": "uptime.up"
        }
    ],
    "name": "Critical outages"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Create a notification configuration
const url = 'https://api.modulards.com/api/public/v1/alerts';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"email_channel":true,"items":[{"status":"enabled","type":"uptime.down"},{"status":"enabled","type":"uptime.up"}],"name":"Critical outages"}'
};

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

```go Create a notification configuration
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"email_channel\": true,\n  \"items\": [\n    {\n      \"status\": \"enabled\",\n      \"type\": \"uptime.down\"\n    },\n    {\n      \"status\": \"enabled\",\n      \"type\": \"uptime.up\"\n    }\n  ],\n  \"name\": \"Critical outages\"\n}")

	req, _ := http.NewRequest("POST", 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 Create a notification configuration
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"email_channel\": true,\n  \"items\": [\n    {\n      \"status\": \"enabled\",\n      \"type\": \"uptime.down\"\n    },\n    {\n      \"status\": \"enabled\",\n      \"type\": \"uptime.up\"\n    }\n  ],\n  \"name\": \"Critical outages\"\n}"

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

```java Create a notification configuration
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")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"email_channel\": true,\n  \"items\": [\n    {\n      \"status\": \"enabled\",\n      \"type\": \"uptime.down\"\n    },\n    {\n      \"status\": \"enabled\",\n      \"type\": \"uptime.up\"\n    }\n  ],\n  \"name\": \"Critical outages\"\n}")
  .asString();
```

```php Create a notification configuration
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.modulards.com/api/public/v1/alerts', [
  'body' => '{
  "email_channel": true,
  "items": [
    {
      "status": "enabled",
      "type": "uptime.down"
    },
    {
      "status": "enabled",
      "type": "uptime.up"
    }
  ],
  "name": "Critical outages"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Create a notification configuration
using RestSharp;

var client = new RestClient("https://api.modulards.com/api/public/v1/alerts");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"email_channel\": true,\n  \"items\": [\n    {\n      \"status\": \"enabled\",\n      \"type\": \"uptime.down\"\n    },\n    {\n      \"status\": \"enabled\",\n      \"type\": \"uptime.up\"\n    }\n  ],\n  \"name\": \"Critical outages\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create a notification configuration
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "email_channel": true,
  "items": [
    [
      "status": "enabled",
      "type": "uptime.down"
    ],
    [
      "status": "enabled",
      "type": "uptime.up"
    ]
  ],
  "name": "Critical outages"
] as [String : Any]

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

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