Delete User Files from Rev AI

By Ellen Cohen, Head of Sales (Voice) and Vikram Vaswani, Developer Advocate - Jul 26, 2022

Introduction

At Rev AI, customer security and privacy are extremely important to us. We believe that users should have the ability to delete their media and transcription data from Rev AI's servers as per their own requirements.

To this end, Rev AI offers users three possible approaches to delete their files. This tutorial explains these three approaches.

Assumptions

This tutorial assumes that you have a Rev AI account and access token. If not, sign up for a free account and generate an access token.

Default policy

By default, job data is stored up to a maximum of 30 days. After 30 days, all associated data is deleted and is irretrievable. However, as described below, it is also possible to configure jobs to be deleted earlier than this 30-day maximum.

Approach 1: Enable automatic job deletion

Jobs can be automatically deleted after a specified period. This setting can be enabled by navigating to your account page and specifying the auto-deletion period in the Job Settings section, as shown below:

Job deletion setting

Once this setting is enabled, Rev AI will delete each job and its associated data shortly after the specified time period elapses.

attention

Changes made to this setting will apply only to subsequent jobs and may require up to five minutes to take effect.

Approach 2: Delete jobs manually after completion

Jobs can be deleted by submitting a DELETE HTTP request to the API endpoint at https://api.rev.ai/speechtotext/v1/jobs/<ID>. Replace the <ID> placeholder with the unique identifier for the job you wish to delete. The request must include your Rev AI access token.

Here is an example of a deletion request:

Copy
Copied
curl -X DELETE "https://api.rev.ai/speechtotext/v1/jobs/<ID>" \
     -H "Authorization: Bearer <REVAI_ACCESS_TOKEN>"

If accepted, all data related to the job, such as input media and transcript, will be permanently deleted and the API will return a 204 status code. A job can only be deleted once completed (either with success or failure).

When there are multiple jobs to be deleted, one approach would be to list the job identifiers in a separate file, one per line, and then loop over the file using a script like the one below:

Copy
Copied
#!/bin/bash
while read id; do
  curl -X DELETE "https://api.rev.ai/speechtotext/v1/jobs/$id" -H "Authorization: Bearer <REVAI_ACCESS_TOKEN>"
  echo "Job $id submitted for deletion."
done <jobs.txt

Approach 3: Specify job deletion controls at submission time

Job deletion can be controlled by adding the delete_after_seconds query parameter to the job request. This parameter specifies how many seconds after completion the job data should be deleted.

The number of seconds provided must range from 0 to 2592000 (30 days). When set to 0, the audio and transcript are immediately deleted and are never stored.

Here is an example of an asynchronous job request:

Copy
Copied
curl -X POST "https://api.rev.ai/speechtotext/v1/jobs" \
     -H "Authorization: Bearer <REVAI_ACCESS_TOKEN>" \
     -H "Content-Type: application/json" \
     -d '{"source_config": {"url": "https://www.rev.ai/FTC_Sample_1.mp3"},"delete_after_s econds":"120"}'

Here is an example of a streaming job request:

Copy
Copied
wss://api.rev.ai/speechtotext/v1/stream?access_token=<REVAI_ACCESS_TOKEN>&content_type=audio/x-
raw;layout=interleaved;rate=16000;format=S16LE;channels=1&delete_after_seconds=120

The delete_after_seconds query parameter is also supported in other Rev AI APIs. Refer to the API documentation for more details.

attention

The delete_after_seconds query parameter is optional but when provided, it overrides the auto-deletion setting on your Rev AI account.

Next steps

Learn more about Rev AI APIs and their support for data deletion by visiting the following links: