Update notification alert
1 min
PUT
https://app.amberflo.io/notifications/{notification_id}
Path Parameters
- notification_idstringrequiredDescription
Body Parameters
- bodynotification-put-requestDescription
- object
- idstringrequiredDescription
- objectnotification-post-request
- namestringrequiredDescriptionDefaultToo many api calls
- descriptionstringDescriptionDefaultAlert on too many api calls
- notificationTypestring<usage | usage-cost | invoice | prepaid | pay-as-you-go-promotion | product-item-units | product-item-price | undefined-meter | undefined-customer>DescriptionDefaultusage
- meterIdstringDescriptionDefault24ad0b40-a217-11eb-b01a-19ff91d9370d
- cronstringDescription
- frequencystringDescriptionDefaultevery 1h
- createPrepaidCardbooleanDescription
- prepaidPricenumberDescription
- webhookUrlstringDescriptionDefaulthttps://hooks.slack.com/services/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
- webhookHeadersstringDescription
- webhookPayloadstringDescription
- emailstring[]DescriptionDefault
- emailToCustomerbooleanDescription
- filtermap<string, string[]>Description
- filterByTagsmap<string, object>Description
- groupByDimensionsstring[]Description
- customSubjectstringDescription
- thresholdConditionstring<less-than | greater-than | equals | percent-change | always-true | less-than-percent | greater-than-percent>Defaultgreater-than
- thresholdValuenumberDescriptionDefault1000
- rangestringDescriptionDefaultday
- customerFilterModestring<* | per-customer | specific-customer>DescriptionDefault*
- customerIdstringDescription
- productPlanIdstringDescription
- enabledbooleanDescriptionDefaulttrue
Responses
200
- notification-responseDescription
- objectnotification-put-request
- idstringrequiredDescription
- namestringrequiredDescriptionDefaultToo many api calls
- descriptionstringDescriptionDefaultAlert on too many api calls
- notificationTypestring<usage | usage-cost | invoice | prepaid | pay-as-you-go-promotion | product-item-units | product-item-price | undefined-meter | undefined-customer>DescriptionDefaultusage
- meterIdstringDescriptionDefault24ad0b40-a217-11eb-b01a-19ff91d9370d
- cronstringDescription
- frequencystringDescriptionDefaultevery 1h
- createPrepaidCardbooleanDescription
- prepaidPricenumberDescription
- webhookUrlstringDescriptionDefaulthttps://hooks.slack.com/services/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
- webhookHeadersstringDescription
- webhookPayloadstringDescription
- emailstring[]DescriptionDefault
- emailToCustomerbooleanDescription
- filtermap<string, string[]>Description
- filterByTagsmap<string, object>Description
- groupByDimensionsstring[]Description
- customSubjectstringDescription
- thresholdConditionstring<less-than | greater-than | equals | percent-change | always-true | less-than-percent | greater-than-percent>Defaultgreater-than
- thresholdValuenumberDescriptionDefault1000
- rangestringDescriptionDefaultday
- customerFilterModestring<* | per-customer | specific-customer>DescriptionDefault*
- customerIdstringDescription
- productPlanIdstringDescription
- enabledbooleanDescriptionDefaulttrue
- object
- createTimeintegerDescription
- updateTimeintegerDescription
400
401
403
404
500
curl
curl --request PUT \
--url https://app.amberflo.io/notifications/{notification_id} \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data-raw '{
"id": "",
"name": "Too many api calls",
"description": "Alert on too many api calls",
"notificationType": "usage",
"meterId": "24ad0b40-a217-11eb-b01a-19ff91d9370d",
"frequency": "every 1h",
"webhookUrl": "https://hooks.slack.com/services/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",
"email": [
"[email protected]"
],
"thresholdCondition": "greater-than",
"thresholdValue": 1000,
"range": "day",
"customerFilterMode": "*",
"enabled": true
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"id": "",
"name": "Too many api calls",
"description": "Alert on too many api calls",
"notificationType": "usage",
"meterId": "24ad0b40-a217-11eb-b01a-19ff91d9370d",
"frequency": "every 1h",
"webhookUrl": "https://hooks.slack.com/services/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",
"email": [
"[email protected]"
],
"thresholdCondition": "greater-than",
"thresholdValue": 1000,
"range": "day",
"customerFilterMode": "*",
"enabled": true
});
var requestOptions = {
method: 'PUT',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://app.amberflo.io/notifications/{notification_id}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://app.amberflo.io/notifications/{notification_id}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Put.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"id": "",
"name": "Too many api calls",
"description": "Alert on too many api calls",
"notificationType": "usage",
"meterId": "24ad0b40-a217-11eb-b01a-19ff91d9370d",
"frequency": "every 1h",
"webhookUrl": "https://hooks.slack.com/services/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",
"email": [
"[email protected]"
],
"thresholdCondition": "greater-than",
"thresholdValue": 1000,
"range": "day",
"customerFilterMode": "*",
"enabled": true
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://app.amberflo.io/notifications/{notification_id}"
payload = json.dumps({
"id": "",
"name": "Too many api calls",
"description": "Alert on too many api calls",
"notificationType": "usage",
"meterId": "24ad0b40-a217-11eb-b01a-19ff91d9370d",
"frequency": "every 1h",
"webhookUrl": "https://hooks.slack.com/services/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",
"email": [
"[email protected]"
],
"thresholdCondition": "greater-than",
"thresholdValue": 1000,
"range": "day",
"customerFilterMode": "*",
"enabled": True
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
200
// Notification alert successfully updated with new configuration details
{
"id": "",
"name": "",
"description": "",
"notificationType": "",
"meterId": "",
"cron": "",
"frequency": "",
"createPrepaidCard": false,
"prepaidPrice": 0,
"webhookUrl": "",
"webhookHeaders": "",
"webhookPayload": "",
"email": [
""
],
"emailToCustomer": false,
"filter": "",
"filterByTags": "",
"groupByDimensions": [
""
],
"customSubject": "",
"thresholdCondition": "",
"thresholdValue": 0,
"range": "",
"customerFilterMode": "",
"customerId": "",
"productPlanId": "",
"enabled": false,
"createTime": 0,
"updateTime": 0
}400
// Invalid request parameters or malformed request body
401
// Missing or invalid API key authentication
403
// Insufficient permissions to access this resource
404
// Notification alert not found or has been deleted
500
// Internal server error occurred while processing request