> This page is for version Latest (default).
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/fleet-intel/latest/llms.txt

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

# Update a notification preference

PUT /v1/notification_preferences/{id}
Content-Type: application/json

Update the preference addressed by id. Uses the same body shape as create; components, notifiedOn, scope, and targets replace the stored configuration, while omitted active preserves the existing pause/resume toggle.

Reference: https://docs.nvidia.com/fleet-intel/api-explorer/notification-preferences/put-v-1-notification-preference-by-id

## Request

### Path parameters

- `id` (string, required) — Preference id (UUID)

### Body (application/json)

This endpoint expects a models.NotificationPreferenceRequest.

- `components` (list of string, required) — Components this preference applies to (e.g. GPU, CPU, NVLink). At least one; all settings below apply equally to every listed component.
- `notificationTargets` (list of models.NotificationTarget, required) — At least one notification target is required. Config structure depends on channel — see EmailNotificationConfig, SlackNotificationConfig, WebhookNotificationConfig.
- `active` (boolean, optional) — 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.
- `notifiedOn` (list of string, optional) — Alert statuses to notify on. Valid values: Critical, Warning, Resolved. If empty or omitted, defaults to all three: [Critical, Warning, Resolved].
- `scope` (models.NotificationScope, optional) — Optional scope to narrow which nodes trigger notifications. If omitted or null, all nodes for this component trigger notifications.

## Response

### 204

No Content - Preference updated

## Errors

### 400 Bad Request Error

Bad Request

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — 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

### 401 Unauthorized Error

Unauthorized

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — 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

### 403 Forbidden Error

Forbidden - UAM authorization denied

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — 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

### 404 Not Found Error

Not Found - No preference with this id

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — 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

### 499 Client Closed Request Error

Client Closed Request - request was canceled by the client

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — 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

### 500 Internal Server Error

Internal Server Error

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — 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

### 503 Service Unavailable Error

Service Unavailable - Database temporarily unavailable

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — 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

## Types

### models.NotificationTarget

- `channel` (enum, required) — Channel type: email, slack, or webhook
  - Allowed values: `email`, `slack`, `webhook`
- `config` (map from string to any, required) — Channel-specific configuration (see EmailNotificationConfig, SlackNotificationConfig, WebhookNotificationConfig)

### models.NotificationScope

Optional scope to narrow which nodes trigger notifications. If omitted or null, all nodes for this component trigger notifications.

- `type` (enum, optional) — Scope type: all, nodes, node_groups, compute_zones, or tags
  - Allowed values: `all`, `compute_zones`, `node_groups`, `tags`, `nodes`
- `values` (list of string, optional) — 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".

### models.KASRequestStatus

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

- `requestId` (string, optional) — Request ID for tracing
- `statusCode` (string, optional) — Status code from KAS
- `statusDescription` (string, optional) — Status description from KAS

## Examples

**Request**

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

**SDK Code**

```python
import requests

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

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

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

print(response.json())
```

```javascript
const url = 'https://api.example.com/v1/notification_preferences/id';
const options = {
  method: 'PUT',
  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/id"

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

	req, _ := http.NewRequest("PUT", 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/id")

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

request = Net::HTTP::Put.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.put("https://api.example.com/v1/notification_preferences/id")
  .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('PUT', 'https://api.example.com/v1/notification_preferences/id', [
  '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/id");
var request = new RestRequest(Method.PUT);
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/id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```