Supported languages
Supported languages
Supported models
Supported models
Supported regions
Supported regions
US & EU
- With
hashsubstitution:Hi, my name is ####! - With
entity_namesubstitution:Hi, my name is [PERSON_NAME]!
Quickstart
- Python
- Python SDK
- JavaScript
- JavaScript SDK
Enable Topic Detection by setting
redact_pii to True in the JSON payload.Set redact_pii_policies to specify the information you want to redact. For the full list of policies, see PII policies.Set redact_pii_sub to specify the replacement for redacted information.Example output
Create redacted audio files
In addition to redacting sensitive information from the transcription text, you can also generate a version of the original audio file with the PII “beeped” out. You can optionally use silence instead of a beep by settingoverride_audio_redaction_method to "silence" within redact_pii_audio_options.
- Python
- Python SDK
- JavaScript
- JavaScript SDK
To create a redacted version of the audio file, set
redact_pii_audio to True on the JSON payload.
Set redact_pii_audio_quality to specify the quality of the redacted audio file.Use the transcript ID to poll the GET redacted audio endpoint every few seconds to check the status of the redacted audio. Once the status is redacted_audio_ready, you can retrieve the audio URL from the API response.Redacted Audio for Silent FilesBy default, audio redaction provides redacted audio URLs only when speech is detected. However, if your use-case specifically requires redacted audio files even for silent audio files without any dialogue, you can now opt to receive these URLs. Enable this by setting the optional parameter
"return_redacted_no_speech_audio": true within redact_pii_audio_options in your POST request body.Example request body
Example request body
Example output
Return the unredacted transcript
If your workflow needs both the redacted and unredacted transcripts, you can request both in a single transcription call by settingredact_pii_return_unredacted to true. This avoids the need to send a second API request without redaction.
When redact_pii_return_unredacted is true, the response includes three additional fields alongside their redacted counterparts:
- Python
- Python SDK
- JavaScript
- JavaScript SDK
Set
redact_pii_return_unredacted to True alongside the existing PII parameters. The completed transcript will include unredacted_text, unredacted_words, and unredacted_utterances in addition to the redacted versions.Example response
Static Entity Redaction
PII Redaction detects broad categories of sensitive information (names, phone numbers, and the other PII policies) using an AI model. Static Entity Redaction complements this for cases where you need to redact specific, predefined terms that may not fit into general PII categories — for example a proprietary product name, an internal project codename, or an org-specific identifier. You supply a map ofredact_static_entities, where each key is a label and each value is a list of exact terms to redact. Any matching term in the transcript is replaced with that label, on top of the standard PII redaction.
The substitution follows your existing redact_pii_sub setting:
entity_name— the matched term is replaced with[LABEL](the uppercased map key).hash— the matched term’s characters are replaced with#.
redact_pii_audio: true), the matched terms are also bleeped from the audio output alongside standard PII.
- Python
- JavaScript
Pass
redact_static_entities alongside your existing PII parameters. Each key is the redaction label; each value is the list of terms to match.Example response
Matched terms appear redacted inline intext, words, and utterances, exactly like standard PII. There are no additional response fields. For the transcript “Our internal tool Bearclaw is powered by Universal-3.5 Pro.” with the request above:
API reference
Request
Response
The response also includes the request parameters used to generate the transcript.
Request for Redacted Audio
In the request URL, replace transcript_id with the ID of the transcript whereredact_pii_audio is set to true.
Response for Redacted Audio
PII policies
Granular location policies
Thelocation_* policies let you redact specific parts of a location without redacting the rest — for example, redacting street addresses while keeping city and state visible.
Which policy matches a given span is shape-dependent:
- A full contiguous mailing address (street, city, state, and ZIP together, e.g.
145 Windsor St., Toronto, ON M5A 2P5) is treated as a singlelocation_addressspan. To redact it, includelocation_addressinredact_pii_policies. - A standalone location fragment is tagged as its specific subtype. A lone street redacts as
location_address_street, a lone city aslocation_city, a lone state aslocation_state, a lone country aslocation_country, a lone ZIP aslocation_zip, and coordinates aslocation_coordinate. - A combined phrase that mixes location parts without forming a full address — for example
Toronto, Canada— is treated as a single genericlocationspan. To redact it, include the broadlocationpolicy inredact_pii_policies. The granular subtypes alone won’t match it.
These granular subtypes apply to PII redaction only. Entity Detection returns all location references under the single
location entity type, not as location_address, location_city, and so on.Troubleshooting
Why is the PII not redacted in my transcription?
Why is the PII not redacted in my transcription?
Make sure that at least one PII policy has been specified in
your request, using the
redact_pii_policies parameter. If you’re still
experiencing issues, please reach out to our support team for assistance.Why is my webhook not being sent?
Why is my webhook not being sent?
There could be several reasons why your webhook isn’t being sent, such as a
misconfigured URL, an unreachable endpoint, or an issue with the
authentication headers. Double-check your request and ensure that the
webhook_url parameter is included with a valid URL that can be reached by
AssemblyAI’s API. If you’re using custom authentication headers, ensure that
the webhook_auth_header_name and webhook_auth_header_value parameters are
included and are correct. If you’re still having issues, please contact our
support team for assistance.Why does my redacted audio file sound worse than the original?
Why does my redacted audio file sound worse than the original?
By default, the API returns redacted audio files in MP3 format, a lossy
format. Lossy formats remove audio information to reduce file size, which may
cause a reduction in quality. The difference may be particularly noticeable if
the submitted audio is in a lossless file format. To retain as much quality as
possible, you can instead return your redacted audio files in a lossless
format, by setting
redact_pii_audio_quality to wav.