const axios = require('axios');
const url = 'https://incident-cmd.api.pinghome.io/v1/ruleset/c03b02ec-244f-4d2c-8f68-3910071ed5c8';
const data = {
rule_type: 'state-change',
conditions: [{ values: ['10'], operator: 'equal', type: 'json-check', key: 'products[0].count' }],
level: 'team',
team_id: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8',
name: 'Name',
description: 'Description',
urgency: 'medium',
assignees: [{ type: 'team', id: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed' }]
};
axios.put(url, data, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});