> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/fleet-intel/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/fleet-intel/_mcp/server.

# Create a notification preference

POST /v1/notification_preferences
Content-Type: application/json

Create a notification preference. The public path remains notification_preferences
for compatibility; each row is id-addressable and applies one configuration (alert statuses, scope,
notification targets) to one or more components. The settings apply equally to every
component listed. To give a component different settings, create a separate preference.

notifiedOn: array of alert statuses to notify on. Valid values: Critical, Warning, Resolved.
If notifiedOn is empty or omitted, defaults to all three: [Critical, Warning, Resolved].

Channel config structures:
- email:   {"recipients": ["addr@example.com", ...]}  (at least one required)
- slack:   {"recipients": ["channel@workspace.slack.com", ...]}  (at least one required)
- webhook: {"customerID": "cust-acme" (optional), "orgName": "0000000000000000" (optional), "webhookIDs": ["wh_abc123", ...]}  (at least one webhook ID required; customerID defaults to the current customer when omitted; orgName is round-tripped for UI display only)

Reference: https://docs.nvidia.com/fleet-intel/fleet-intel/api-explorer/notification-preferences/post-v-1-notification-preferences

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: fleet-intelligence
  version: 1.0.0
paths:
  /v1/notification_preferences:
    post:
      operationId: postV1NotificationPreferences
      summary: Create a notification preference
      description: >-
        Create a notification preference. The public path remains
        notification_preferences

        for compatibility; each row is id-addressable and applies one
        configuration (alert statuses, scope,

        notification targets) to one or more components. The settings apply
        equally to every

        component listed. To give a component different settings, create a
        separate preference.


        notifiedOn: array of alert statuses to notify on. Valid values:
        Critical, Warning, Resolved.

        If notifiedOn is empty or omitted, defaults to all three: [Critical,
        Warning, Resolved].


        Channel config structures:

        - email:   {"recipients": ["addr@example.com", ...]}  (at least one
        required)

        - slack:   {"recipients": ["channel@workspace.slack.com", ...]}  (at
        least one required)

        - webhook: {"customerID": "cust-acme" (optional), "orgName":
        "0000000000000000" (optional), "webhookIDs": ["wh_abc123", ...]}  (at
        least one webhook ID required; customerID defaults to the current
        customer when omitted; orgName is round-tripped for UI display only)
      tags:
        - notification_preferences
      responses:
        '201':
          description: Created - returns the new preference id
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/models.CreateNotificationPreferenceResponse
        '400':
          description: >-
            Bad Request - Invalid body, missing/unknown components or targets,
            invalid channel/config
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '403':
          description: Forbidden - UAM authorization denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '499':
          description: Client Closed Request - request was canceled by the client
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '503':
          description: Service Unavailable - Database temporarily unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
      requestBody:
        description: Notification preference configuration
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/models.NotificationPreferenceRequest'
components:
  schemas:
    models.NotificationChannel:
      type: string
      enum:
        - email
        - slack
        - webhook
      description: 'Channel type: email, slack, or webhook'
      title: models.NotificationChannel
    models.NotificationTarget:
      type: object
      properties:
        channel:
          $ref: '#/components/schemas/models.NotificationChannel'
        config:
          type: object
          additionalProperties:
            description: Any type
          description: >-
            Channel-specific configuration (see EmailNotificationConfig,
            SlackNotificationConfig, WebhookNotificationConfig)
      required:
        - channel
        - config
      title: models.NotificationTarget
    models.NotificationScopeType:
      type: string
      enum:
        - all
        - compute_zones
        - node_groups
        - tags
        - nodes
      description: 'Scope type: all, nodes, node_groups, compute_zones, or tags'
      title: models.NotificationScopeType
    models.NotificationScope:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/models.NotificationScopeType'
        values:
          type: array
          items:
            type: string
          description: >-
            Scope values: UUIDs for nodes/node_groups/compute_zones, or tag name
            strings for tags.

            At least one value is required for all types except "all".
      description: |-
        Optional scope to narrow which nodes trigger notifications.
        If omitted or null, all nodes for this component trigger notifications.
      title: models.NotificationScope
    models.NotificationPreferenceRequest:
      type: object
      properties:
        active:
          type: boolean
          description: >-
            Active flag: when false, this preference is temporarily paused
            (other preferences covering

            the same component still fire). If omitted on create, defaults to
            true. If omitted on update, the

            existing value is preserved.
        components:
          type: array
          items:
            type: string
          description: >-
            Components this preference applies to (e.g. GPU, CPU, NVLink,
            agent_liveness). At least one;

            all settings below apply equally to every listed component.
        notificationTargets:
          type: array
          items:
            $ref: '#/components/schemas/models.NotificationTarget'
          description: >-
            At least one notification target is required.

            Config structure depends on channel — see EmailNotificationConfig,
            SlackNotificationConfig, WebhookNotificationConfig.
        notifiedOn:
          type: array
          items:
            type: string
          description: >-
            Alert statuses to notify on. Valid values: Critical, Warning,
            Resolved.

            If empty or omitted, defaults to all three: [Critical, Warning,
            Resolved].
        scope:
          $ref: '#/components/schemas/models.NotificationScope'
      required:
        - components
        - notificationTargets
      title: models.NotificationPreferenceRequest
    models.CreateNotificationPreferenceResponse:
      type: object
      properties:
        id:
          type: string
      required:
        - id
      title: models.CreateNotificationPreferenceResponse
    models.KASRequestStatus:
      type: object
      properties:
        requestId:
          type: string
          description: Request ID for tracing
        statusCode:
          type: string
          description: Status code from KAS
        statusDescription:
          type: string
          description: Status description from KAS
      description: >-
        RequestStatus contains KAS-specific error details

        This is added to reflect the field in OpenAPI docs for UI reference and
        not populated by our code

        If KAS returns an error, the request will not be forwarded to the
        backend
      title: models.KASRequestStatus
    models.ErrorResponse:
      type: object
      properties:
        details:
          type: string
          description: Detailed error information
        error:
          type: string
          description: Error message or type
        requestStatus:
          $ref: '#/components/schemas/models.KASRequestStatus'
      description: >-
        Standard error response returned by all API endpoints. For KAS API
        errors, requestStatus fields are populated.
      title: models.ErrorResponse

