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

# Update a usage threshold alert

PATCH https://api.dsx-air.nvidia.com/api/v3/ucp/alerts/{alert_id}/
Content-Type: application/json

Update the recipients list of an existing usage threshold alert. Only `recipients` may be modified; `threshold` is fixed at registration time because it is stored on UCP itself and changing it would require tearing down and recreating the alert. To change the threshold, delete and recreate the alert. Providing a `recipients` value **overwrites** the existing list rather than appending to it; to add a new recipient include the existing recipients in the request as well. If the creator wants to be notified when the alert fires they must include their own email address in this list.

**Required role:** `air_org_admin`

Reference: https://docs.nvidia.com/dsx-air/api-reference/ucp/api-v-3-ucp-alerts-partial-update

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `alert_id` (string, required)

### Body (application/json)

This endpoint expects an object.

- `recipients` (list of string, optional) — Email addresses notified when UCP fires the webhook. Providing a value on update **overwrites** the existing recipients rather than appending to them; to add a new recipient include the existing recipients in the request as well.

## Response

### 200

- `alert_id` (string, required) — The UUID UCP assigned to the alert when it was registered.
- `alert_type` (enum, required) — The UCP webhook event this alert is registered for. * `USAGE_REMAINING_ALERT` - USAGE_REMAINING_ALERT * `USAGE_GRANT_THRESHOLD_REACHED` - USAGE_GRANT_THRESHOLD_REACHED * `USAGE_GRANT_EXHAUSTED` - USAGE_GRANT_EXHAUSTED * `CONTRACT_ENDED` - CONTRACT_ENDED
  - Allowed values: `USAGE_REMAINING_ALERT`, `USAGE_GRANT_THRESHOLD_REACHED`, `USAGE_GRANT_EXHAUSTED`, `CONTRACT_ENDED`
- `threshold` (integer, required) — Remaining balance in compute hours at which UCP will fire the webhook back to Air.
- `recipients` (list of string, required) — Email addresses notified when UCP fires the webhook. Providing a value on update **overwrites** the existing recipients rather than appending to them; to add a new recipient include the existing recipients in the request as well.
- `last_fired` (datetime, required, nullable) — When Air last dispatched an email for this alert, or null if it has never fired.
- `creator` (string, required) — Email of the client that registered this alert.
- `org_display_name` (string, required) — Display name of the organization this alert belongs to.
- `ngc_org_name` (string, required) — NGC org name of the organization this alert belongs to.
- `org_nca_id` (string, required) — NCA id of the organization this alert belongs to.
- `created` (datetime, required)
- `modified` (datetime, required)

## Errors

### 400 Bad Request Error

- `detail` (string, required) — Description of an error.
- `request_id` (string, required, nullable) — ID assigned to the request which encountered the error. Should be provided when opening a support case.
- `type` (enum, required) — Specific type of a 400 error. * `PROTECTED` - Instance may not be deleted as it is being referenced by other instances. * `VALIDATION` - Validation errors encountered during payload processing.
  - Allowed values: `PROTECTED`, `VALIDATION`
- `protected_instances` (list of object, optional) — Instances which bar the current instance from being deleted. Only defined when `type` is set to `PROTECTED`.
  - `id` (string, required) — ID of the instance.
  - `type` (string, required) — Type of the instance.
- `validation_errors` (map from string to list of object or object or map from string to any or list of object, optional) — Validation errors encountered during payload processing. Only defined when `type` is set to `VALIDATION`.

### 403 Forbidden Error

- `detail` (string, required) — Description of an error.
- `request_id` (string, required, nullable) — ID assigned to the request which encountered the error. Should be provided when opening a support case.

### 404 Not Found Error

- `request_id` (string, required, nullable) — ID assigned to the request which encountered the error. Should be provided when opening a support case.
- `detail` (string, optional, default: No object matches the given query.) — Description of an error.

### 500 Internal Server Error

- `request_id` (string, required, nullable) — ID assigned to the request which encountered the error. Should be provided when opening a support case.
- `code` (string, required) — Error code which identifies the error. Should be provided when opening a support case.
- `detail` (string, optional, default: An unexpected error has occurred. Please contact NVIDIA Air support for further assistance.) — Description of an error.

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "alert_id": "string",
  "alert_type": "USAGE_REMAINING_ALERT",
  "threshold": 1,
  "recipients": [
    "string"
  ],
  "last_fired": "2024-01-15T09:30:00Z",
  "creator": "string",
  "org_display_name": "string",
  "ngc_org_name": "string",
  "org_nca_id": "string",
  "created": "2024-01-15T09:30:00Z",
  "modified": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.dsx-air.nvidia.com/api/v3/ucp/alerts/alert_id/"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.dsx-air.nvidia.com/api/v3/ucp/alerts/alert_id/';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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.dsx-air.nvidia.com/api/v3/ucp/alerts/alert_id/"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", 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
require 'uri'
require 'net/http'

url = URI("https://api.dsx-air.nvidia.com/api/v3/ucp/alerts/alert_id/")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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.patch("https://api.dsx-air.nvidia.com/api/v3/ucp/alerts/alert_id/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.dsx-air.nvidia.com/api/v3/ucp/alerts/alert_id/', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.dsx-air.nvidia.com/api/v3/ucp/alerts/alert_id/");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.dsx-air.nvidia.com/api/v3/ucp/alerts/alert_id/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```