Redact sensitive data from several texts
POST/api/v2/privacyfilter/batch
Same detection as the redact method over a set of texts in a single round trip, answering one result per input in the same order.
Request
- application/json
Body
required
Texts to scan for sensitive data, answered with one result each in the same order.
Whether the returned texts have each detected span replaced by an indexed placeholder. Defaults to true.
Entity categories to restrict detection to, taken from the info method's labels. Detects every
category when omitted.
Responses
- 200
- 400
- 401
- 403
- 422
- 500
Success
- application/json
- Schema
- Example (from schema)
- Example
Schema
Array [
Array [
]
]
Input text with every detected span redacted.
spans
object[]
nullable
Detected sensitive spans, positioned against the original text.
Detected category, one of the labels reported by the info method.
Detection confidence, between 0 and 1.
Matched text.
Start offset in the original text, as a Unicode code point index.
End offset in the original text, as a Unicode code point index.
Placeholder this span was replaced with, when placeholders were requested.
[
{
"text": "string",
"spans": [
{
"entity_group": "string",
"score": 0,
"word": "string",
"start": 0,
"end": 0,
"placeholder": "string"
}
]
}
]
[
{
"text": "[PERSON] lives at [ADDRESS]. Email [EMAIL]",
"spans": [
{
"entity_group": "private_person",
"score": 1,
"word": "John Doe",
"start": 0,
"end": 8,
"placeholder": "<PRIVATE_PERSON>"
},
{
"entity_group": "private_address",
"score": 1,
"word": "12 Oak Street, Madrid",
"start": 18,
"end": 39,
"placeholder": "<PRIVATE_ADDRESS>"
},
{
"entity_group": "private_email",
"score": 1,
"word": "[email protected]",
"start": 47,
"end": 67,
"placeholder": "<PRIVATE_EMAIL>"
}
]
}
]
If no connection setting is configured for the Privacy Filter service (validation_error).
- application/json
- Schema
- Example (from schema)
Schema
- MOD1
- MOD2
Array [
]
Stable, machine-readable error code. Branch on this value, not on message.
Human-readable, localised summary of the error.
Link to the documentation section for this error code.
errors
object
nullable
Map of keys (an invalid request field or the rule that failed) to messages. Only present when the error has specific detail to report. Values are strings, except on input_validation_error, where each value is an array of messages for that field.
property name*
object
nullable
oneOf
string
string
{
"code": "string",
"message": "string",
"documentationUrl": "string",
"errors": {}
}
The request is not authenticated.
- application/json
- Schema
- Example (from schema)
Schema
Stable, machine-readable error code. Branch on this value, not on message.
Human-readable, localised summary of the error.
Link to the documentation section for this error code.
{
"code": "string",
"message": "string",
"documentationUrl": "string"
}
The caller is not allowed to execute AI services.
- application/json
- Schema
- Example (from schema)
Schema
Stable, machine-readable error code. Branch on this value, not on message.
Human-readable, localised summary of the error.
Link to the documentation section for this error code.
{
"code": "string",
"message": "string",
"documentationUrl": "string"
}
The hosted service rejected the request body.
Internal server error.
- application/json
- Schema
- Example (from schema)
Schema
Stable, machine-readable error code. Branch on this value, not on message.
Human-readable, localised summary of the error.
Link to the documentation section for this error code.
{
"code": "string",
"message": "string",
"documentationUrl": "string"
}