Edit Imported Rule
curl --request PATCH \
--url https://api.zerodrift.ai/api/policies/import/{import_id}/rules/{rule_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"prompt": "<string>",
"fix_note": "<string>",
"confidence": 123
}
'import requests
url = "https://api.zerodrift.ai/api/policies/import/{import_id}/rules/{rule_id}"
payload = {
"prompt": "<string>",
"fix_note": "<string>",
"confidence": 123
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({prompt: '<string>', fix_note: '<string>', confidence: 123})
};
fetch('https://api.zerodrift.ai/api/policies/import/{import_id}/rules/{rule_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://api.zerodrift.ai/api/policies/import/{import_id}/rules/{rule_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([
'prompt' => '<string>',
'fix_note' => '<string>',
'confidence' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api.zerodrift.ai/api/policies/import/{import_id}/rules/{rule_id}"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"fix_note\": \"<string>\",\n \"confidence\": 123\n}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://api.zerodrift.ai/api/policies/import/{import_id}/rules/{rule_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"fix_note\": \"<string>\",\n \"confidence\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zerodrift.ai/api/policies/import/{import_id}/rules/{rule_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"fix_note\": \"<string>\",\n \"confidence\": 123\n}"
response = http.request(request)
puts response.read_bodyImport a Policy
Edit Imported Rule
Partially edit a pending imported rule before activation
PATCH
/
api
/
policies
/
import
/
{import_id}
/
rules
/
{rule_id}
Edit Imported Rule
curl --request PATCH \
--url https://api.zerodrift.ai/api/policies/import/{import_id}/rules/{rule_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"prompt": "<string>",
"fix_note": "<string>",
"confidence": 123
}
'import requests
url = "https://api.zerodrift.ai/api/policies/import/{import_id}/rules/{rule_id}"
payload = {
"prompt": "<string>",
"fix_note": "<string>",
"confidence": 123
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({prompt: '<string>', fix_note: '<string>', confidence: 123})
};
fetch('https://api.zerodrift.ai/api/policies/import/{import_id}/rules/{rule_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://api.zerodrift.ai/api/policies/import/{import_id}/rules/{rule_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([
'prompt' => '<string>',
'fix_note' => '<string>',
'confidence' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api.zerodrift.ai/api/policies/import/{import_id}/rules/{rule_id}"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"fix_note\": \"<string>\",\n \"confidence\": 123\n}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://api.zerodrift.ai/api/policies/import/{import_id}/rules/{rule_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"fix_note\": \"<string>\",\n \"confidence\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zerodrift.ai/api/policies/import/{import_id}/rules/{rule_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"fix_note\": \"<string>\",\n \"confidence\": 123\n}"
response = http.request(request)
puts response.read_bodyPartially edit
prompt, remediation guidance (fix_note), or extraction
confidence for one rule while its customer-owned import is pending review.
Requires a full-access API key. The import must still be in a pending-review
state (or equivalent pending status that allows edit); concurrent changes return
409.
Path Parameters
Request Body
At least one field is required. Explicitnull clears prompt or fix_note.
prompt is accepted only for AI_SIGNAL rules.
Response
Returns the updated extracted rule object (same shape as entries under Get Import Details).Errors
| Status | Meaning |
|---|---|
400 | Invalid imported rule update |
403 | Full-access API key required |
404 | Import or imported rule not found |
409 | Import is not pending review, or changed concurrently |

