Redact a detection
Applies the pipeline’s policies to the detection’s stored analysis — with any reviewer edits layered on first (suppress a false positive, retag a detection, or add one the analysis missed) — and produces a new redaction: a redacted document plus a review audit recording what was redacted. A detection can be redacted more than once. An edit targeting a detection not in the analysis, or a set that contradicts itself, is rejected (400).
curl --request POST \
--url https://api.example.com/workspaces/{workspaceId}/detections/{detectionId}/redactions \
--header 'Content-Type: application/json' \
--data '
{
"edits": {
"audio": [
{
"label": "<string>",
"location": {
"span": {
"end_us": 1,
"start_us": 1
},
"speaker_id": "<string>"
},
"op": "add",
"actor": "<string>",
"part": [
"<string>"
],
"reason": "<string>"
}
],
"image": [
{
"label": "<string>",
"location": {
"bounding_box": {
"max": {
"x": 123,
"y": 123
},
"min": {
"x": 123,
"y": 123
}
},
"page": 1,
"polygon": [
{
"x": 123,
"y": 123
}
]
},
"op": "add",
"actor": "<string>",
"part": [
"<string>"
],
"reason": "<string>"
}
],
"tabular": [
{
"label": "<string>",
"location": {
"column_index": 1,
"row_index": 1,
"column_name": "<string>",
"end_offset": 1,
"sheet_name": "<string>",
"start_offset": 1
},
"op": "add",
"actor": "<string>",
"part": [
"<string>"
],
"reason": "<string>"
}
],
"text": [
{
"label": "<string>",
"location": {
"coord": {
"range": {
"end": 1,
"start": 1
},
"kind": "decoded",
"source": [
{
"range": {
"end": 1,
"start": 1
},
"part": "<string>"
}
]
},
"page": 1
},
"op": "add",
"actor": "<string>",
"part": [
"<string>"
],
"reason": "<string>"
}
]
}
}
'import requests
url = "https://api.example.com/workspaces/{workspaceId}/detections/{detectionId}/redactions"
payload = { "edits": {
"audio": [
{
"label": "<string>",
"location": {
"span": {
"end_us": 1,
"start_us": 1
},
"speaker_id": "<string>"
},
"op": "add",
"actor": "<string>",
"part": ["<string>"],
"reason": "<string>"
}
],
"image": [
{
"label": "<string>",
"location": {
"bounding_box": {
"max": {
"x": 123,
"y": 123
},
"min": {
"x": 123,
"y": 123
}
},
"page": 1,
"polygon": [
{
"x": 123,
"y": 123
}
]
},
"op": "add",
"actor": "<string>",
"part": ["<string>"],
"reason": "<string>"
}
],
"tabular": [
{
"label": "<string>",
"location": {
"column_index": 1,
"row_index": 1,
"column_name": "<string>",
"end_offset": 1,
"sheet_name": "<string>",
"start_offset": 1
},
"op": "add",
"actor": "<string>",
"part": ["<string>"],
"reason": "<string>"
}
],
"text": [
{
"label": "<string>",
"location": {
"coord": {
"range": {
"end": 1,
"start": 1
},
"kind": "decoded",
"source": [
{
"range": {
"end": 1,
"start": 1
},
"part": "<string>"
}
]
},
"page": 1
},
"op": "add",
"actor": "<string>",
"part": ["<string>"],
"reason": "<string>"
}
]
} }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
edits: {
audio: [
{
label: '<string>',
location: {span: {end_us: 1, start_us: 1}, speaker_id: '<string>'},
op: 'add',
actor: '<string>',
part: ['<string>'],
reason: '<string>'
}
],
image: [
{
label: '<string>',
location: {
bounding_box: {max: {x: 123, y: 123}, min: {x: 123, y: 123}},
page: 1,
polygon: [{x: 123, y: 123}]
},
op: 'add',
actor: '<string>',
part: ['<string>'],
reason: '<string>'
}
],
tabular: [
{
label: '<string>',
location: {
column_index: 1,
row_index: 1,
column_name: '<string>',
end_offset: 1,
sheet_name: '<string>',
start_offset: 1
},
op: 'add',
actor: '<string>',
part: ['<string>'],
reason: '<string>'
}
],
text: [
{
label: '<string>',
location: {
coord: {
range: {end: 1, start: 1},
kind: 'decoded',
source: [{range: {end: 1, start: 1}, part: '<string>'}]
},
page: 1
},
op: 'add',
actor: '<string>',
part: ['<string>'],
reason: '<string>'
}
]
}
})
};
fetch('https://api.example.com/workspaces/{workspaceId}/detections/{detectionId}/redactions', 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.example.com/workspaces/{workspaceId}/detections/{detectionId}/redactions",
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([
'edits' => [
'audio' => [
[
'label' => '<string>',
'location' => [
'span' => [
'end_us' => 1,
'start_us' => 1
],
'speaker_id' => '<string>'
],
'op' => 'add',
'actor' => '<string>',
'part' => [
'<string>'
],
'reason' => '<string>'
]
],
'image' => [
[
'label' => '<string>',
'location' => [
'bounding_box' => [
'max' => [
'x' => 123,
'y' => 123
],
'min' => [
'x' => 123,
'y' => 123
]
],
'page' => 1,
'polygon' => [
[
'x' => 123,
'y' => 123
]
]
],
'op' => 'add',
'actor' => '<string>',
'part' => [
'<string>'
],
'reason' => '<string>'
]
],
'tabular' => [
[
'label' => '<string>',
'location' => [
'column_index' => 1,
'row_index' => 1,
'column_name' => '<string>',
'end_offset' => 1,
'sheet_name' => '<string>',
'start_offset' => 1
],
'op' => 'add',
'actor' => '<string>',
'part' => [
'<string>'
],
'reason' => '<string>'
]
],
'text' => [
[
'label' => '<string>',
'location' => [
'coord' => [
'range' => [
'end' => 1,
'start' => 1
],
'kind' => 'decoded',
'source' => [
[
'range' => [
'end' => 1,
'start' => 1
],
'part' => '<string>'
]
]
],
'page' => 1
],
'op' => 'add',
'actor' => '<string>',
'part' => [
'<string>'
],
'reason' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/workspaces/{workspaceId}/detections/{detectionId}/redactions"
payload := strings.NewReader("{\n \"edits\": {\n \"audio\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"span\": {\n \"end_us\": 1,\n \"start_us\": 1\n },\n \"speaker_id\": \"<string>\"\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"image\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"bounding_box\": {\n \"max\": {\n \"x\": 123,\n \"y\": 123\n },\n \"min\": {\n \"x\": 123,\n \"y\": 123\n }\n },\n \"page\": 1,\n \"polygon\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"tabular\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"column_index\": 1,\n \"row_index\": 1,\n \"column_name\": \"<string>\",\n \"end_offset\": 1,\n \"sheet_name\": \"<string>\",\n \"start_offset\": 1\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"text\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"coord\": {\n \"range\": {\n \"end\": 1,\n \"start\": 1\n },\n \"kind\": \"decoded\",\n \"source\": [\n {\n \"range\": {\n \"end\": 1,\n \"start\": 1\n },\n \"part\": \"<string>\"\n }\n ]\n },\n \"page\": 1\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/workspaces/{workspaceId}/detections/{detectionId}/redactions")
.header("Content-Type", "application/json")
.body("{\n \"edits\": {\n \"audio\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"span\": {\n \"end_us\": 1,\n \"start_us\": 1\n },\n \"speaker_id\": \"<string>\"\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"image\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"bounding_box\": {\n \"max\": {\n \"x\": 123,\n \"y\": 123\n },\n \"min\": {\n \"x\": 123,\n \"y\": 123\n }\n },\n \"page\": 1,\n \"polygon\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"tabular\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"column_index\": 1,\n \"row_index\": 1,\n \"column_name\": \"<string>\",\n \"end_offset\": 1,\n \"sheet_name\": \"<string>\",\n \"start_offset\": 1\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"text\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"coord\": {\n \"range\": {\n \"end\": 1,\n \"start\": 1\n },\n \"kind\": \"decoded\",\n \"source\": [\n {\n \"range\": {\n \"end\": 1,\n \"start\": 1\n },\n \"part\": \"<string>\"\n }\n ]\n },\n \"page\": 1\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/workspaces/{workspaceId}/detections/{detectionId}/redactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"edits\": {\n \"audio\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"span\": {\n \"end_us\": 1,\n \"start_us\": 1\n },\n \"speaker_id\": \"<string>\"\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"image\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"bounding_box\": {\n \"max\": {\n \"x\": 123,\n \"y\": 123\n },\n \"min\": {\n \"x\": 123,\n \"y\": 123\n }\n },\n \"page\": 1,\n \"polygon\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"tabular\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"column_index\": 1,\n \"row_index\": 1,\n \"column_name\": \"<string>\",\n \"end_offset\": 1,\n \"sheet_name\": \"<string>\",\n \"start_offset\": 1\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"text\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"coord\": {\n \"range\": {\n \"end\": 1,\n \"start\": 1\n },\n \"kind\": \"decoded\",\n \"source\": [\n {\n \"range\": {\n \"end\": 1,\n \"start\": 1\n },\n \"part\": \"<string>\"\n }\n ]\n },\n \"page\": 1\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2023-11-07T05:31:56Z",
"detectionId": "<string>",
"id": "<string>",
"requestedBy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"username": "<string>",
"avatarUrl": "<string>",
"displayName": "<string>"
},
"workspaceHandle": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outputDocumentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"message": "<string>",
"name": "<string>"
}{
"message": "<string>",
"name": "<string>"
}{
"message": "<string>",
"name": "<string>"
}{
"message": "<string>",
"name": "<string>"
}{
"message": "<string>",
"name": "<string>"
}"<string>""<string>"Path Parameters
Workspace identifier.
Opaque identifier of the detection.
^detection_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$Body
Request payload to redact a detection.
The reviewer's edits layer over the detection's analysis before redaction:
suppress a false positive, retag a detection, or add one the analysis missed.
Omit edits to redact with the policy decisions exactly as detected. Each
redact request produces a new redaction.
Request payload to redact a detection.
The reviewer's edits layer over the detection's analysis before redaction:
suppress a false positive, retag a detection, or add one the analysis missed.
Omit edits to redact with the policy decisions exactly as detected. Each
redact request produces a new redaction.
Reviewer edits to apply before redaction, grouped by modality. Omit to redact with the policy decisions exactly as detected.
Show child attributes
Show child attributes
Response
Response type for a redaction.
A redaction is one redact pass over a detection, produced with a specific set
of reviewer edits. It owns the redacted output document (downloadable through
the normal file endpoints) and a review audit recording what was redacted and
why (fetched from the redaction's review endpoint).
Named WorkspaceRedactionResult rather than Redaction because the engine's audit
schema already carries a Redaction (an audit event), and the two must not
collide in the generated OpenAPI.
Response type for a redaction.
A redaction is one redact pass over a detection, produced with a specific set
of reviewer edits. It owns the redacted output document (downloadable through
the normal file endpoints) and a review audit recording what was redacted and
why (fetched from the redaction's review endpoint).
Named WorkspaceRedactionResult rather than Redaction because the engine's audit
schema already carries a Redaction (an audit event), and the two must not
collide in the generated OpenAPI.
When the redaction was created.
The detection this redaction was produced from.
^detection_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$Opaque identifier of the redaction.
^redaction_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$Account that requested the redaction.
Show child attributes
Show child attributes
URL-safe workspace handle. Display-only.
3 - 32^[a-z0-9]+(?:-[a-z0-9]+)*$Unique identifier of the workspace.
Redacted output document this redaction produced. None only if the file
was removed (e.g. by retention).
curl --request POST \
--url https://api.example.com/workspaces/{workspaceId}/detections/{detectionId}/redactions \
--header 'Content-Type: application/json' \
--data '
{
"edits": {
"audio": [
{
"label": "<string>",
"location": {
"span": {
"end_us": 1,
"start_us": 1
},
"speaker_id": "<string>"
},
"op": "add",
"actor": "<string>",
"part": [
"<string>"
],
"reason": "<string>"
}
],
"image": [
{
"label": "<string>",
"location": {
"bounding_box": {
"max": {
"x": 123,
"y": 123
},
"min": {
"x": 123,
"y": 123
}
},
"page": 1,
"polygon": [
{
"x": 123,
"y": 123
}
]
},
"op": "add",
"actor": "<string>",
"part": [
"<string>"
],
"reason": "<string>"
}
],
"tabular": [
{
"label": "<string>",
"location": {
"column_index": 1,
"row_index": 1,
"column_name": "<string>",
"end_offset": 1,
"sheet_name": "<string>",
"start_offset": 1
},
"op": "add",
"actor": "<string>",
"part": [
"<string>"
],
"reason": "<string>"
}
],
"text": [
{
"label": "<string>",
"location": {
"coord": {
"range": {
"end": 1,
"start": 1
},
"kind": "decoded",
"source": [
{
"range": {
"end": 1,
"start": 1
},
"part": "<string>"
}
]
},
"page": 1
},
"op": "add",
"actor": "<string>",
"part": [
"<string>"
],
"reason": "<string>"
}
]
}
}
'import requests
url = "https://api.example.com/workspaces/{workspaceId}/detections/{detectionId}/redactions"
payload = { "edits": {
"audio": [
{
"label": "<string>",
"location": {
"span": {
"end_us": 1,
"start_us": 1
},
"speaker_id": "<string>"
},
"op": "add",
"actor": "<string>",
"part": ["<string>"],
"reason": "<string>"
}
],
"image": [
{
"label": "<string>",
"location": {
"bounding_box": {
"max": {
"x": 123,
"y": 123
},
"min": {
"x": 123,
"y": 123
}
},
"page": 1,
"polygon": [
{
"x": 123,
"y": 123
}
]
},
"op": "add",
"actor": "<string>",
"part": ["<string>"],
"reason": "<string>"
}
],
"tabular": [
{
"label": "<string>",
"location": {
"column_index": 1,
"row_index": 1,
"column_name": "<string>",
"end_offset": 1,
"sheet_name": "<string>",
"start_offset": 1
},
"op": "add",
"actor": "<string>",
"part": ["<string>"],
"reason": "<string>"
}
],
"text": [
{
"label": "<string>",
"location": {
"coord": {
"range": {
"end": 1,
"start": 1
},
"kind": "decoded",
"source": [
{
"range": {
"end": 1,
"start": 1
},
"part": "<string>"
}
]
},
"page": 1
},
"op": "add",
"actor": "<string>",
"part": ["<string>"],
"reason": "<string>"
}
]
} }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
edits: {
audio: [
{
label: '<string>',
location: {span: {end_us: 1, start_us: 1}, speaker_id: '<string>'},
op: 'add',
actor: '<string>',
part: ['<string>'],
reason: '<string>'
}
],
image: [
{
label: '<string>',
location: {
bounding_box: {max: {x: 123, y: 123}, min: {x: 123, y: 123}},
page: 1,
polygon: [{x: 123, y: 123}]
},
op: 'add',
actor: '<string>',
part: ['<string>'],
reason: '<string>'
}
],
tabular: [
{
label: '<string>',
location: {
column_index: 1,
row_index: 1,
column_name: '<string>',
end_offset: 1,
sheet_name: '<string>',
start_offset: 1
},
op: 'add',
actor: '<string>',
part: ['<string>'],
reason: '<string>'
}
],
text: [
{
label: '<string>',
location: {
coord: {
range: {end: 1, start: 1},
kind: 'decoded',
source: [{range: {end: 1, start: 1}, part: '<string>'}]
},
page: 1
},
op: 'add',
actor: '<string>',
part: ['<string>'],
reason: '<string>'
}
]
}
})
};
fetch('https://api.example.com/workspaces/{workspaceId}/detections/{detectionId}/redactions', 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.example.com/workspaces/{workspaceId}/detections/{detectionId}/redactions",
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([
'edits' => [
'audio' => [
[
'label' => '<string>',
'location' => [
'span' => [
'end_us' => 1,
'start_us' => 1
],
'speaker_id' => '<string>'
],
'op' => 'add',
'actor' => '<string>',
'part' => [
'<string>'
],
'reason' => '<string>'
]
],
'image' => [
[
'label' => '<string>',
'location' => [
'bounding_box' => [
'max' => [
'x' => 123,
'y' => 123
],
'min' => [
'x' => 123,
'y' => 123
]
],
'page' => 1,
'polygon' => [
[
'x' => 123,
'y' => 123
]
]
],
'op' => 'add',
'actor' => '<string>',
'part' => [
'<string>'
],
'reason' => '<string>'
]
],
'tabular' => [
[
'label' => '<string>',
'location' => [
'column_index' => 1,
'row_index' => 1,
'column_name' => '<string>',
'end_offset' => 1,
'sheet_name' => '<string>',
'start_offset' => 1
],
'op' => 'add',
'actor' => '<string>',
'part' => [
'<string>'
],
'reason' => '<string>'
]
],
'text' => [
[
'label' => '<string>',
'location' => [
'coord' => [
'range' => [
'end' => 1,
'start' => 1
],
'kind' => 'decoded',
'source' => [
[
'range' => [
'end' => 1,
'start' => 1
],
'part' => '<string>'
]
]
],
'page' => 1
],
'op' => 'add',
'actor' => '<string>',
'part' => [
'<string>'
],
'reason' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/workspaces/{workspaceId}/detections/{detectionId}/redactions"
payload := strings.NewReader("{\n \"edits\": {\n \"audio\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"span\": {\n \"end_us\": 1,\n \"start_us\": 1\n },\n \"speaker_id\": \"<string>\"\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"image\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"bounding_box\": {\n \"max\": {\n \"x\": 123,\n \"y\": 123\n },\n \"min\": {\n \"x\": 123,\n \"y\": 123\n }\n },\n \"page\": 1,\n \"polygon\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"tabular\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"column_index\": 1,\n \"row_index\": 1,\n \"column_name\": \"<string>\",\n \"end_offset\": 1,\n \"sheet_name\": \"<string>\",\n \"start_offset\": 1\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"text\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"coord\": {\n \"range\": {\n \"end\": 1,\n \"start\": 1\n },\n \"kind\": \"decoded\",\n \"source\": [\n {\n \"range\": {\n \"end\": 1,\n \"start\": 1\n },\n \"part\": \"<string>\"\n }\n ]\n },\n \"page\": 1\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/workspaces/{workspaceId}/detections/{detectionId}/redactions")
.header("Content-Type", "application/json")
.body("{\n \"edits\": {\n \"audio\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"span\": {\n \"end_us\": 1,\n \"start_us\": 1\n },\n \"speaker_id\": \"<string>\"\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"image\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"bounding_box\": {\n \"max\": {\n \"x\": 123,\n \"y\": 123\n },\n \"min\": {\n \"x\": 123,\n \"y\": 123\n }\n },\n \"page\": 1,\n \"polygon\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"tabular\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"column_index\": 1,\n \"row_index\": 1,\n \"column_name\": \"<string>\",\n \"end_offset\": 1,\n \"sheet_name\": \"<string>\",\n \"start_offset\": 1\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"text\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"coord\": {\n \"range\": {\n \"end\": 1,\n \"start\": 1\n },\n \"kind\": \"decoded\",\n \"source\": [\n {\n \"range\": {\n \"end\": 1,\n \"start\": 1\n },\n \"part\": \"<string>\"\n }\n ]\n },\n \"page\": 1\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/workspaces/{workspaceId}/detections/{detectionId}/redactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"edits\": {\n \"audio\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"span\": {\n \"end_us\": 1,\n \"start_us\": 1\n },\n \"speaker_id\": \"<string>\"\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"image\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"bounding_box\": {\n \"max\": {\n \"x\": 123,\n \"y\": 123\n },\n \"min\": {\n \"x\": 123,\n \"y\": 123\n }\n },\n \"page\": 1,\n \"polygon\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"tabular\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"column_index\": 1,\n \"row_index\": 1,\n \"column_name\": \"<string>\",\n \"end_offset\": 1,\n \"sheet_name\": \"<string>\",\n \"start_offset\": 1\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ],\n \"text\": [\n {\n \"label\": \"<string>\",\n \"location\": {\n \"coord\": {\n \"range\": {\n \"end\": 1,\n \"start\": 1\n },\n \"kind\": \"decoded\",\n \"source\": [\n {\n \"range\": {\n \"end\": 1,\n \"start\": 1\n },\n \"part\": \"<string>\"\n }\n ]\n },\n \"page\": 1\n },\n \"op\": \"add\",\n \"actor\": \"<string>\",\n \"part\": [\n \"<string>\"\n ],\n \"reason\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2023-11-07T05:31:56Z",
"detectionId": "<string>",
"id": "<string>",
"requestedBy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"username": "<string>",
"avatarUrl": "<string>",
"displayName": "<string>"
},
"workspaceHandle": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outputDocumentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"message": "<string>",
"name": "<string>"
}{
"message": "<string>",
"name": "<string>"
}{
"message": "<string>",
"name": "<string>"
}{
"message": "<string>",
"name": "<string>"
}{
"message": "<string>",
"name": "<string>"
}"<string>""<string>"