Alerts

Modify subscription alert

Updates the configuration of an existing subscription alert.

put/subscriptions/{external_subscription_id}/alerts/{alert_code}

Request

Path parameters

external_subscription_idstring required
Example:SUB_1752779018503

Unique external identifier for the subscription. This ID is used to track the subscription across systems and must be provided to access subscription-specific alerts.

alert_codestring required
Example:ALERT_CODE_1234567890

Unique identifier code for the specific alert within the subscription context. This code is customer-defined during alert creation and used for all subsequent operations on the alert.

Request body

codestring

The unique code to identify the alert.

metric_codestring

The code of the metric associated with the alert. Only for alerts based on a metric.

namestring

The name of the alert.

Example request

{
  "code": "api_calls_usage_alerts",
  "metric_code": "api_calls",
  "name": "Usage alerts for API calls",
  "thresholds": [
    {
      "code": "warn",
      "value": "80.0"
    }
  ]
}

Response

Alert configuration successfully updated with the provided changes.

idstring

Unique identifier for the alert, assigned by the system upon creation.

external_subscription_idstring

External identifier of the subscription that this alert is monitoring.

type'CURRENT_USAGE_AMOUNT' | 'METRIC_CURRENT_USAGE_AMOUNT' | 'METRIC_CURRENT_USAGE_UNITS' | 'LIFETIME_USAGE_AMOUNT'

Type of alert

codestring

The unique code to identify the alert within a subscription. Used in API endpoints for operations on specific alerts.

namestring

Human-readable display name for the alert. Used for identification in user interfaces.

previous_valuenumber

The usage value from the last time this alert was evaluated. For monetary alerts, this represents currency amount; for unit alerts, this represents consumed units.

last_processed_atstring date-time

Date and time in ISO 8601 format.

created_atstring date-time

Date and time in ISO 8601 format.

Example response

{
  "id": "fb2d17b8-c66d-4269-b38e-9d62d37812e3",
  "external_subscription_id": "sub_external_12345",
  "metric": {
    "type": "METERED",
    "aggregation_type": "SUM",
    "created_at": "2023-10-01T12:00:00Z",
    "updated_at": "2023-10-01T12:00:00Z"
  },
  "type": "CURRENT_USAGE_AMOUNT",
  "code": "tokens_usage_alert",
  "name": "Tokens Usage Alert",
  "previous_value": 75.52,
  "last_processed_at": "2023-10-01T12:00:00Z",
  "thresholds": [
    {
      "code": "warn",
      "value": "80",
      "recurring": false
    }
  ],
  "created_at": "2023-10-01T12:00:00Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.