PII/PHI Redaction Batch
Transcribe a pre-recorded audio file and redact PII/PHI from both the transcript text and the returned audio.
curl --request POST \
--url https://platform.modulate.ai/api/velma-2-pii-phi-redaction-batch \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-Key: <api-key>' \
--form upload_file='@example-file' \
--form speaker_diarization=true \
--form start_redaction_padding_ms=100 \
--form end_redaction_padding_ms=0 \
--form 'language=<string>'import requests
url = "https://platform.modulate.ai/api/velma-2-pii-phi-redaction-batch"
files = { "upload_file": ("example-file", open("example-file", "rb")) }
payload = {
"speaker_diarization": "true",
"start_redaction_padding_ms": "100",
"end_redaction_padding_ms": "0",
"language": "<string>"
}
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('upload_file', '<string>');
form.append('speaker_diarization', 'true');
form.append('start_redaction_padding_ms', '100');
form.append('end_redaction_padding_ms', '0');
form.append('language', '<string>');
const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
options.body = form;
fetch('https://platform.modulate.ai/api/velma-2-pii-phi-redaction-batch', 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://platform.modulate.ai/api/velma-2-pii-phi-redaction-batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"upload_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"speaker_diarization\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"start_redaction_padding_ms\"\r\n\r\n100\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"end_redaction_padding_ms\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"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://platform.modulate.ai/api/velma-2-pii-phi-redaction-batch"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"upload_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"speaker_diarization\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"start_redaction_padding_ms\"\r\n\r\n100\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"end_redaction_padding_ms\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://platform.modulate.ai/api/velma-2-pii-phi-redaction-batch")
.header("X-API-Key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"upload_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"speaker_diarization\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"start_redaction_padding_ms\"\r\n\r\n100\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"end_redaction_padding_ms\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.modulate.ai/api/velma-2-pii-phi-redaction-batch")
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.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"upload_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"speaker_diarization\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"start_redaction_padding_ms\"\r\n\r\n100\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"end_redaction_padding_ms\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"metadata": {
"text": "Hello, my name is <pii:name></pii:name>.",
"duration_ms": 5000,
"utterances": [
{
"utterance_uuid": "e5f6a7b8-c9d0-1234-efab-345678901234",
"text": "Hello, my name is <pii:name></pii:name>.",
"start_ms": 0,
"duration_ms": 3000,
"speaker": 1,
"language": "en"
}
],
"redaction_ranges": [
[
1600,
2400
]
]
},
"audio": "(binary MP3 data)"
}Authorizations
API key used for authentication and usage tracking.
Body
Audio file to transcribe and redact. Supported formats: AAC, AIFF, FLAC, MP3, MP4, MOV, OGG, Opus, WAV, WebM. Maximum file size: 100MB. Empty files are rejected.
Speaker diarization identifies different speakers in the audio. When enabled, each utterance includes a speaker identifier (e.g., 1, 2).
Additional silence in milliseconds to prepend before each redacted audio range. Extends the silenced region earlier in time to provide a buffer before PII/PHI content.
x >= 0Additional silence in milliseconds to append after each redacted audio range. Extends the silenced region later in time to provide a buffer after PII/PHI content.
x >= 0Optional language hint as a case-insensitive ISO 639-1 code (e.g. "en", "fr"). BCP 47 region/script subtags (e.g. "en-US") are accepted; only the primary language subtag is used. When omitted, the language is detected automatically for each utterance.
^[A-Za-z]{2,3}([-_][A-Za-z0-9]+)*$curl --request POST \
--url https://platform.modulate.ai/api/velma-2-pii-phi-redaction-batch \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-Key: <api-key>' \
--form upload_file='@example-file' \
--form speaker_diarization=true \
--form start_redaction_padding_ms=100 \
--form end_redaction_padding_ms=0 \
--form 'language=<string>'import requests
url = "https://platform.modulate.ai/api/velma-2-pii-phi-redaction-batch"
files = { "upload_file": ("example-file", open("example-file", "rb")) }
payload = {
"speaker_diarization": "true",
"start_redaction_padding_ms": "100",
"end_redaction_padding_ms": "0",
"language": "<string>"
}
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('upload_file', '<string>');
form.append('speaker_diarization', 'true');
form.append('start_redaction_padding_ms', '100');
form.append('end_redaction_padding_ms', '0');
form.append('language', '<string>');
const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
options.body = form;
fetch('https://platform.modulate.ai/api/velma-2-pii-phi-redaction-batch', 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://platform.modulate.ai/api/velma-2-pii-phi-redaction-batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"upload_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"speaker_diarization\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"start_redaction_padding_ms\"\r\n\r\n100\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"end_redaction_padding_ms\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"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://platform.modulate.ai/api/velma-2-pii-phi-redaction-batch"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"upload_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"speaker_diarization\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"start_redaction_padding_ms\"\r\n\r\n100\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"end_redaction_padding_ms\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://platform.modulate.ai/api/velma-2-pii-phi-redaction-batch")
.header("X-API-Key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"upload_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"speaker_diarization\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"start_redaction_padding_ms\"\r\n\r\n100\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"end_redaction_padding_ms\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.modulate.ai/api/velma-2-pii-phi-redaction-batch")
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.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"upload_file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"speaker_diarization\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"start_redaction_padding_ms\"\r\n\r\n100\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"end_redaction_padding_ms\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"metadata": {
"text": "Hello, my name is <pii:name></pii:name>.",
"duration_ms": 5000,
"utterances": [
{
"utterance_uuid": "e5f6a7b8-c9d0-1234-efab-345678901234",
"text": "Hello, my name is <pii:name></pii:name>.",
"start_ms": 0,
"duration_ms": 3000,
"speaker": 1,
"language": "en"
}
],
"redaction_ranges": [
[
1600,
2400
]
]
},
"audio": "(binary MP3 data)"
}