> This page is for version v1.3 (default).
> For other versions, use one of these documentation indexes:
> - v1.3 (default): https://docs.virtuosis.ai/v-1-3/llms.txt
> - v1.2: https://docs.virtuosis.ai/v-1-2/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.virtuosis.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.virtuosis.ai/_mcp/server.

# Upload a recording for analysis

POST https://api.virtuosis.ai/v1.3/recordings
Content-Type: application/json

Uploads a Base64-encoded audio file. Analysis processing is triggered on a successful
upload and may take up to five minutes to complete. Requires an active
subscription with available credits; requests are rejected once the balance is
exhausted or the subscription is suspended.

Minimum audio requirements:
- Format: WAV, MP3, MP4, or OGG
- Sample rate: 8,000 Hz
- Bit rate: 32,000 bps
- Channels: 1 (mono)
- Duration: 30 seconds of speech
- Maximum file size: 50 MB


Reference: https://docs.virtuosis.ai/api-reference/recordings/upload-recording

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects an UploadRecordingRequest.

- `account_id` (string, required) — The ID of the account submitting the recording.
- `recorded_at` (datetime, required) — ISO 8601 timestamp of when the recording began.
- `analysis` (list of enum, required) — Analysis types to run. Must contain at least one type.
  - Allowed values: `wellbeing`, `parkinsons`, `alzheimers`, `communication_coach`
- `audio` (string, required) — Base64-encoded audio file.
- `isolate_oldest_speaker` (boolean, optional, default: false) — When true, the clip is diarised and only the audio of the speaker estimated to be oldest is kept and analysed. Speaker age is estimated from the audio and carries a multi-year error bar, so speakers close in age may not be separated reliably. The retained speaker's speech must clear the same 30-second minimum the whole clip does, or the upload is rejected with a SpeakerSpeechTooShort error. Recordings longer than 10 minutes are rejected with a RecordingTooLongForIsolation error.

## Response

### 200

Recording uploaded

- `recording_id` (string, required) — The recording ID used for fetching analysis results.
- `account_id` (string, required) — The ID of the account that submitted the recording.
- `recorded_at` (datetime, required) — ISO 8601 timestamp of when the recording began.
- `uploaded_at` (datetime, required) — ISO 8601 timestamp of when the recording was uploaded.
- `audio_file_format` (string, required) — Detected audio file format.
- `audio_size_bytes` (integer, required) — Audio file size in bytes. With isolate_oldest_speaker enabled, this describes the retained audio, not the submitted file.
- `audio_sample_rate_hz` (integer, required) — Audio sample rate in Hz.
- `audio_bit_rate_bps` (integer, required) — Audio bit rate in bits per second.
- `audio_duration_seconds` (double, required) — Total audio duration in seconds. With isolate_oldest_speaker enabled, this is the duration of the retained speaker's audio, not of the submitted clip.
- `speech_duration_seconds` (double, required) — Detected speech duration in seconds. With isolate_oldest_speaker enabled, this is the isolated speaker's speech time, not the whole clip's.

## Errors

### 400 Bad Request Error

Bad request

- `error` (ErrorError, required) — Error details.

### 401 Unauthorized Error

Unauthorized

- `error` (ErrorError, required) — Error details.

### 403 Forbidden Error

Requested analysis is not enabled, access is suspended, or API billing is not provisioned

- `error` (ErrorError, required) — Error details.

### 413 Content Too Large Error

File too large (max 50 MB)

- `error` (ErrorError, required) — Error details.

### 429 Too Many Requests Error

Rate limit exceeded

- `error` (ErrorError, required) — Error details.

### 500 Internal Server Error

Internal server error

- `error` (ErrorError, required) — Error details.

## Types

### ErrorError

Error details.

- `type` (string, required) — Machine-readable error type.
- `message` (string, required) — Human-readable description of the error.

## Examples

**Request**

```json
{
  "account_id": "string",
  "recorded_at": "2024-01-15T09:30:00Z",
  "analysis": [
    "wellbeing"
  ],
  "audio": "string"
}
```

**Response**

```json
{
  "recording_id": "string",
  "account_id": "string",
  "recorded_at": "2024-01-15T09:30:00Z",
  "uploaded_at": "2024-01-15T09:30:00Z",
  "audio_file_format": "string",
  "audio_size_bytes": 1,
  "audio_sample_rate_hz": 1,
  "audio_bit_rate_bps": 1,
  "audio_duration_seconds": 1.1,
  "speech_duration_seconds": 1.1
}
```

**SDK Code**

```python
import requests

url = "https://api.virtuosis.ai/v1.3/recordings"

payload = {
    "account_id": "string",
    "recorded_at": "2024-01-15T09:30:00Z",
    "analysis": ["wellbeing"],
    "audio": "string"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.virtuosis.ai/v1.3/recordings';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"account_id":"string","recorded_at":"2024-01-15T09:30:00Z","analysis":["wellbeing"],"audio":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.virtuosis.ai/v1.3/recordings"

	payload := strings.NewReader("{\n  \"account_id\": \"string\",\n  \"recorded_at\": \"2024-01-15T09:30:00Z\",\n  \"analysis\": [\n    \"wellbeing\"\n  ],\n  \"audio\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.virtuosis.ai/v1.3/recordings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"account_id\": \"string\",\n  \"recorded_at\": \"2024-01-15T09:30:00Z\",\n  \"analysis\": [\n    \"wellbeing\"\n  ],\n  \"audio\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.virtuosis.ai/v1.3/recordings")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"account_id\": \"string\",\n  \"recorded_at\": \"2024-01-15T09:30:00Z\",\n  \"analysis\": [\n    \"wellbeing\"\n  ],\n  \"audio\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.virtuosis.ai/v1.3/recordings', [
  'body' => '{
  "account_id": "string",
  "recorded_at": "2024-01-15T09:30:00Z",
  "analysis": [
    "wellbeing"
  ],
  "audio": "string"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.virtuosis.ai/v1.3/recordings");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"account_id\": \"string\",\n  \"recorded_at\": \"2024-01-15T09:30:00Z\",\n  \"analysis\": [\n    \"wellbeing\"\n  ],\n  \"audio\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "account_id": "string",
  "recorded_at": "2024-01-15T09:30:00Z",
  "analysis": ["wellbeing"],
  "audio": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.virtuosis.ai/v1.3/recordings")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```