> For complete lifecycle-event payload schemas and examples, use the canonical overview: Session /api/sessions; Room lifecycle, members, and room playback /api/rooms; Session playback /api/playback; Recording /api/recording; DTMF /api/keypad-input; Messages /api/messages; WebSocket Session /api/web-socket. Use /api/event-delivery for transport behavior. Endpoint pages name relevant events, but these overviews are the canonical references.

# Upload a temporary PDF

POST https://api.vorbal.dev/v1/files
Content-Type: multipart/form-data

Upload one PDF in the `file` multipart field. The returned signed URL remains usable until `expires_at` and may be supplied when creating a Fax Message.

Reference: https://docs.vorbal.dev/api/files/upload-file

## Authentication

- `Authorization` header (bearer token, required) — Send `Authorization: Bearer <app_uuid>:<api_key>` using an active API key. See [Authentication](https://voice-platform.docs.buildwithfern.com/api/authentication) for details.

## Request

### Body (multipart/form-data)

This endpoint expects a multipart form containing a file.

- `file` (file, required)

## Response

### 201

The immutable temporary PDF was stored.

- `expires_at` (datetime, required)
- `url` (string, required)

## Errors

### 400 Bad Request Error

Missing `Authorization` or malformed Bearer credentials return `invalid_authorization_header`; invalid request parameters return `invalid_request`. A syntactically valid credential with an invalid API key returns `401 unauthorized` instead.

- `code` (enum, required) — Stable, machine-readable error class from a closed set. Branch on this for programmatic handling. New codes are only added with a documented API change. Maps to the HTTP status as follows: `invalid_request` (400/405/406/415/422), `invalid_authorization_header` (400), `payload_too_large` and `result_set_too_large` (413), `unauthorized` (401), `forbidden` (403), `not_found` (404), `recording_not_active` (400); `conflict` and `room_full` (409), `rate_limited` (429), and `unavailable` (503/529). Unexpected failures use the separate `InternalErrorResponse` schema. Note: `413` is the only status shared by two codes — `payload_too_large` means the request body exceeded its size cap, while `result_set_too_large` means a list response exceeded the system result ceiling (narrow the query with filters and retry). Note: `unavailable` maps to multiple HTTP statuses, which represent different retry conditions: `503` means a required store or service is temporarily unavailable, and `529` means the platform is overloaded. Use the HTTP status and operation description, not just `code`, to distinguish them.
  - Allowed values: `invalid_request`, `invalid_authorization_header`, `payload_too_large`, `result_set_too_large`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `recording_not_active`, `room_full`, `rate_limited`, `unavailable`
- `message` (string, required) — Human-readable, English-only error message. For display only — phrasing may change without notice, so branch on `code`, not on this string.

### 401 Unauthorized Error

The Bearer credential is syntactically valid but its API key is invalid. Missing `Authorization` or malformed Bearer credentials return `400 invalid_authorization_header`.

- `code` (enum, required) — Stable, machine-readable error class from a closed set. Branch on this for programmatic handling. New codes are only added with a documented API change. Maps to the HTTP status as follows: `invalid_request` (400/405/406/415/422), `invalid_authorization_header` (400), `payload_too_large` and `result_set_too_large` (413), `unauthorized` (401), `forbidden` (403), `not_found` (404), `recording_not_active` (400); `conflict` and `room_full` (409), `rate_limited` (429), and `unavailable` (503/529). Unexpected failures use the separate `InternalErrorResponse` schema. Note: `413` is the only status shared by two codes — `payload_too_large` means the request body exceeded its size cap, while `result_set_too_large` means a list response exceeded the system result ceiling (narrow the query with filters and retry). Note: `unavailable` maps to multiple HTTP statuses, which represent different retry conditions: `503` means a required store or service is temporarily unavailable, and `529` means the platform is overloaded. Use the HTTP status and operation description, not just `code`, to distinguish them.
  - Allowed values: `invalid_request`, `invalid_authorization_header`, `payload_too_large`, `result_set_too_large`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `recording_not_active`, `room_full`, `rate_limited`, `unavailable`
- `message` (string, required) — Human-readable, English-only error message. For display only — phrasing may change without notice, so branch on `code`, not on this string.

### 406 Not Acceptable Error

The public API returns JSON and does not expose a Server-Sent Events representation. Requests that explicitly negotiate `text/event-stream` without accepting JSON are rejected.

- `code` (enum, required) — Stable, machine-readable error class from a closed set. Branch on this for programmatic handling. New codes are only added with a documented API change. Maps to the HTTP status as follows: `invalid_request` (400/405/406/415/422), `invalid_authorization_header` (400), `payload_too_large` and `result_set_too_large` (413), `unauthorized` (401), `forbidden` (403), `not_found` (404), `recording_not_active` (400); `conflict` and `room_full` (409), `rate_limited` (429), and `unavailable` (503/529). Unexpected failures use the separate `InternalErrorResponse` schema. Note: `413` is the only status shared by two codes — `payload_too_large` means the request body exceeded its size cap, while `result_set_too_large` means a list response exceeded the system result ceiling (narrow the query with filters and retry). Note: `unavailable` maps to multiple HTTP statuses, which represent different retry conditions: `503` means a required store or service is temporarily unavailable, and `529` means the platform is overloaded. Use the HTTP status and operation description, not just `code`, to distinguish them.
  - Allowed values: `invalid_request`, `invalid_authorization_header`, `payload_too_large`, `result_set_too_large`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `recording_not_active`, `room_full`, `rate_limited`, `unavailable`
- `message` (string, required) — Human-readable, English-only error message. For display only — phrasing may change without notice, so branch on `code`, not on this string.

### 413 Content Too Large Error

Request body exceeds the endpoint's size limit.

- `code` (enum, required) — Stable, machine-readable error class from a closed set. Branch on this for programmatic handling. New codes are only added with a documented API change. Maps to the HTTP status as follows: `invalid_request` (400/405/406/415/422), `invalid_authorization_header` (400), `payload_too_large` and `result_set_too_large` (413), `unauthorized` (401), `forbidden` (403), `not_found` (404), `recording_not_active` (400); `conflict` and `room_full` (409), `rate_limited` (429), and `unavailable` (503/529). Unexpected failures use the separate `InternalErrorResponse` schema. Note: `413` is the only status shared by two codes — `payload_too_large` means the request body exceeded its size cap, while `result_set_too_large` means a list response exceeded the system result ceiling (narrow the query with filters and retry). Note: `unavailable` maps to multiple HTTP statuses, which represent different retry conditions: `503` means a required store or service is temporarily unavailable, and `529` means the platform is overloaded. Use the HTTP status and operation description, not just `code`, to distinguish them.
  - Allowed values: `invalid_request`, `invalid_authorization_header`, `payload_too_large`, `result_set_too_large`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `recording_not_active`, `room_full`, `rate_limited`, `unavailable`
- `message` (string, required) — Human-readable, English-only error message. For display only — phrasing may change without notice, so branch on `code`, not on this string.

### 415 Unsupported Media Type Error

The request must use `multipart/form-data` with one `file` field.

- `code` (enum, required) — Stable, machine-readable error class from a closed set. Branch on this for programmatic handling. New codes are only added with a documented API change. Maps to the HTTP status as follows: `invalid_request` (400/405/406/415/422), `invalid_authorization_header` (400), `payload_too_large` and `result_set_too_large` (413), `unauthorized` (401), `forbidden` (403), `not_found` (404), `recording_not_active` (400); `conflict` and `room_full` (409), `rate_limited` (429), and `unavailable` (503/529). Unexpected failures use the separate `InternalErrorResponse` schema. Note: `413` is the only status shared by two codes — `payload_too_large` means the request body exceeded its size cap, while `result_set_too_large` means a list response exceeded the system result ceiling (narrow the query with filters and retry). Note: `unavailable` maps to multiple HTTP statuses, which represent different retry conditions: `503` means a required store or service is temporarily unavailable, and `529` means the platform is overloaded. Use the HTTP status and operation description, not just `code`, to distinguish them.
  - Allowed values: `invalid_request`, `invalid_authorization_header`, `payload_too_large`, `result_set_too_large`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `recording_not_active`, `room_full`, `rate_limited`, `unavailable`
- `message` (string, required) — Human-readable, English-only error message. For display only — phrasing may change without notice, so branch on `code`, not on this string.

### 429 Too Many Requests Error

Rate limit exceeded for the applicable per-command, per-room, or global scope. The `Retry-After` response header gives the integer seconds to wait before retrying.

- `code` (enum, required) — Stable, machine-readable error class from a closed set. Branch on this for programmatic handling. New codes are only added with a documented API change. Maps to the HTTP status as follows: `invalid_request` (400/405/406/415/422), `invalid_authorization_header` (400), `payload_too_large` and `result_set_too_large` (413), `unauthorized` (401), `forbidden` (403), `not_found` (404), `recording_not_active` (400); `conflict` and `room_full` (409), `rate_limited` (429), and `unavailable` (503/529). Unexpected failures use the separate `InternalErrorResponse` schema. Note: `413` is the only status shared by two codes — `payload_too_large` means the request body exceeded its size cap, while `result_set_too_large` means a list response exceeded the system result ceiling (narrow the query with filters and retry). Note: `unavailable` maps to multiple HTTP statuses, which represent different retry conditions: `503` means a required store or service is temporarily unavailable, and `529` means the platform is overloaded. Use the HTTP status and operation description, not just `code`, to distinguish them.
  - Allowed values: `invalid_request`, `invalid_authorization_header`, `payload_too_large`, `result_set_too_large`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `recording_not_active`, `room_full`, `rate_limited`, `unavailable`
- `message` (string, required) — Human-readable, English-only error message. For display only — phrasing may change without notice, so branch on `code`, not on this string.

### 503 Service Unavailable Error

Temporary file storage is unavailable.

- `code` (enum, required) — Stable, machine-readable error class from a closed set. Branch on this for programmatic handling. New codes are only added with a documented API change. Maps to the HTTP status as follows: `invalid_request` (400/405/406/415/422), `invalid_authorization_header` (400), `payload_too_large` and `result_set_too_large` (413), `unauthorized` (401), `forbidden` (403), `not_found` (404), `recording_not_active` (400); `conflict` and `room_full` (409), `rate_limited` (429), and `unavailable` (503/529). Unexpected failures use the separate `InternalErrorResponse` schema. Note: `413` is the only status shared by two codes — `payload_too_large` means the request body exceeded its size cap, while `result_set_too_large` means a list response exceeded the system result ceiling (narrow the query with filters and retry). Note: `unavailable` maps to multiple HTTP statuses, which represent different retry conditions: `503` means a required store or service is temporarily unavailable, and `529` means the platform is overloaded. Use the HTTP status and operation description, not just `code`, to distinguish them.
  - Allowed values: `invalid_request`, `invalid_authorization_header`, `payload_too_large`, `result_set_too_large`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `recording_not_active`, `room_full`, `rate_limited`, `unavailable`
- `message` (string, required) — Human-readable, English-only error message. For display only — phrasing may change without notice, so branch on `code`, not on this string.

## Examples

**Request**

```json
{
  "file": "<file: string>"
}
```

**Response**

```json
{
  "expires_at": "2026-09-16T10:00:00.000Z",
  "url": "https://api.example.com/v1/files/content/opaque-token"
}
```

**SDK Code**

```python Files_uploadFile_example
import requests

url = "https://api.vorbal.dev/v1/files"

files = { "file": "open('string', 'rb')" }
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, files=files, headers=headers)

print(response.json())
```

```javascript Files_uploadFile_example
const url = 'https://api.vorbal.dev/v1/files';
const form = new FormData();
form.append('file', 'string');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

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

```go Files_uploadFile_example
package main

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

func main() {

	url := "https://api.vorbal.dev/v1/files"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

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

url = URI("https://api.vorbal.dev/v1/files")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n"

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

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

HttpResponse<String> response = Unirest.post("https://api.vorbal.dev/v1/files")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.vorbal.dev/v1/files', [
  'multipart' => [
    [
        'name' => 'file',
        'filename' => 'string',
        'contents' => null
    ]
  ]
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Files_uploadFile_example
using RestSharp;

var client = new RestClient("https://api.vorbal.dev/v1/files");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Files_uploadFile_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]
let parameters = [
  [
    "name": "file",
    "fileName": "string"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.vorbal.dev/v1/files")! 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()
```