Mask in batch
Masks several texts in a single request. The response is mapped to the input order. The length limit is applied over the combined total text.
POST
/mask/batchRequest body
requiredapplication/jsontextsstring[]requiredThe list of texts to mask.
transformstringdefault: "placeholder"
Allowed:
placeholdermasksurrogatereturn_vaultbooleandefault: false
Responses
200Masking result for each input
resultsMaskResponse[]Show propertiesHide properties
Array of
MaskResponsemasked_textstringThe masked text.
transformstringspansSpan[]Show propertiesHide properties
Array of
Spancategorystringstartintegerendintegerscorenumbertimings_msobjectTotal processing time (ms): only { total }.
vaultobjectIf return_vault=true, the placeholder to original mapping (sensitive).
401Missing or invalid virtual key
413Too many texts, or the combined total text exceeded the length limit
422Invalid request body
detailValidationError[]Show propertiesHide properties
Array of
ValidationErrorlocstring | integer[]Show propertiesHide properties
Array of
string | integerAny of:
string
stringinteger
integermsgstringtypestringRequest
import requests
response = requests.post(
"https://gw-tr.gurubase.io/mask/batch",
headers={
"Content-Type": "application/json"
},
json={
"texts": [
"Ahmet Yılmaz aradı.",
"IBAN: TR12 0001 0000 0000 0000 0000 01"
]
},
)curl -X POST "https://gw-tr.gurubase.io/mask/batch" \
-H "Content-Type: application/json" \
-d '{
"texts": [
"Ahmet Yılmaz aradı.",
"IBAN: TR12 0001 0000 0000 0000 0000 01"
]
}'const response = await fetch("https://gw-tr.gurubase.io/mask/batch", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"texts": [
"Ahmet Yılmaz aradı.",
"IBAN: TR12 0001 0000 0000 0000 0000 01"
]
})
});Response
{
"results": [
{
"masked_text": "string",
"transform": "string",
"spans": [
{
"category": "person",
"start": 0,
"end": 0,
"score": 0.85
}
],
"timings_ms": {},
"vault": {}
}
]
}Missing or invalid virtual key
Too many texts, or the combined total text exceeded the length limit
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}