POST/organization/projects/{project_id}/spend_alerts/{alert_id}

Update a project spend alert

Updates a spend alert configured for a project. Provide the alert's threshold, currency, evaluation interval, and notification channel in the request body.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

2 parameters · 4 body fields
project_idstringrequired
The ID of the project containing the spend alert.
alert_idstringrequired
The ID of the spend alert to update.

Spend alert settings to update. The schema requires threshold_amount, currency, interval, and notification_channel.

threshold_amountintegerrequired
The alert threshold amount, in cents.
currencystringrequired
The currency for the threshold amount.
Allowed:USD
intervalstringrequired
The time interval for evaluating spend against the threshold.
Allowed:month
notification_channelobjectrequired
Email notification settings for a spend alert.

4 status codes
200Returns the updated project spend alert, including its ID, threshold amount, currency, interval, and notification channel.
idstringrequired
The identifier, which can be referenced in API endpoints.
objectstringrequired
The object type, which is always `project.spend_alert`.
Allowed:project.spend_alert
threshold_amountintegerrequired
The alert threshold amount, in cents.
currencystringrequired
The currency for the threshold amount.
Allowed:USD
intervalstringrequired
The time interval for evaluating spend against the threshold.
Allowed:month
notification_channelobjectrequired
Email notification settings for a spend alert.
400Returned when the spend alert update is invalid or conflicts with the hard spend limit.
errorobjectrequired
403Returned when the caller does not have permission to update project spend alerts.
errorobjectrequired
Details about the permission error.
404Returned when the project or spend alert is not found.
errorobjectrequired

Error handling

A 400 is returned when the update is invalid or conflicts with the hard spend limit; a 403 when the authenticated user lacks permission; and a 404 when the project or spend alert is not found. threshold_amount, currency, interval, and notification_channel are required; threshold_amount must be 0 or greater, currency must be USD, interval must be month, and the notification channel must use type email with recipients. The project_id path parameter and alert_id path parameter must identify the project and alert to update.