Set alert subscription
curl --request PUT \
--url https://api.coreweave.com/v1/notifications/subscriptions/alerts/{alertName} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alertName": "<string>",
"destinationId": "<string>",
"enabled": true
}
'import requests
url = "https://api.coreweave.com/v1/notifications/subscriptions/alerts/{alertName}"
payload = {
"alertName": "<string>",
"destinationId": "<string>",
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({alertName: '<string>', destinationId: '<string>', enabled: true})
};
fetch('https://api.coreweave.com/v1/notifications/subscriptions/alerts/{alertName}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coreweave.com/v1/notifications/subscriptions/alerts/{alertName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'alertName' => '<string>',
'destinationId' => '<string>',
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.coreweave.com/v1/notifications/subscriptions/alerts/{alertName}"
payload := strings.NewReader("{\n \"alertName\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", 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(string(body))
}HttpResponse<String> response = Unirest.put("https://api.coreweave.com/v1/notifications/subscriptions/alerts/{alertName}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"alertName\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coreweave.com/v1/notifications/subscriptions/alerts/{alertName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"alertName\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Set alert subscription
Turn delivery of one CoreWeave alert to one destination on or off.
PUT
/
v1
/
notifications
/
subscriptions
/
alerts
/
{alertName}
Set alert subscription
curl --request PUT \
--url https://api.coreweave.com/v1/notifications/subscriptions/alerts/{alertName} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alertName": "<string>",
"destinationId": "<string>",
"enabled": true
}
'import requests
url = "https://api.coreweave.com/v1/notifications/subscriptions/alerts/{alertName}"
payload = {
"alertName": "<string>",
"destinationId": "<string>",
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({alertName: '<string>', destinationId: '<string>', enabled: true})
};
fetch('https://api.coreweave.com/v1/notifications/subscriptions/alerts/{alertName}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coreweave.com/v1/notifications/subscriptions/alerts/{alertName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'alertName' => '<string>',
'destinationId' => '<string>',
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.coreweave.com/v1/notifications/subscriptions/alerts/{alertName}"
payload := strings.NewReader("{\n \"alertName\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", 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(string(body))
}HttpResponse<String> response = Unirest.put("https://api.coreweave.com/v1/notifications/subscriptions/alerts/{alertName}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"alertName\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coreweave.com/v1/notifications/subscriptions/alerts/{alertName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"alertName\": \"<string>\",\n \"destinationId\": \"<string>\",\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Requires the Alerts Admin role.
To stop delivery without removing the subscription, set
enabled to false. If
alertName isn’t in the alert catalog, the request fails with NOT_FOUND.
Example request
curl -X PUT https://api.coreweave.com/v1/notifications/subscriptions/alerts/GPUWantsReset \
-H "Authorization: Bearer [API-ACCESS-TOKEN]" \
-H "Content-Type: application/json" \
-d '{"destinationId": "[DESTINATION-ID]", "enabled": true}'
Authorizations
CoreWeave API access token sent as a bearer token.
Path Parameters
Body
application/json
Response
OK
The response is of type object.
Was this page helpful?