CreateRule
curl --request POST \
--url https://api.siftstack.com/api/v1/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"update": {
"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
}
}
'import requests
url = "https://api.siftstack.com/api/v1/rules"
payload = { "update": {
"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
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(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"
payload := strings.NewReader("{\n \"update\": {\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}")
req, _ := http.NewRequest("POST", 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))
}{
"ruleId": "<string>"
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}RuleService
CreateRule
Creates a rule.
POST
/
api
/
v1
/
rules
CreateRule
curl --request POST \
--url https://api.siftstack.com/api/v1/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"update": {
"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
}
}
'import requests
url = "https://api.siftstack.com/api/v1/rules"
payload = { "update": {
"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
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(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"
payload := strings.NewReader("{\n \"update\": {\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}")
req, _ := http.NewRequest("POST", 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))
}{
"ruleId": "<string>"
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
UpdateRuleRequest is used to create or update a rule. If the rule_id or client_key is provided, the rule will be updated. If not, a new rule will be created.
Show child attributes
Show child attributes
Response
A successful response.
Was this page helpful?
⌘I