> This page is for version v1.2.
> 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.2/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.

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`
- `audio` (string, required) — Base64-encoded audio file.

## Response

### 200

Recording uploaded

- `recording_id` (string, optional) — The recording ID used for fetching analysis results.
- `account_id` (string, optional) — The ID of the account that submitted the recording.
- `recorded_at` (datetime, optional) — ISO 8601 timestamp of when the recording began.
- `uploaded_at` (datetime, optional) — ISO 8601 timestamp of when the recording was uploaded.
- `audio_file_format` (string, optional) — Detected audio file format.
- `audio_size_bytes` (integer, optional) — Audio file size in bytes.
- `audio_sample_rate_hz` (integer, optional) — Audio sample rate in Hz.
- `audio_bit_rate_bps` (integer, optional) — Audio bit rate in bits per second.
- `audio_duration_seconds` (double, optional) — Total audio duration in seconds.
- `speech_duration_seconds` (double, optional) — Detected speech duration in seconds.

## Errors

### 400 Bad Request Error

Bad request

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

### 401 Unauthorized Error

Unauthorized

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

### 403 Forbidden Error

Requested analysis is not enabled, or access is suspended

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

### 413 Content Too Large Error

File too large (max 50 MB)

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

### 500 Internal Server Error

Internal server error

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

## Types

### ErrorError

Error details.

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

## Examples

**Request**

```json
{
  "account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "recorded_at": "2024-01-15T09:30:00Z",
  "analysis": [
    "wellbeing"
  ],
  "audio": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YQAAAAA="
}
```

**Response**

```json
{
  "recording_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "recorded_at": "2024-01-15T09:30:00Z",
  "uploaded_at": "2024-01-15T09:35:00Z",
  "audio_file_format": "wav",
  "audio_size_bytes": 480000,
  "audio_sample_rate_hz": 8000,
  "audio_bit_rate_bps": 32000,
  "audio_duration_seconds": 30,
  "speech_duration_seconds": 30
}
```

**SDK Code**

```python
import requests

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

payload = {
    "account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "recorded_at": "2024-01-15T09:30:00Z",
    "analysis": ["wellbeing"],
    "audio": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YQAAAAA="
}
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.2/recordings';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"account_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","recorded_at":"2024-01-15T09:30:00Z","analysis":["wellbeing"],"audio":"UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YQAAAAA="}'
};

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.2/recordings"

	payload := strings.NewReader("{\n  \"account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"recorded_at\": \"2024-01-15T09:30:00Z\",\n  \"analysis\": [\n    \"wellbeing\"\n  ],\n  \"audio\": \"UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YQAAAAA=\"\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.2/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\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"recorded_at\": \"2024-01-15T09:30:00Z\",\n  \"analysis\": [\n    \"wellbeing\"\n  ],\n  \"audio\": \"UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YQAAAAA=\"\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.2/recordings")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"account_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"recorded_at\": \"2024-01-15T09:30:00Z\",\n  \"analysis\": [\n    \"wellbeing\"\n  ],\n  \"audio\": \"UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YQAAAAA=\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

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

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

```csharp
using RestSharp;

var client = new RestClient("https://api.virtuosis.ai/v1.2/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\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n  \"recorded_at\": \"2024-01-15T09:30:00Z\",\n  \"analysis\": [\n    \"wellbeing\"\n  ],\n  \"audio\": \"UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YQAAAAA=\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "recorded_at": "2024-01-15T09:30:00Z",
  "analysis": ["wellbeing"],
  "audio": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YQAAAAA="
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.virtuosis.ai/v1.2/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()
```