Create a rule for the active account.
curl --request POST \
--url https://api.infrawatch.com/api/v1/rules \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"source": "<string>",
"category_slugs": [
"<string>"
],
"description": "<string>",
"enabled": true,
"tag_uuids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.infrawatch.com/api/v1/rules"
payload = {
"name": "<string>",
"source": "<string>",
"category_slugs": ["<string>"],
"description": "<string>",
"enabled": True,
"tag_uuids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
source: '<string>',
category_slugs: ['<string>'],
description: '<string>',
enabled: true,
tag_uuids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.infrawatch.com/api/v1/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.infrawatch.com/api/v1/rules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"category_slugs\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"enabled\": true,\n \"tag_uuids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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))
}{
"rule": {
"category_slugs": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"editable": true,
"enabled": true,
"internal_rule": true,
"match_updated_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"public": true,
"revision": 2,
"source": "<string>",
"tag_names": [
"<string>"
],
"tag_uuids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"tags": [
"<string>"
],
"updated_at": "2023-11-07T05:31:56Z",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"admitted_revision": 2,
"dns_takeover": {
"enabled": true,
"claim_mode": "<string>",
"confidence": "<string>",
"http_probe": {
"allow_network_errors": true,
"follow_redirects": true,
"path": "<string>",
"schemes": [
"<string>"
]
},
"matcher_id": "<string>",
"needs_domain_availability": true,
"provider": "<string>",
"record_types": [
"<string>"
],
"references": [
"<string>"
],
"rule_id": "<string>",
"service": "<string>",
"status": "<string>"
},
"individual_account_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"validated_at": "2023-11-07T05:31:56Z",
"validation_error": "<string>"
}
}Authoring and management
Create a rule for the active account.
POST
https://api.infrawatch.com/api/v1
/
rules
Create a rule for the active account.
curl --request POST \
--url https://api.infrawatch.com/api/v1/rules \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"source": "<string>",
"category_slugs": [
"<string>"
],
"description": "<string>",
"enabled": true,
"tag_uuids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.infrawatch.com/api/v1/rules"
payload = {
"name": "<string>",
"source": "<string>",
"category_slugs": ["<string>"],
"description": "<string>",
"enabled": True,
"tag_uuids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
source: '<string>',
category_slugs: ['<string>'],
description: '<string>',
enabled: true,
tag_uuids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.infrawatch.com/api/v1/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.infrawatch.com/api/v1/rules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"category_slugs\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"enabled\": true,\n \"tag_uuids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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))
}{
"rule": {
"category_slugs": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"editable": true,
"enabled": true,
"internal_rule": true,
"match_updated_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"public": true,
"revision": 2,
"source": "<string>",
"tag_names": [
"<string>"
],
"tag_uuids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"tags": [
"<string>"
],
"updated_at": "2023-11-07T05:31:56Z",
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"admitted_revision": 2,
"dns_takeover": {
"enabled": true,
"claim_mode": "<string>",
"confidence": "<string>",
"http_probe": {
"allow_network_errors": true,
"follow_redirects": true,
"path": "<string>",
"schemes": [
"<string>"
]
},
"matcher_id": "<string>",
"needs_domain_availability": true,
"provider": "<string>",
"record_types": [
"<string>"
],
"references": [
"<string>"
],
"rule_id": "<string>",
"service": "<string>",
"status": "<string>"
},
"individual_account_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"validated_at": "2023-11-07T05:31:56Z",
"validation_error": "<string>"
}
}Authorizations
Infrawatch API key. Supply the complete key directly as the header value.
Body
application/json
Required string length:
1 - 200Required string length:
1 - 1048576Maximum array length:
50Required string length:
1 - 100Pattern:
^[a-z0-9][a-z0-9-]{0,99}(/[a-z0-9][a-z0-9-]{0,99})*$Available options:
benign, suspicious, malicious Maximum string length:
4000Omit to infer the input kind from the parsed rule source.
Available options:
scan_result, certificate_event Maximum array length:
100Response
Rule created.
Show child attributes
Show child attributes
⌘I