```

## Examples



**Request**

```json
{
  "components": [
    "GPU",
    "NVLink"
  ],
  "notificationTargets": [
    {
      "channel": "email",
      "config": {}
    }
  ]
}
```

**Response**

```json
{
  "id": "6f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f"
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/v1/notification_preferences"

payload = {
    "components": ["GPU", "NVLink"],
    "notificationTargets": [
        {
            "channel": "email",
            "config": {}
        }
    ]
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'https://api.example.com/v1/notification_preferences';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"components":["GPU","NVLink"],"notificationTargets":[{"channel":"email","config":{}}]}'
};

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

```go
package main

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

func main() {

	url := "https://api.example.com/v1/notification_preferences"

	payload := strings.NewReader("{\n  \"components\": [\n    \"GPU\",\n    \"NVLink\"\n  ],\n  \"notificationTargets\": [\n    {\n      \"channel\": \"email\",\n      \"config\": {}\n    }\n  ]\n}")

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

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

url = URI("https://api.example.com/v1/notification_preferences")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"components\": [\n    \"GPU\",\n    \"NVLink\"\n  ],\n  \"notificationTargets\": [\n    {\n      \"channel\": \"email\",\n      \"config\": {}\n    }\n  ]\n}"

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/v1/notification_preferences")
  .header("Content-Type", "application/json")
  .body("{\n  \"components\": [\n    \"GPU\",\n    \"NVLink\"\n  ],\n  \"notificationTargets\": [\n    {\n      \"channel\": \"email\",\n      \"config\": {}\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/v1/notification_preferences', [
  'body' => '{
  "components": [
    "GPU",
    "NVLink"
  ],
  "notificationTargets": [
    {
      "channel": "email",
      "config": {}
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/v1/notification_preferences");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"components\": [\n    \"GPU\",\n    \"NVLink\"\n  ],\n  \"notificationTargets\": [\n    {\n      \"channel\": \"email\",\n      \"config\": {}\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "components": ["GPU", "NVLink"],
  "notificationTargets": [
    [
      "channel": "email",
      "config": []
    ]
  ]
] as [String : Any]

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

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