cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/alerts/setting \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"config": {
"alert_enabled": true,
"critical": {
"threshold": "<string>"
},
"info": {
"threshold": "<string>"
},
"warning": {
"threshold": "<string>"
}
},
"entity_id": "<string>",
"parent_entity_id": "<string>"
}
'from flexprice import Flexprice, models
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.alert_settings.create_alert_settings(config=models.AlertSettings(), entity_id="<id>", entity_type="feature")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.alertSettings.createAlertSettings({
config: {},
entityId: "<id>",
entityType: "feature",
});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.AlertSettings.CreateAlertSettings(ctx, types.CreateAlertSettingsRequest{
Config: types.AlertSettings{},
EntityID: "<id>",
EntityType: types.AlertEntityTypeFeature,
})
if err != nil {
log.Fatal(err)
}
if res.AlertSettingsResponse != nil {
// handle response
}
}{
"config": {
"alert_enabled": true,
"alert_threshold_type": "absolute",
"critical": {
"condition": "above",
"threshold": "<string>"
},
"info": {
"condition": "above",
"threshold": "<string>"
},
"warning": {
"condition": "above",
"threshold": "<string>"
}
},
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"enabled": true,
"entity_id": "<string>",
"entity_type": "wallet",
"environment_id": "<string>",
"id": "<string>",
"parent_entity_id": "<string>",
"parent_entity_type": "<string>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}AlertSettings
Create alert settings
Configure a subscription, line item, or group spend alert.
POST
/
alerts
/
setting
cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/alerts/setting \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"config": {
"alert_enabled": true,
"critical": {
"threshold": "<string>"
},
"info": {
"threshold": "<string>"
},
"warning": {
"threshold": "<string>"
}
},
"entity_id": "<string>",
"parent_entity_id": "<string>"
}
'from flexprice import Flexprice, models
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.alert_settings.create_alert_settings(config=models.AlertSettings(), entity_id="<id>", entity_type="feature")
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.alertSettings.createAlertSettings({
config: {},
entityId: "<id>",
entityType: "feature",
});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.AlertSettings.CreateAlertSettings(ctx, types.CreateAlertSettingsRequest{
Config: types.AlertSettings{},
EntityID: "<id>",
EntityType: types.AlertEntityTypeFeature,
})
if err != nil {
log.Fatal(err)
}
if res.AlertSettingsResponse != nil {
// handle response
}
}{
"config": {
"alert_enabled": true,
"alert_threshold_type": "absolute",
"critical": {
"condition": "above",
"threshold": "<string>"
},
"info": {
"condition": "above",
"threshold": "<string>"
},
"warning": {
"condition": "above",
"threshold": "<string>"
}
},
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"enabled": true,
"entity_id": "<string>",
"entity_type": "wallet",
"environment_id": "<string>",
"id": "<string>",
"parent_entity_id": "<string>",
"parent_entity_type": "<string>",
"status": "published",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Authorizations
Enter your API key in the format x-api-key <api-key>*
Body
application/json
Alert settings
Show child attributes
Show child attributes
entity_id is the id of the monitored entity: subscription id, subscription_line_item id, or group id, matching entity_type.
Available options:
wallet, feature, subscription, subscription_line_item, group, entitlement_grant parent_entity_id is the subscription id that owns a line-item or group alert. Required when entity_type is "subscription_line_item" or "group"; omitted for subscription-level alerts.
Available options:
wallet, feature, subscription, subscription_line_item, group, entitlement_grant Response
Created
Show child attributes
Show child attributes
Available options:
wallet, feature, subscription, subscription_line_item, group, entitlement_grant Available options:
published, deleted, archived 
