Update usage alerts.
curl --request PATCH \
--url {schemes}://api.upsun.com/organizations/{organization_id}/alerts/subscriptions/{subscription_id}/usage \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alerts": [
{
"id": "<string>",
"active": true,
"config": {
"threshold": 123
}
}
]
}
'import requests
url = "{schemes}://api.upsun.com/organizations/{organization_id}/alerts/subscriptions/{subscription_id}/usage"
payload = { "alerts": [
{
"id": "<string>",
"active": True,
"config": { "threshold": 123 }
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({alerts: [{id: '<string>', active: true, config: {threshold: 123}}]})
};
fetch('{schemes}://api.upsun.com/organizations/{organization_id}/alerts/subscriptions/{subscription_id}/usage', 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 => "{schemes}://api.upsun.com/organizations/{organization_id}/alerts/subscriptions/{subscription_id}/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'alerts' => [
[
'id' => '<string>',
'active' => true,
'config' => [
'threshold' => 123
]
]
]
]),
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 := "{schemes}://api.upsun.com/organizations/{organization_id}/alerts/subscriptions/{subscription_id}/usage"
payload := strings.NewReader("{\n \"alerts\": [\n {\n \"id\": \"<string>\",\n \"active\": true,\n \"config\": {\n \"threshold\": 123\n }\n }\n ]\n}")
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(string(body))
}HttpResponse<String> response = Unirest.patch("{schemes}://api.upsun.com/organizations/{organization_id}/alerts/subscriptions/{subscription_id}/usage")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"alerts\": [\n {\n \"id\": \"<string>\",\n \"active\": true,\n \"config\": {\n \"threshold\": 123\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("{schemes}://api.upsun.com/organizations/{organization_id}/alerts/subscriptions/{subscription_id}/usage")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"alerts\": [\n {\n \"id\": \"<string>\",\n \"active\": true,\n \"config\": {\n \"threshold\": 123\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"current": [
{
"id": "<string>",
"active": true,
"alerts_sent": 123,
"last_alert_at": "<string>",
"updated_at": "<string>",
"config": {
"threshold": {
"formatted": "<string>",
"amount": 123,
"unit": "<string>"
}
}
}
],
"available": [
{
"id": "<string>",
"active": true,
"alerts_sent": 123,
"last_alert_at": "<string>",
"updated_at": "<string>",
"config": {
"threshold": {
"formatted": "<string>",
"amount": 123,
"unit": "<string>"
}
}
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}Subscriptions
Update usage alerts.
deprecated
Updates usage alerts for a subscription.
PATCH
/
organizations
/
{organization_id}
/
alerts
/
subscriptions
/
{subscription_id}
/
usage
Error
A valid request URL is required to generate request examples{
"current": [
{
"id": "<string>",
"active": true,
"alerts_sent": 123,
"last_alert_at": "<string>",
"updated_at": "<string>",
"config": {
"threshold": {
"formatted": "<string>",
"amount": 123,
"unit": "<string>"
}
}
}
],
"available": [
{
"id": "<string>",
"active": true,
"alerts_sent": 123,
"last_alert_at": "<string>",
"updated_at": "<string>",
"config": {
"threshold": {
"formatted": "<string>",
"amount": 123,
"unit": "<string>"
}
}
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the organization.
Prefix with name= to retrieve the organization by name instead.
The ID of the subscription.
Body
application/json
The list of alerts to update.
Show child attributes
Show child attributes
Last modified on June 16, 2026
Was this page helpful?
⌘I