curl --request PATCH \
--url https://neo.api.projectdiscovery.io/api/v1/hooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"matcher": {
"args": [
{
"path": "<string>",
"value": "<unknown>"
}
],
"path": "<string>",
"source": [
"<string>"
],
"tool": "<string>"
}
}
'import requests
url = "https://neo.api.projectdiscovery.io/api/v1/hooks/{id}"
payload = {
"enabled": True,
"matcher": {
"args": [
{
"path": "<string>",
"value": "<unknown>"
}
],
"path": "<string>",
"source": ["<string>"],
"tool": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
matcher: {
args: [{path: '<string>', value: '<unknown>'}],
path: '<string>',
source: ['<string>'],
tool: '<string>'
}
})
};
fetch('https://neo.api.projectdiscovery.io/api/v1/hooks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://neo.api.projectdiscovery.io/api/v1/hooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'matcher' => [
'args' => [
[
'path' => '<string>',
'value' => '<unknown>'
]
],
'path' => '<string>',
'source' => [
'<string>'
],
'tool' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://neo.api.projectdiscovery.io/api/v1/hooks/{id}"
payload := strings.NewReader("{\n \"enabled\": true,\n \"matcher\": {\n \"args\": [\n {\n \"path\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"path\": \"<string>\",\n \"source\": [\n \"<string>\"\n ],\n \"tool\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://neo.api.projectdiscovery.io/api/v1/hooks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"matcher\": {\n \"args\": [\n {\n \"path\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"path\": \"<string>\",\n \"source\": [\n \"<string>\"\n ],\n \"tool\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://neo.api.projectdiscovery.io/api/v1/hooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"matcher\": {\n \"args\": [\n {\n \"path\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"path\": \"<string>\",\n \"source\": [\n \"<string>\"\n ],\n \"tool\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"action": {
"type": "allow",
"max_denials": 123,
"on_yes": "allow",
"question": "<string>",
"reason": "<string>",
"set": {},
"text": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"event": "PreToolUse",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locked": true,
"matcher": {
"args": [
{
"op": "equals",
"path": "<string>",
"value": "<unknown>"
}
],
"path": "<string>",
"source": [
"<string>"
],
"tool": "<string>"
},
"scope": "org",
"scope_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"editable": true
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>",
"param": "<string>",
"turnstile_site_key": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>",
"param": "<string>",
"turnstile_site_key": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>",
"param": "<string>",
"turnstile_site_key": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>",
"param": "<string>",
"turnstile_site_key": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>",
"param": "<string>",
"turnstile_site_key": "<string>"
}Update a standing policy rule
Enable or disable a rule, or replace its matcher or action. The event and scope are fixed at creation, because changing either makes it a different rule.
curl --request PATCH \
--url https://neo.api.projectdiscovery.io/api/v1/hooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"matcher": {
"args": [
{
"path": "<string>",
"value": "<unknown>"
}
],
"path": "<string>",
"source": [
"<string>"
],
"tool": "<string>"
}
}
'import requests
url = "https://neo.api.projectdiscovery.io/api/v1/hooks/{id}"
payload = {
"enabled": True,
"matcher": {
"args": [
{
"path": "<string>",
"value": "<unknown>"
}
],
"path": "<string>",
"source": ["<string>"],
"tool": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
matcher: {
args: [{path: '<string>', value: '<unknown>'}],
path: '<string>',
source: ['<string>'],
tool: '<string>'
}
})
};
fetch('https://neo.api.projectdiscovery.io/api/v1/hooks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://neo.api.projectdiscovery.io/api/v1/hooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'matcher' => [
'args' => [
[
'path' => '<string>',
'value' => '<unknown>'
]
],
'path' => '<string>',
'source' => [
'<string>'
],
'tool' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://neo.api.projectdiscovery.io/api/v1/hooks/{id}"
payload := strings.NewReader("{\n \"enabled\": true,\n \"matcher\": {\n \"args\": [\n {\n \"path\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"path\": \"<string>\",\n \"source\": [\n \"<string>\"\n ],\n \"tool\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://neo.api.projectdiscovery.io/api/v1/hooks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"matcher\": {\n \"args\": [\n {\n \"path\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"path\": \"<string>\",\n \"source\": [\n \"<string>\"\n ],\n \"tool\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://neo.api.projectdiscovery.io/api/v1/hooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"matcher\": {\n \"args\": [\n {\n \"path\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"path\": \"<string>\",\n \"source\": [\n \"<string>\"\n ],\n \"tool\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"action": {
"type": "allow",
"max_denials": 123,
"on_yes": "allow",
"question": "<string>",
"reason": "<string>",
"set": {},
"text": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"event": "PreToolUse",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locked": true,
"matcher": {
"args": [
{
"op": "equals",
"path": "<string>",
"value": "<unknown>"
}
],
"path": "<string>",
"source": [
"<string>"
],
"tool": "<string>"
},
"scope": "org",
"scope_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"editable": true
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>",
"param": "<string>",
"turnstile_site_key": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>",
"param": "<string>",
"turnstile_site_key": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>",
"param": "<string>",
"turnstile_site_key": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>",
"param": "<string>",
"turnstile_site_key": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>",
"param": "<string>",
"turnstile_site_key": "<string>"
}Authorizations
JWT authentication token
Path Parameters
Body
Every field is optional; only what is supplied changes.
What happens when the matcher matches. Each action only runs on the events that read it, and a pairing outside that is refused.
Show child attributes
Show child attributes
Which calls the rule covers. An absent field matches anything, so an empty
matcher covers everything within its scope. Prefer path for anything
about a file or directory: it is checked against every string in the call,
so one rule covers a read, a write, and a shell command alike.
Show child attributes
Show child attributes
Response
Rule updated
What happens when the matcher matches. Each action only runs on the events that read it, and a pairing outside that is refused.
Show child attributes
Show child attributes
The moment in a task where the rule is checked.
PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, SessionStart, SubagentStop, Stop Locked workspace policy cannot be changed through this API.
Which calls the rule covers. An absent field matches anything, so an empty
matcher covers everything within its scope. Prefer path for anything
about a file or directory: it is checked against every string in the call,
so one rule covers a read, a write, and a shell command alike.
Show child attributes
Show child attributes
Who the rule applies to. Rules from every scope are evaluated together.
org, repo, user, thread Whether this caller may change or delete the rule. Reads are wider than writes.

