Create or update a single redaction box
curl --request PATCH \
--url https://api.indoralabs.com/text-detections/file/{fileId}/rect \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"rect": {
"page": 123,
"x": 123,
"y": 123,
"w": 123,
"h": 123,
"label": "<string>",
"id": "<string>",
"type": "<string>",
"reason": "<string>",
"spanIds": [
"<string>"
]
}
}
'import requests
url = "https://api.indoralabs.com/text-detections/file/{fileId}/rect"
payload = { "rect": {
"page": 123,
"x": 123,
"y": 123,
"w": 123,
"h": 123,
"label": "<string>",
"id": "<string>",
"type": "<string>",
"reason": "<string>",
"spanIds": ["<string>"]
} }
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({
rect: {
page: 123,
x: 123,
y: 123,
w: 123,
h: 123,
label: '<string>',
id: '<string>',
type: '<string>',
reason: '<string>',
spanIds: ['<string>']
}
})
};
fetch('https://api.indoralabs.com/text-detections/file/{fileId}/rect', 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/text-detections/file/{fileId}/rect",
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([
'rect' => [
'page' => 123,
'x' => 123,
'y' => 123,
'w' => 123,
'h' => 123,
'label' => '<string>',
'id' => '<string>',
'type' => '<string>',
'reason' => '<string>',
'spanIds' => [
'<string>'
]
]
]),
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/text-detections/file/{fileId}/rect"
payload := strings.NewReader("{\n \"rect\": {\n \"page\": 123,\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123,\n \"label\": \"<string>\",\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"reason\": \"<string>\",\n \"spanIds\": [\n \"<string>\"\n ]\n }\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.indoralabs.com/text-detections/file/{fileId}/rect")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"rect\": {\n \"page\": 123,\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123,\n \"label\": \"<string>\",\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"reason\": \"<string>\",\n \"spanIds\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.indoralabs.com/text-detections/file/{fileId}/rect")
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 \"rect\": {\n \"page\": 123,\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123,\n \"label\": \"<string>\",\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"reason\": \"<string>\",\n \"spanIds\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"page": 123,
"x": 123,
"y": 123,
"w": 123,
"h": 123,
"label": "<string>",
"type": "<string>",
"reason": "<string>",
"spanIds": [
"<string>"
]
}
]Text Redactions
Create or Update Redaction
Creates or updates a single redaction box for a file. If the rect includes an existing ID, the rect is updated. If no ID is provided, a new manual rect is created and assigned a generated ID. The response returns the full updated list of redaction boxes for the file.
PATCH
/
text-detections
/
file
/
{fileId}
/
rect
Create or update a single redaction box
curl --request PATCH \
--url https://api.indoralabs.com/text-detections/file/{fileId}/rect \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"rect": {
"page": 123,
"x": 123,
"y": 123,
"w": 123,
"h": 123,
"label": "<string>",
"id": "<string>",
"type": "<string>",
"reason": "<string>",
"spanIds": [
"<string>"
]
}
}
'import requests
url = "https://api.indoralabs.com/text-detections/file/{fileId}/rect"
payload = { "rect": {
"page": 123,
"x": 123,
"y": 123,
"w": 123,
"h": 123,
"label": "<string>",
"id": "<string>",
"type": "<string>",
"reason": "<string>",
"spanIds": ["<string>"]
} }
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({
rect: {
page: 123,
x: 123,
y: 123,
w: 123,
h: 123,
label: '<string>',
id: '<string>',
type: '<string>',
reason: '<string>',
spanIds: ['<string>']
}
})
};
fetch('https://api.indoralabs.com/text-detections/file/{fileId}/rect', 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/text-detections/file/{fileId}/rect",
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([
'rect' => [
'page' => 123,
'x' => 123,
'y' => 123,
'w' => 123,
'h' => 123,
'label' => '<string>',
'id' => '<string>',
'type' => '<string>',
'reason' => '<string>',
'spanIds' => [
'<string>'
]
]
]),
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/text-detections/file/{fileId}/rect"
payload := strings.NewReader("{\n \"rect\": {\n \"page\": 123,\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123,\n \"label\": \"<string>\",\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"reason\": \"<string>\",\n \"spanIds\": [\n \"<string>\"\n ]\n }\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.indoralabs.com/text-detections/file/{fileId}/rect")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"rect\": {\n \"page\": 123,\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123,\n \"label\": \"<string>\",\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"reason\": \"<string>\",\n \"spanIds\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.indoralabs.com/text-detections/file/{fileId}/rect")
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 \"rect\": {\n \"page\": 123,\n \"x\": 123,\n \"y\": 123,\n \"w\": 123,\n \"h\": 123,\n \"label\": \"<string>\",\n \"id\": \"<string>\",\n \"type\": \"<string>\",\n \"reason\": \"<string>\",\n \"spanIds\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"page": 123,
"x": 123,
"y": 123,
"w": 123,
"h": 123,
"label": "<string>",
"type": "<string>",
"reason": "<string>",
"spanIds": [
"<string>"
]
}
]Authorizations
Path Parameters
UUID of the file whose redaction details will be modified.
Body
application/json
Show child attributes
Show child attributes
⌘I

