curl --request PUT \
--url https://api.siftstack.com/api/v1/rules:batchUpdate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rules": [
{
"name": "<string>",
"description": "<string>",
"conditions": [
{
"expression": {},
"actions": [
{
"actionType": "ACTION_KIND_UNSPECIFIED",
"configuration": {},
"ruleActionId": "<string>"
}
],
"ruleConditionId": "<string>"
}
],
"metadata": [
{
"key": {
"name": "<string>",
"type": "METADATA_KEY_TYPE_UNSPECIFIED",
"archivedDate": "2023-11-07T05:31:56Z"
},
"stringValue": "<string>",
"numberValue": 123,
"booleanValue": true,
"archivedDate": "2023-11-07T05:31:56Z"
}
],
"ruleId": "<string>",
"assetId": "<string>",
"isEnabled": true,
"organizationId": "<string>",
"versionNotes": "<string>",
"clientKey": "<string>",
"assetConfiguration": {
"assetIds": [
"<string>"
],
"tagIds": [
"<string>"
]
},
"isExternal": true
}
],
"overrideExpressionValidation": true,
"validateOnly": true
}
'import requests
url = "https://api.siftstack.com/api/v1/rules:batchUpdate"
payload = {
"rules": [
{
"name": "<string>",
"description": "<string>",
"conditions": [
{
"expression": {},
"actions": [
{
"actionType": "ACTION_KIND_UNSPECIFIED",
"configuration": {},
"ruleActionId": "<string>"
}
],
"ruleConditionId": "<string>"
}
],
"metadata": [
{
"key": {
"name": "<string>",
"type": "METADATA_KEY_TYPE_UNSPECIFIED",
"archivedDate": "2023-11-07T05:31:56Z"
},
"stringValue": "<string>",
"numberValue": 123,
"booleanValue": True,
"archivedDate": "2023-11-07T05:31:56Z"
}
],
"ruleId": "<string>",
"assetId": "<string>",
"isEnabled": True,
"organizationId": "<string>",
"versionNotes": "<string>",
"clientKey": "<string>",
"assetConfiguration": {
"assetIds": ["<string>"],
"tagIds": ["<string>"]
},
"isExternal": True
}
],
"overrideExpressionValidation": True,
"validateOnly": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.siftstack.com/api/v1/rules:batchUpdate"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conditions\": [\n {\n \"expression\": {},\n \"actions\": [\n {\n \"actionType\": \"ACTION_KIND_UNSPECIFIED\",\n \"configuration\": {},\n \"ruleActionId\": \"<string>\"\n }\n ],\n \"ruleConditionId\": \"<string>\"\n }\n ],\n \"metadata\": [\n {\n \"key\": {\n \"name\": \"<string>\",\n \"type\": \"METADATA_KEY_TYPE_UNSPECIFIED\",\n \"archivedDate\": \"2023-11-07T05:31:56Z\"\n },\n \"stringValue\": \"<string>\",\n \"numberValue\": 123,\n \"booleanValue\": true,\n \"archivedDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"ruleId\": \"<string>\",\n \"assetId\": \"<string>\",\n \"isEnabled\": true,\n \"organizationId\": \"<string>\",\n \"versionNotes\": \"<string>\",\n \"clientKey\": \"<string>\",\n \"assetConfiguration\": {\n \"assetIds\": [\n \"<string>\"\n ],\n \"tagIds\": [\n \"<string>\"\n ]\n },\n \"isExternal\": true\n }\n ],\n \"overrideExpressionValidation\": true,\n \"validateOnly\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"rulesCreatedCount": 123,
"rulesUpdatedCount": 123,
"validateOnly": true,
"validationResults": [
{
"assetExpressionValidationResults": [
{
"assetId": "<string>",
"assetName": "<string>",
"assetTagId": "<string>",
"error": "<string>"
}
],
"ruleId": "<string>",
"clientKey": "<string>",
"error": "<string>"
}
],
"createdRuleIdentifiers": [
{
"ruleId": "<string>",
"name": "<string>",
"clientKey": "<string>"
}
]
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}BatchUpdateRules
Updates existing rules or creates rules that do not exist.
curl --request PUT \
--url https://api.siftstack.com/api/v1/rules:batchUpdate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rules": [
{
"name": "<string>",
"description": "<string>",
"conditions": [
{
"expression": {},
"actions": [
{
"actionType": "ACTION_KIND_UNSPECIFIED",
"configuration": {},
"ruleActionId": "<string>"
}
],
"ruleConditionId": "<string>"
}
],
"metadata": [
{
"key": {
"name": "<string>",
"type": "METADATA_KEY_TYPE_UNSPECIFIED",
"archivedDate": "2023-11-07T05:31:56Z"
},
"stringValue": "<string>",
"numberValue": 123,
"booleanValue": true,
"archivedDate": "2023-11-07T05:31:56Z"
}
],
"ruleId": "<string>",
"assetId": "<string>",
"isEnabled": true,
"organizationId": "<string>",
"versionNotes": "<string>",
"clientKey": "<string>",
"assetConfiguration": {
"assetIds": [
"<string>"
],
"tagIds": [
"<string>"
]
},
"isExternal": true
}
],
"overrideExpressionValidation": true,
"validateOnly": true
}
'import requests
url = "https://api.siftstack.com/api/v1/rules:batchUpdate"
payload = {
"rules": [
{
"name": "<string>",
"description": "<string>",
"conditions": [
{
"expression": {},
"actions": [
{
"actionType": "ACTION_KIND_UNSPECIFIED",
"configuration": {},
"ruleActionId": "<string>"
}
],
"ruleConditionId": "<string>"
}
],
"metadata": [
{
"key": {
"name": "<string>",
"type": "METADATA_KEY_TYPE_UNSPECIFIED",
"archivedDate": "2023-11-07T05:31:56Z"
},
"stringValue": "<string>",
"numberValue": 123,
"booleanValue": True,
"archivedDate": "2023-11-07T05:31:56Z"
}
],
"ruleId": "<string>",
"assetId": "<string>",
"isEnabled": True,
"organizationId": "<string>",
"versionNotes": "<string>",
"clientKey": "<string>",
"assetConfiguration": {
"assetIds": ["<string>"],
"tagIds": ["<string>"]
},
"isExternal": True
}
],
"overrideExpressionValidation": True,
"validateOnly": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.siftstack.com/api/v1/rules:batchUpdate"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conditions\": [\n {\n \"expression\": {},\n \"actions\": [\n {\n \"actionType\": \"ACTION_KIND_UNSPECIFIED\",\n \"configuration\": {},\n \"ruleActionId\": \"<string>\"\n }\n ],\n \"ruleConditionId\": \"<string>\"\n }\n ],\n \"metadata\": [\n {\n \"key\": {\n \"name\": \"<string>\",\n \"type\": \"METADATA_KEY_TYPE_UNSPECIFIED\",\n \"archivedDate\": \"2023-11-07T05:31:56Z\"\n },\n \"stringValue\": \"<string>\",\n \"numberValue\": 123,\n \"booleanValue\": true,\n \"archivedDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"ruleId\": \"<string>\",\n \"assetId\": \"<string>\",\n \"isEnabled\": true,\n \"organizationId\": \"<string>\",\n \"versionNotes\": \"<string>\",\n \"clientKey\": \"<string>\",\n \"assetConfiguration\": {\n \"assetIds\": [\n \"<string>\"\n ],\n \"tagIds\": [\n \"<string>\"\n ]\n },\n \"isExternal\": true\n }\n ],\n \"overrideExpressionValidation\": true,\n \"validateOnly\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"rulesCreatedCount": 123,
"rulesUpdatedCount": 123,
"validateOnly": true,
"validationResults": [
{
"assetExpressionValidationResults": [
{
"assetId": "<string>",
"assetName": "<string>",
"assetTagId": "<string>",
"error": "<string>"
}
],
"ruleId": "<string>",
"clientKey": "<string>",
"error": "<string>"
}
],
"createdRuleIdentifiers": [
{
"ruleId": "<string>",
"name": "<string>",
"clientKey": "<string>"
}
]
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Show child attributes
Show child attributes
If override_expression_validation is true, the request will save the rules even if the expressions are invalid. This can be useful for multi-asset rules where an invalid expression for one asset should not prevent the rule from being saved.
If validate_only is true, the request will only validate the request and not save the rules.
Response
A successful response.
The total number of rules created in the request. If validate_only is true, this will indicate how many rules would have been created.
The total number of rules updated in the request. If validate_only is true, this will indicate how many rules would have been updated.
This will be true if the request only validated the request and did not save the rules.
Show child attributes
Show child attributes
The created rule id, name, version, and client key.
Show child attributes
Show child attributes
Was this page helpful?