View as Markdown
API Spec (JSON)
API Spec (YAML)
Compact modeHides field descriptions and other prose for a more compact, scannable view of the API reference.Client CredentialsToken URLhttps://api-m.sandbox.paypal.com/v1/oauth2/tokenInheaderScopes
readwriteapplication/json
Complete alert configuration including type, thresholds, and optional metric information. The alert type determines which fields are required.
TypeScript Definitions
Use the request body type in TypeScript.
typeenum<AlertType>Requiredthresholdsobject<AlertThreshold>[]RequiredrecurringbooleanOptionalapplication/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/subscriptions/SUB_1752779018503/alerts" \ -H "Content-Type: application/json" \ -d '{ "code": "storage_monetary_alert", "metric_code": "Storage_Metrics_1753985710", "name": "Current Monetary Usage Alert specific to a Metric", "thresholds": [ { "code": "warn", "recurring": false, "value": "1000" } ], "type": "METRIC_CURRENT_USAGE_AMOUNT" }'{ "id": "14a42687-1814-4419-a111-76ff5792a786", "external_subscription_id": "SUB_1752779018503", "metric": { "name": "Storage usage", "code": "Storage_Metrics_1753985710", "type": "METERED", "description": "GB of storage used in my application", "aggregation_type": "SUM", "aggregation_field": "gb", "field_filters": [ { "key": "region", "values": [ "us-west1" ] } ], "id": "1e421308-7ead-4aef-b527-64dd05569668", "created_at": "2025-07-31T18:15:12Z" }, "type": "METRIC_CURRENT_USAGE_AMOUNT", "code": "storage_monetary_alert", "name": "Current Monetary Usage Alert specific to a Metric", "previous_value": 0, "thresholds": [ { "code": "warn", "value": "1000.0", "recurring": false } ], "last_processed_at": "2025-08-01T06:15:00Z", "created_at": "2025-08-01T05:58:53Z"}