Create
Create an alert
client.v1.alerts.create(AlertCreateParamsbody, RequestOptionsoptions?): dataIDAlertCreateResponse
post/v1/alerts/create
Create a new alert
Parameters
bodyalert_typeunionnamestringthresholdnumberbillable_metric_idstringcredit_grant_type_filtersarraycredit_type_idstringcustom_field_filtersarraycustomer_idstringevaluate_on_createbooleangroup_valuesarrayinvoice_types_filterarrayplan_idstringuniqueness_keystringAlertCreateParams
Returns
AlertCreateResponse
import Metronome from '@metronome/sdk';
const client = new Metronome({
bearerToken: 'My Bearer Token',
});
const alert = await client.v1.alerts.create({
alert_type: 'spend_threshold_reached',
name: '$100 spend threshold reached',
threshold: 10000,
credit_grant_type_filters: ['enterprise'],
credit_type_id: '2714e483-4ff1-48e4-9e25-ac732e8f24f2',
customer_id: '4db51251-61de-4bfe-b9ce-495e244f3491',
});
console.log(alert.data);
200 Example
{
"data": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}
}