Create policy rule
curl --request POST \
--url https://api.indoralabs.com/policies/{policyId}/rules \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"target": "<string>",
"sourceText": "<string>",
"sourcePage": 2,
"offsetStart": 1,
"offsetEnd": 2
}
'import requests
url = "https://api.indoralabs.com/policies/{policyId}/rules"
payload = {
"target": "<string>",
"sourceText": "<string>",
"sourcePage": 2,
"offsetStart": 1,
"offsetEnd": 2
}
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({
target: '<string>',
sourceText: '<string>',
sourcePage: 2,
offsetStart: 1,
offsetEnd: 2
})
};
fetch('https://api.indoralabs.com/policies/{policyId}/rules', 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.indoralabs.com/policies/{policyId}/rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target' => '<string>',
'sourceText' => '<string>',
'sourcePage' => 2,
'offsetStart' => 1,
'offsetEnd' => 2
]),
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.indoralabs.com/policies/{policyId}/rules"
payload := strings.NewReader("{\n \"target\": \"<string>\",\n \"sourceText\": \"<string>\",\n \"sourcePage\": 2,\n \"offsetStart\": 1,\n \"offsetEnd\": 2\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))
}HttpResponse<String> response = Unirest.post("https://api.indoralabs.com/policies/{policyId}/rules")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"target\": \"<string>\",\n \"sourceText\": \"<string>\",\n \"sourcePage\": 2,\n \"offsetStart\": 1,\n \"offsetEnd\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.indoralabs.com/policies/{policyId}/rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target\": \"<string>\",\n \"sourceText\": \"<string>\",\n \"sourcePage\": 2,\n \"offsetStart\": 1,\n \"offsetEnd\": 2\n}"
response = http.request(request)
puts response.read_body{
"rule": {
"id": "b87e2a3c-6ef9-4f9b-8e1b-9f9c2c1eab23",
"doc_id": "f1c8e8b0-7a1b-4f34-9b5b-0d99a3c9b77d",
"type": "REDACT",
"target": "all police contact information",
"source_text": "All personal contact information of officers must be redacted",
"source_page": 3,
"offset_start": 120,
"offset_end": 182,
"created_at": "2026-01-22 14:31:09.123 -0600"
}
}Policies
Update Policy Rule
Manually create a compliance rule for a policy document. Rules are immutable; updates require delete + recreate.
POST
/
policies
/
{policyId}
/
rules
Create policy rule
curl --request POST \
--url https://api.indoralabs.com/policies/{policyId}/rules \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"target": "<string>",
"sourceText": "<string>",
"sourcePage": 2,
"offsetStart": 1,
"offsetEnd": 2
}
'import requests
url = "https://api.indoralabs.com/policies/{policyId}/rules"
payload = {
"target": "<string>",
"sourceText": "<string>",
"sourcePage": 2,
"offsetStart": 1,
"offsetEnd": 2
}
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({
target: '<string>',
sourceText: '<string>',
sourcePage: 2,
offsetStart: 1,
offsetEnd: 2
})
};
fetch('https://api.indoralabs.com/policies/{policyId}/rules', 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.indoralabs.com/policies/{policyId}/rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target' => '<string>',
'sourceText' => '<string>',
'sourcePage' => 2,
'offsetStart' => 1,
'offsetEnd' => 2
]),
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.indoralabs.com/policies/{policyId}/rules"
payload := strings.NewReader("{\n \"target\": \"<string>\",\n \"sourceText\": \"<string>\",\n \"sourcePage\": 2,\n \"offsetStart\": 1,\n \"offsetEnd\": 2\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))
}HttpResponse<String> response = Unirest.post("https://api.indoralabs.com/policies/{policyId}/rules")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"target\": \"<string>\",\n \"sourceText\": \"<string>\",\n \"sourcePage\": 2,\n \"offsetStart\": 1,\n \"offsetEnd\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.indoralabs.com/policies/{policyId}/rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target\": \"<string>\",\n \"sourceText\": \"<string>\",\n \"sourcePage\": 2,\n \"offsetStart\": 1,\n \"offsetEnd\": 2\n}"
response = http.request(request)
puts response.read_body{
"rule": {
"id": "b87e2a3c-6ef9-4f9b-8e1b-9f9c2c1eab23",
"doc_id": "f1c8e8b0-7a1b-4f34-9b5b-0d99a3c9b77d",
"type": "REDACT",
"target": "all police contact information",
"source_text": "All personal contact information of officers must be redacted",
"source_page": 3,
"offset_start": 120,
"offset_end": 182,
"created_at": "2026-01-22 14:31:09.123 -0600"
}
}Authorizations
Path Parameters
Body
application/json
Rule behavior.
Available options:
REDACT, DETECT, EXCLUDE Target category or phrase this rule applies to.
Exact source text from the policy document.
Page number in the policy document.
Required range:
x >= 1Start character offset of the source text.
Required range:
x >= 0End character offset of the source text.
Required range:
x >= 1Response
Rule created
Immutable compliance rule derived from a policy document.
Show child attributes
Show child attributes
⌘I

