Skip to content

Test a usage alert by checking current usage

POST
/v1/usage_alerts/{alert_id}/test

Test a usage alert by computing current usage and returning the status.

This does NOT actually trigger the alert or send webhooks; it only shows what the current usage vs threshold looks like.

alert_id
required
Alert Id
string format: uuid

Successful Response

UsageAlertStatusResponse
object
alert_id
required
Alert Id
string format: uuid
current_usage
required
Current Usage
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
threshold_value
required
Threshold Value
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
usage_percentage
required
Usage Percentage
string
/^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
billing_period_start
required
Billing Period Start
string format: date-time
billing_period_end
required
Billing Period End
string format: date-time

Unauthorized – invalid or missing API key

Usage alert, subscription, plan, or customer not found

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object