Getting Started with Rev's Legal Transcription API
This tutorial walks your developers through their first legal transcription order with Rev’s Legal Transcription API. You’ll get API keys, send a test request, look up a transcript template, place a sandbox order, download the finished transcript and move to production.
The Legal Transcription API is for legal transcripts only: court-formatted transcripts made by legal-trained experts and priced per page. It’s separate from Rev’s standard transcription API. For an overview of what you can order, see Legal Transcription API with Rev. For every field and option, see the Rev API documentation.
In this article
- Step 1: Set Up a Legal Account
- Step 2: Get Your Client and User API Keys
- Step 3: Send Your First Request
- Step 4: Find Your Template
- Step 5: Place a Sandbox Order
- Step 6: Download the Completed Transcript
- Step 7: Move to Production
Step 1: Set Up a Legal Account
To place legal orders through the API, you need a Rev account set up for legal transcription. Only legal customers can place legal orders. Contact Sales to get started, and Rev’s team will set up your account for legal ordering. If you already have a legal account, email legalsupport@rev.com to turn on API ordering.
Step 2: Get Your Client and User API Keys
Every API request needs two keys: a Client API Key, which identifies your integration and works with any of your users’ keys, and a User API Key, which identifies the Rev account placing the order.
Client API Key
- Open the Rev API documentation.
- Select Start Building.
-
In the Start building with the Rev API window, choose what you’re most interested in, whether you’re a software developer and your programming language.
- Select Start Building.
- Rev emails you your Client API Key with the subject “Getting started with the Rev API.”
New keys can only place sandbox orders until Rev turns on production access (see Step 7).
User API Key
- Sign in to the Rev account that will place orders and open Account Settings.
- On the My account tab, next to V1 API user key, select Regenerate.
-
In the Regenerate API Key window, select Regenerate API Key.
- Copy the key that appears and store it somewhere secure.
Once the window is closed you are not able to view the same API key again and it cannot be retrieved at a later time by anyone. If you lose a user key, a new one will need to be generated.
Step 3: Send Your First Request
All operations with our API must be executed over HTTPS. The API endpoints start with:
https://api.rev.com/
Every API request must be authenticated via the Authorization header, where you paste in your client and user keys. If you don’t have them yet, see Step 2: Get Your Client and User API Keys.
Rev [Client API Key]:[User API Key]
Now let’s make our first request using the API. All examples in the Quick Start use cURL, a simple command line tool for transferring data. You can access cURL in the following ways:
- On PC, Mac, or Linux: Using Postman to interpret cURL commands- our recommended tool
- On a PC: by downloading cURL
- On a Mac or Linux: via Terminal, where cURL should be installed by default
Run the following GET /orders request; it returns all the orders you’ve placed.
curl -X GET \
https://api.rev.com/api/v1/orders \
-H 'Authorization: Rev [ClientApiKey]:[UserAPIKey]'
var https = require('https');
var options = {
host: 'api.rev.com',
path: '/api/v1/orders',
method: 'GET',
headers: {
'Authorization': 'Rev [ClientApiKey]:[UserAPIKey]'
}
};
var req = https.request(options, (resp) => {
var data = [];
resp.on('data', (chunk) => {
data.push(chunk);
});
resp.on('end', function() {
console.log('Status Code:', resp.statusCode);
console.log(JSON.parse(data));
});
});
req.end();
What you see in response will depend on whether you've placed orders with Rev before.
- If you have placed orders with us, you'll see up to your last 25 orders.
- If you have not placed an order before, you should receive the result below. We’ll be placing an order in the next step.
{
"total_count": 0,
"results_per_page": 25,
"page": 0,
"orders": []
}Voilá! You have now completed your first request with the Rev API.
Step 4: Find Your Template
Ready to Certify and Ready to Certify Premium orders need a transcript template. This request lists every template your account can use: your organization’s custom templates and Rev’s standard templates. To see only Rev’s standard templates, which you need for Ready to Certify orders, add ?rev_standard=true to the URL. You can also filter by proceeding_type or jurisdiction.
curl -X GET \
https://api.rev.com/api/v1/templates \
-H 'Authorization: Rev [ClientApiKey]:[UserAPIKey]'
var https = require('https');
var options = {
host: 'api.rev.com',
path: '/api/v1/templates',
method: 'GET',
headers: {
'Authorization': 'Rev [ClientApiKey]:[UserAPIKey]'
}
};
var req = https.request(options, (resp) => {
var data = [];
resp.on('data', (chunk) => {
data.push(chunk);
});
resp.on('end', function() {
console.log('Status Code:', resp.statusCode);
console.log(JSON.parse(data));
});
});
req.end();
Copy the id of the template you want. You’ll use it in Step 5. You don’t need a template if you’re only ordering an Instant Rough Draft or Human Rough Draft.
{
"templates": [
{
"id": 21904476,
"proceeding_type": "deposition",
"name": "Rev Standard Deposition NY",
"jurisdiction": "NY",
"rev_standard": true,
"sample_url": "https://www.rev.com/sample-template-url"
},
{
"id": 527310255,
"proceeding_type": "hearing",
"name": "My Hearing Template GA",
"jurisdiction": "GA",
"rev_standard": false,
"sample_url": "https://www.rev.com/sample-template-url"
}
]
}Back to topStep 5: Place a Sandbox Order
Now you’re ready to place a test order. Include "sandbox_mode": true so no real work is done and you aren’t charged. Sandbox orders go through every step of a real order.
Submit the Order
To submit an order you’ll need to provide a link to a file that is available for download. This can be a public, Pre-signed or Signed URL as long as the Rev system has access to download. The link to the media file is provided with the first external_link property in the inputs object.
To attach additional legal resources and backup audio to an order, provide download accessible URL links to the files.
The request below places a sandbox order for an Instant Rough Draft and a Ready to Certify transcript of a deposition. It includes three supporting documents, and the Ready to Certify transcript is due in 3 business days. Replace template with a Rev standard template ID from Step 4.
Each order covers one proceeding. List the transcripts you want in deliverable_options. You can set business_days for each one, or leave it out to use the default turnaround. Backup audio (backups) is only accepted on Ready to Certify Premium orders.
curl -i -X POST https://api.rev.com/api/v1/orders \
-H 'Authorization: Rev [ClientApiKey]:[UserAPIKey]' \
-H 'Content-Type: application/json' \
-d '{
"sandbox_mode": true,
"client_ref": "Legal API test order",
"transcription_options": {
"inputs": [
{
"external_link": "https://cf-public.rev.com/api-samples/audio.mp3",
"speakers": ["John", "Jane", "Sam Jones"],
"glossary": ["cryptography", "MD5", "SHA-1", "bcrypt"],
"legal_resources": [
{ "type": "notice", "external_link": "https://cf-public.rev.com/api-samples/notice.pdf", "name": "Test notice 1.pdf" },
{ "type": "reporter_notes", "external_link": "https://cf-public.rev.com/api-samples/reporter_notes.txt", "name": "test reporter notes 1.txt" },
{ "type": "tag_file", "external_link": "https://cf-public.rev.com/api-samples/tag_file.txt", "name": "test tag file 1.txt" }
]
}
],
"deliverable_options": [
{ "deliverable_type": "legal_ai_rough_draft" },
{ "deliverable_type": "legal_ready_to_certify_standard", "business_days": 3 }
],
"proceeding_type": "deposition",
"template": 21904476
},
"notification": {
"url": "http://www.clientsite.com/orderupdate",
"level": "Detailed",
"content_type": "ApplicationJson"
}
}'
var https = require('https');
var post_data = JSON.stringify({
sandbox_mode: true,
client_ref: 'Legal API test order',
transcription_options: {
inputs: [
{
external_link: 'https://cf-public.rev.com/api-samples/audio.mp3',
speakers: ['John', 'Jane', 'Sam Jones'],
glossary: ['cryptography', 'MD5', 'SHA-1', 'bcrypt'],
legal_resources: [
{ type: 'notice', external_link: 'https://cf-public.rev.com/api-samples/notice.pdf', name: 'Test notice 1.pdf' },
{ type: 'reporter_notes', external_link: 'https://cf-public.rev.com/api-samples/reporter_notes.txt', name: 'test reporter notes 1.txt' },
{ type: 'tag_file', external_link: 'https://cf-public.rev.com/api-samples/tag_file.txt', name: 'test tag file 1.txt' }
]
}
],
deliverable_options: [
{ deliverable_type: 'legal_ai_rough_draft' },
{ deliverable_type: 'legal_ready_to_certify_standard', business_days: 3 }
],
proceeding_type: 'deposition',
template: 21904476
},
notification: {
url: 'http://www.clientsite.com/orderupdate',
level: 'Detailed',
content_type: 'ApplicationJson'
}
});
var options = {
host: 'api.rev.com',
path: '/api/v1/orders',
method: 'POST',
headers: {
'Authorization': 'Rev [ClientApiKey]:[UserAPIKey]',
'Content-Type': 'application/json'
}
};
var post_req = https.request(options, (resp) => {
var data = [];
resp.on('data', (chunk) => data.push(chunk));
resp.on('end', () => {
console.log('Status Code:', resp.statusCode);
console.log('Location:', resp.headers.location);
console.log(Buffer.concat(data).toString());
});
});
post_req.write(post_data);
post_req.end();
The Response
If the order is accepted, you get a 201 Created response. The Location header has the order’s URL, which you’ll use in Step 6. The response body lists each transcript you ordered with its expected delivery_date (in UTC):
{
"deliverables": [
{ "deliverable_type": "legal_ready_to_certify_standard", "delivery_date": "2024-07-27T03:59:59Z" },
{ "deliverable_type": "legal_ai_rough_draft", "delivery_date": "2024-07-24T19:06:58.59Z" }
]
}Step 6: Download the Completed Transcript
A sandbox order moves through each step of Rev’s workflow about every 5 minutes until it’s complete. Then it has a sample transcript attached, which always contains the same text. If you set up notifications in Step 5, Rev posts to your URL as the order changes status. Otherwise, check the order’s status with the request below.
Find the Transcript ID
Use the order number from the Location header with GET /orders/{ordernum}. For legal orders, this returns legal details too. See Get Order — Legal.
curl -X GET \
https://api.rev.com/api/v1/orders/TC0938707965 \
-H 'Authorization: Rev [ClientApiKey]:[UserAPIKey]'
var https = require('https');
var options = {
host: 'api.rev.com',
path: '/api/v1/orders/TC0938707965',
method: 'GET',
headers: {
'Authorization': 'Rev [ClientApiKey]:[UserAPIKey]'
}
};
var req = https.request(options, (resp) => {
var data = [];
resp.on('data', (chunk) => {
data.push(chunk);
});
resp.on('end', function() {
console.log('Status Code:', resp.statusCode);
console.log(JSON.parse(data));
});
});
req.end();
The response includes:
-
status:
Completewhen all transcripts are ready, orCanceled. -
attachments: your media file (
"kind": "media") and each transcript ("kind": "transcript"), each with anid. -
legal_transcription: the
proceeding_type, thetemplateused, anddeliverable_details, which lists each transcript’sdeliverable_type, expecteddelivery_dateanddelivered_ondate (all in UTC).
Copy the id of the transcript attachment, not the media attachment.
Download the Transcript
Use GET /attachments/{id}/content with the transcript id. Choose the file format with the Accept header or by adding an extension to the URL (for example, .docx). Each call returns one format.
- Word (.docx): Instant Rough Draft, Human Rough Draft, and Ready to Certify if Word is your account’s preferred legal file type.
- PDF (.pdf): Instant Rough Draft and Human Rough Draft.
- Text (.txt): Instant Rough Draft, Human Rough Draft, and Ready to Certify if text is your preferred legal file type.
- JSON (.json): all legal transcripts. JSON includes per-word timestamps and labels each section, such as question, answer, colloquy or exhibit.
The download includes any edits made in the editor once all editing sessions have been closed for at least two minutes. See Download Attachment — Legal.
curl -X GET \
https://api.rev.com/api/v1/attachments/6SWCOBmRAwAAAAAA/content \
-H 'Accept: application/vnd.openxmlformats-officedocument.wordprocessingml.document' \
-H 'Authorization: Rev [ClientApiKey]:[UserAPIKey]'
var fs = require('fs');
...
var req = https.request(options, (resp) => {
var data = [];
resp.on('data', (chunk) => data.push(chunk));
resp.on('end', () => {
console.log('Status Code:', resp.statusCode);
fs.writeFileSync('transcript.docx', Buffer.concat(data));
});
});Now that you’ve received a completed file, you’ve walked through all the major steps of using the Rev API.
Going Further with the API
- Notifications (webhooks): get status updates sent to your URL.
- List Orders — Legal: see all your legal orders.
- Deliverable Options: check which transcripts and turnaround times are available.
- New Legal Transcription order: every order field, including combining split recordings and trial resources.
Step 7: Move to Production
- Email legalsupport@rev.com to turn on production ordering for your Client API Key.
- Set up payment: add a prepaid balance or arrange invoicing (see below).
- Once Rev confirms production access is on, place orders without
sandbox_mode(or set it tofalse).
Prepaid Balance
API orders are paid from your account’s prepaid balance unless you’re set up for invoicing.
- Open Account Settings.
- On the My account tab, under Prepay Info, select Add to balance.
- Add enough to cover your first order.
See Prepaid Balance.
Invoicing
To be invoiced instead, contact your Rev account representative or legalsupport@rev.com. Invoiced customers get a bill at the end of the month and have 30 days to pay. If you’re invoiced, you can add a PO, project or department to each order with po_number.
Sandbox Access
Even after you have API credentials for our production environment, you can continue placing sandbox mode orders. You may test with sandbox_mode=true at any time, even after starting to place real orders.