# Fastwater API

Base URL: `https://fastwater.app`

## Introduction

Add torrents, follow transfers, and stream your files from your own code.

The Fastwater API is a REST API at `https://fastwater.app/v1`. Everything the
dashboard does goes through it: adding magnets and `.torrent` files, following
transfers, browsing and renaming files, playback URLs, watch progress, shares,
and RSS feeds.

- [Quick start](/docs/quickstart): Make a key, add a magnet, and play the file in six requests.
- [API reference](/docs/api/transfers/post-transfers): Every route with its parameters and responses, and a playground to try them.
- [AI assistants](/docs/mcp): Connect ChatGPT, Claude, or any MCP client.
- [Command line](/docs/cli): `npx @fastwaterapp/cli`, for scripts and agents with a shell.

### The basics

- **Base URL:** `https://fastwater.app/v1`. All routes are under `/v1`.
- **Auth:** a bearer token: an API key, an OAuth access token, or a dashboard
  session. See [Authentication](/docs/authentication).
- **Errors:** one shape, `{ "error": { "code", "message", "requestId" } }`. See
  [Errors](/docs/errors).
- **JSON** in and out. Times are ISO 8601, sizes are bytes.
- **CORS** is open to every origin, so browser apps call it directly. See
  [Browser apps](/docs/browser-apps).

Fastwater does not search for torrents: your app supplies the magnet or the
`.torrent` file.

## Quick start

From an API key to a playing video in six requests.

#### Create an API key

Open [Account, Developer](https://fastwater.app/account/developer) and press
**Create an API key**. Name it after your script, keep **Full access**, and
press **Create key**. Copy the key: it starts with `ak_`. See
[Authentication](/docs/authentication) for limited keys.

```sh
export FASTWATER_KEY=ak_...
export FASTWATER=https://fastwater.app
```

#### Check the cache

Torrents other members already added are cached and complete at once.

```sh
curl "$FASTWATER/v1/cache?hash=08ada5a7a6183aae1e09d831df6748d566095a10" \
  -H "Authorization: Bearer $FASTWATER_KEY"
```

#### Add a magnet

```sh
curl -X POST "$FASTWATER/v1/transfers" \
  -H "Authorization: Bearer $FASTWATER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"magnet":"magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel"}'
```

#### Poll the transfer

Every few seconds, until `status` is `completed`. The response lists the new
`fileIds`.

```sh
curl "$FASTWATER/v1/transfers/$TRANSFER_ID" -H "Authorization: Bearer $FASTWATER_KEY"
```

#### Get a playback URL

It supports HTTP Range and expires at `expiresAt`; when it returns `403`, ask
for a new one. The response also has signed WebVTT subtitle URLs and the saved
position.

```sh
curl -X POST "$FASTWATER/v1/files/$FILE_ID/playback" -H "Authorization: Bearer $FASTWATER_KEY"
```

#### Save progress

About every 10 seconds, and on pause. Progress syncs to the dashboard and the
TV apps.

```sh
curl -X PUT "$FASTWATER/v1/files/$FILE_ID/progress" \
  -H "Authorization: Bearer $FASTWATER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"positionSeconds":120,"durationSeconds":888}'
```

## Authentication

API keys, OAuth access tokens, and dashboard sessions.

Every `/v1` route that needs an account takes a bearer token:

```http
Authorization: Bearer ak_...
```

### API keys

#### Open the Developer page

Go to [Account, Developer](https://fastwater.app/account/developer).

#### Create the key

Press **Create an API key** and name it after the script or app that will use
it, such as `Sonarr script`. Choose its access:

- **Full access** can do anything you can, including managing other keys.
- **Limited** has only the [scopes](#scopes) you pick. A route outside them
  answers `403`.

Press **Create key**.

#### Copy it

The key starts with `ak_` and is shown once. Store it like a password.

To revoke a key, press **Revoke** beside it on the same page; it stops working
at once. Make one key per script or app, so you can revoke one alone.

### OAuth access tokens

Apps that act for other people use OAuth instead of asking for a key. See
[OAuth apps](/docs/oauth).

### Scopes

| Scope             | Allows                                          |
| ----------------- | ----------------------------------------------- |
| `files:read`      | List, search, and download files; playback URLs |
| `files:write`     | Rename, move, and delete files and folders      |
| `progress:write`  | Save watch progress                             |
| `transfers:read`  | List and follow transfers                       |
| `transfers:write` | Add, retry, and cancel transfers                |
| `feeds:read`      | List RSS feeds and their items                  |
| `feeds:write`     | Add, change, and remove RSS feeds               |

A key without scopes has full access, including account routes such as
managing keys.

Each route in the [API reference](/docs/api/transfers/post-transfers) says which scopes it needs.

## Errors

One error shape for every route.

Every error has the same body:

```json
{ "error": { "code": "not_found", "message": "Not found", "requestId": "req_..." } }
```

- `code` is stable: branch on it.
- `message` is for people and may change.
- `requestId` identifies the request; include it when you contact support.

| Status | Means                                                      |
| ------ | ---------------------------------------------------------- |
| `400`  | The request is malformed or a field is invalid             |
| `401`  | No token, or the token is invalid or revoked               |
| `402`  | No active subscription                                     |
| `403`  | The token lacks a scope the route needs                    |
| `404`  | The resource doesn't exist or isn't yours                  |
| `409`  | The request conflicts with the current state               |
| `429`  | Too many requests: wait the `Retry-After` header's seconds |
| `5xx`  | Fastwater's fault: retry with backoff                      |

A signed media URL (`playback.url`, downloads) answers `403` once it expires:
ask the API for a new one.

## TypeScript

A typed client for every route.

`@putflix/fastwater-sdk` wraps every route:

```ts
const cloud = createCloudClient({ baseUrl: FASTWATER, getToken: () => FASTWATER_KEY });
const transfer = await cloud.addMagnet(magnet);
const playback = await cloud.getPlayback(transfer.fileIds[0]);
```

The [OpenAPI document](https://fastwater.app/openapi.json) (3.1) generates
clients for other languages.

## Browser apps

Call the API and play media from a web page.

`/v1` answers CORS from any origin, so a web app on `localhost` or its own site
can call it with `fetch` and a bearer token (no cookies).

Media URLs (`playback.url`, downloads) allow any origin too, so `<video>`,
hls.js, and `crossorigin` players work. Load subtitle tracks from
`/v1/files/{id}/subtitles/{trackId}` with the same token.

**Building a TV app?**

[Build your own TV app](/build) walks a coding agent through one on this API.

## OAuth apps

Let other people connect their Fastwater account to your app.

Third-party apps use Clerk's OAuth endpoints (authorization code with PKCE)
and these scopes: `files:read`, `files:write`, `progress:write`,
`transfers:read`, and `transfers:write` (see [Scopes](/docs/authentication#scopes)).

The access token goes in `Authorization: Bearer`, like an API key. People see
and revoke connected apps in **Account**, **Devices**.

## AI assistants (MCP)

Ask Claude, ChatGPT, or another AI app to add magnets, check downloads, and find your files.

Fastwater is an MCP server, so AI apps can use your account: add a magnet,
check a download, find an episode, or get a link to play or download it. It works on
every plan, on the web and in the assistants' phone apps.

#### Copy the server URL

```text
https://fastwater.app/mcp
```

#### Add it to your AI app

**Claude**

1. On [claude.ai](https://claude.ai), open **Settings**, then **Connectors**.
2. Choose **Add custom connector**.
3. Name it `Fastwater`, paste the URL, and add it.

Once added, it works in the Claude apps on your phone too.

**ChatGPT**

1. On [chatgpt.com](https://chatgpt.com), open **Settings**, then **Apps**.
2. Open **Advanced settings** and turn on **Developer mode**.
3. Choose **Create app**. Name it `Fastwater`, paste the URL, and choose
   **OAuth** for authentication.

**Claude Code**

Run:

```sh
claude mcp add --transport http fastwater https://fastwater.app/mcp
```

Then run `/mcp` in Claude Code and choose **fastwater** to sign in.

**Codex**

Run:

```sh
codex mcp add fastwater --url https://fastwater.app/mcp
codex mcp login fastwater
```

The second command opens Fastwater's sign-in.

**Other apps**

Cursor and other MCP clients: add `https://fastwater.app/mcp` as a
remote MCP server (Streamable HTTP). It signs in with OAuth.

A client without OAuth can send an [API key](/docs/authentication) instead, as
`Authorization: Bearer <key>`.

### What it can do

The tools wrap the [API](/docs/api/transfers/post-transfers) and return the same JSON:

- **Transfers**: add a magnet link, check the cache, list, follow, retry, and
  cancel transfers.
- **Library**: search your movies and shows, continue watching, list and get
  files.
- **Files**: links to play and download; rename, move, and delete files and
  folders; bring back a watched video that was cleared from storage.
- **Account**: your plan and storage, and your invite link.

Fastwater doesn't search for torrents: the assistant uses the magnets you give
it.

### Disconnect an app

Open [Account, Devices](https://fastwater.app/account/devices). Connected AI
apps are under **Connected apps**; sign one out and it loses access at once.

## Command line

The fastwater CLI, for scripts and agents with a shell.

`fastwater` (npm package [`@fastwaterapp/cli`](https://www.npmjs.com/package/@fastwaterapp/cli))
adds magnets, waits for transfers, lists and downloads files, and prints
links. Every command takes `--json`, so agents with a shell use it too.

#### Install Node.js

The CLI needs Node.js 20 or later, from [nodejs.org](https://nodejs.org). Then
run it with `npx`, no install needed:

```sh
npx @fastwaterapp/cli --help
```

Or install it, to type `fastwater` instead:

```sh
npm install -g @fastwaterapp/cli
```

#### Sign in

```sh
npx @fastwaterapp/cli login
```

It shows a code and opens your browser. Check the code matches and approve
it. The computer then shows under
[Account, Devices](https://fastwater.app/account/devices), where you can sign
it out.

#### Use it

```sh
npx @fastwaterapp/cli add "$MAGNET" --wait       # add a magnet and wait for it
npx @fastwaterapp/cli files sintel               # search your files
npx @fastwaterapp/cli link $FILE_ID              # links to watch and download
npx @fastwaterapp/cli download $FILE_ID -o ~/Downloads
```

`npx @fastwaterapp/cli --help` lists every command.

### For coding agents

Install the agent skill, so Claude Code knows the commands:

```sh
npx @fastwaterapp/cli skill install
```

`npx @fastwaterapp/cli skill` prints it for other agents.

### On a server or in CI

There's no browser to approve a code, so sign in with an
[API key](/docs/authentication) instead:

```sh
echo "$FASTWATER_KEY" | npx @fastwaterapp/cli login --with-token
```

Or set `FASTWATER_TOKEN` to the key.

### Exit codes

| Code | Means         |
| ---- | ------------- |
| `0`  | Success       |
| `1`  | API error     |
| `2`  | Usage error   |
| `3`  | Not signed in |

## WebDAV

Watch your files in Infuse, Kodi, VLC, Plex, and Jellyfin, or open them in Finder, File Explorer, and rclone.

Fastwater serves your files over WebDAV at `https://fastwater.app/dav/` on
every plan. Each transfer is a folder with its files inside. Files are
read-only: add and delete them in Fastwater.

### 1. Make a key for the app

Each app gets its own key, so you can sign one out without touching the
others.

#### Open the Apps page

Go to [fastwater.app/apps](https://fastwater.app/apps) and sign in.

#### Press Set up on the app's card

For example **Infuse**, **Kodi**, or **Finder and File Explorer**. Give the
key a name you'll recognize, such as `Infuse on Apple TV`, then press
**Create key**. Copy the details it shows: the key is shown only once.

### 2. Your connection details

Every app asks for the same things. The Set up dialog shows them with your key
filled in.

| Field         | What to enter                                                        |
| ------------- | -------------------------------------------------------------------- |
| Server        | `https://fastwater.app/dav/` (address `fastwater.app`, path `/dav/`) |
| Port          | `443` (HTTPS)                                                        |
| Username      | `fastwater`. Any name works; only the key is checked.                |
| Password      | Your WebDAV key, from step 1                                         |
| Link with key | `https://fastwater.app/dav/<key>/`, for apps with no password field  |

**Keep the key secret**

Anyone with the key or the link with key can open your files. Sign a key out under [Account,
Devices](https://fastwater.app/account/devices) if it leaks.

### 3. Add Fastwater to your app

**Infuse**

On Apple TV, iPhone, iPad, or Mac ([get Infuse](https://firecore.com/infuse)):

1. Open **Settings**, then **Shares**, then **Add Share**, and choose **WebDAV**.
2. Fill in the share:
   - **Address**: `fastwater.app`
   - **Path**: `/dav/`
   - **HTTPS**: on
   - **Port**: `443`
   - **Username**: `fastwater`
   - **Password**: your WebDAV key
3. Save. Infuse lists your whole library with artwork and picks up new
   transfers on its own.

Full guide: [Watch Fastwater in Infuse](/guides/infuse).

**Kodi**

On Android TV, Fire TV, Windows, macOS, or Linux ([get Kodi](https://kodi.tv/download)):

1. Open **Videos**, then **Files**, then **Add videos…**, and choose **Browse**.
2. Scroll to the bottom and choose **Add network location…**
3. Fill in the location:
   - **Protocol**: `WebDAV server (HTTPS)`
   - **Server address**: `fastwater.app`
   - **Remote path**: `dav/`
   - **Port**: `443`
   - **Username**: `fastwater`
   - **Password**: your WebDAV key
4. Press **OK**, pick the new location, press **OK**, and name the source
   `Fastwater`.
5. To get artwork, open the source's context menu in **Videos**, **Files**,
   choose **Set content**, and pick **Movies** or **TV shows**.

Full guide: [Watch Fastwater in Kodi](/guides/kodi).

**VLC**

VLC can't browse a WebDAV server, but it plays any file from its link
([get VLC](https://www.videolan.org/vlc/)):

1. Open your **link with key**, `https://fastwater.app/dav/<key>/`, in a
   browser. It lists your folders.
2. Open a folder and copy the link of the file you want to play.
3. In VLC on a computer, choose **Media**, **Open Network Stream…** (Ctrl+N,
   or ⌘N on a Mac) and paste the link. On a phone, use **Stream**.

Full guide: [Play Fastwater files in VLC](/guides/vlc).

**Finder**

On a Mac:

1. In Finder, choose **Go**, **Connect to Server…** (⌘K).
2. Enter `https://fastwater.app/dav/` and press **Connect**.
3. Choose **Registered User**. Name: `fastwater`. Password: your WebDAV key.
4. Press **Connect**. Fastwater opens as a read-only folder.

Full guide: [Open Fastwater in Finder](/guides/finder).

**Windows**

On Windows 10 or 11:

1. Open **Terminal** (or Command Prompt).
2. Run this, with your key in place of `YOUR_KEY`:

   ```bat
   net use F: https://fastwater.app/dav/ /user:fastwater YOUR_KEY
   ```

3. Open **File Explorer**. Fastwater is drive **F:**.

Windows copies files up to 50 MB over WebDAV by default. To raise the limit to
4 GB, run these in a terminal as an administrator:

```bat
reg add HKLM\SYSTEM\CurrentControlSet\Services\WebClient\Parameters /v FileSizeLimitInBytes /t REG_DWORD /d 0xFFFFFFFF /f
net stop webclient && net start webclient
```

For larger files, use rclone. Full guide: [Open Fastwater in File Explorer](/guides/windows).

**rclone**

On Windows, macOS, or Linux ([install rclone](https://rclone.org/install/)):

1. Add Fastwater as a remote, with your key in place of `YOUR_KEY`:

   ```sh
   rclone config create fastwater webdav url=https://fastwater.app/dav/ \
     vendor=other user=fastwater pass=YOUR_KEY --obscure
   ```

2. Mount it as a read-only folder:

   ```sh
   rclone mount fastwater: ~/Fastwater --read-only --vfs-cache-mode minimal
   ```

   On Windows, mounting needs [WinFsp](https://winfsp.dev): mount to a drive
   letter such as `F:` instead of a folder. On macOS it needs
   [macFUSE](https://macfuse.github.io), or use `rclone nfsmount`.

3. Or copy a folder to a disk without mounting:

   ```sh
   rclone copy "fastwater:Folder name" ~/Movies --progress
   ```

Full guide: [Mount Fastwater with rclone](/guides/rclone).

**Plex and Jellyfin**

Plex and Jellyfin read your files from an rclone mount on the computer that
runs the server. Nothing is copied to your disks.

1. On the server's computer, follow the **rclone** steps to mount Fastwater at
   `~/Fastwater`, as the same user the server runs as.
2. In Plex or Jellyfin, add a library and choose the `~/Fastwater` folder.
3. Turn off thumbnail and preview generation for the library. The first scan
   reads the start of every file, so a large library takes a while.

Full guides: [Plex](/guides/plex), [Jellyfin](/guides/jellyfin).

### Good to know

- Files open through a redirect to a signed storage link, so the app must
  follow redirects. Every app above does.
- WebDAV doesn't save watch progress to Fastwater. Each app keeps its own.
- To sign an app out, open [Account, Devices](https://fastwater.app/account/devices)
  and sign out its key.

## Stremio

Your movies and shows in Stremio, through the Fastwater add-on.

The Fastwater add-on puts your movies and shows in Stremio's **Discover** and
**Board**, with posters and every episode. Every video plays from your own
Fastwater storage. It's on every plan.

#### Get Stremio

Install it on a TV, phone, or computer from
[stremio.com/downloads](https://www.stremio.com/downloads), or use
[Stremio Web](https://web.stremio.com).

#### Create your add-on

Go to [fastwater.app/apps](https://fastwater.app/apps) and press **Set up** on
**Stremio**. It creates your add-on and shows its install buttons.

#### Install it

Press **Install in Stremio** to open the Stremio app, or **Install in Stremio
Web** for the browser. Stremio shows the Fastwater add-on: press **Install**, and your library
appears in **Discover** and **Board**.

You can also copy the add-on link and paste it into the search box on
Stremio's **Add-ons** page.

**On a TV**

Install the add-on on your phone or computer, signed in to the same Stremio account as the TV.
Stremio syncs add-ons to every device, so you don't have to type the link with a remote.

### Good to know

- The add-on link, `https://fastwater.app/stremio/<key>/manifest.json`, holds a
  key: anyone with it can play your files. Keep it private, and sign it out
  under [Account, Devices](https://fastwater.app/account/devices) if it leaks.
- Stremio keeps its own watch progress, so resume points don't carry over from
  Fastwater's player.
- `https://fastwater.app/stremio/public/manifest.json` has no key: it's the
  listing in Stremio's add-on catalog. Its **Configure** button opens the setup
  on the Apps page.

Full guide: [Watch Fastwater in Stremio](/guides/stremio).

## Docs for agents

These docs as Markdown, for coding agents and AI tools.

- [`/llms.txt`](/llms.txt) lists these docs and the site's pages.
- [`/docs.md`](/docs.md) (also [`/llms-full.txt`](/llms-full.txt)) is every
  page and every route as one Markdown file.
- Each page is Markdown at its address plus `.md`, such as
  [`/docs/quickstart.md`](/docs/quickstart.md), and its **Copy Markdown**
  button copies it.
- `/docs` returns the Markdown for `Accept: text/markdown`.
- [`/openapi.json`](/openapi.json) is the OpenAPI 3.1 document.


## Reference

### GET /v1/me

The signed-in user, plan, and storage usage.

Bearer token.

`200` Account

```ts
{
  user: {
    id: string;
    email: string | null;
    status: "active" | "disabled";
    createdAt: string; // date-time
  };
  subscription: {
    status: string;
    periodEnd: string; // date-time
    cancelAtPeriodEnd: boolean;
    active: boolean;
    trialEnd: string | null; // date-time
    needsPaymentMethod: boolean;
    gift?: boolean;
    prepaid?: boolean;
  } | null;
  plan: {
    id: string;
    name: string;
    storageQuotaBytes: number;
    maxActiveTransfers: number;
    maxScreens: number;
    fileRetentionDays: number | null;
    webdav: boolean;
    priorityDownloads: boolean;
    maxPeople: number;
  } | null;
  storage: {
    usedBytes: number;
    reservedBytes: number;
    quotaBytes: number;
    clearedBytes?: number;
    clearableBytes?: number;
  };
  settings: {
    fileRetentionDays: number | null;
    clearWatchedDays?: number | null;
    audioLanguage: "en" | "es" | "fr" | "de" | "it" | "pt" | "nl" | "sv" | "no" | "da" | "fi" | "is" | "pl" | "cs" | "sk" | "hu" | "ro" | "bg" | "hr" | "sr" | "sl" | "et" | "lv" | "lt" | "el" | "tr" | "ru" | "uk" | "ca" | "eu" | "gl" | "he" | "ar" | "fa" | "hi" | "bn" | "ta" | "te" | "th" | "vi" | "id" | "ms" | "tl" | "zh" | "ja" | "ko" | null;
    subtitleLanguage: "en" | "es" | "fr" | "de" | "it" | "pt" | "nl" | "sv" | "no" | "da" | "fi" | "is" | "pl" | "cs" | "sk" | "hu" | "ro" | "bg" | "hr" | "sr" | "sl" | "et" | "lv" | "lt" | "el" | "tr" | "ru" | "uk" | "ca" | "eu" | "gl" | "he" | "ar" | "fa" | "hi" | "bn" | "ta" | "te" | "th" | "vi" | "id" | "ms" | "tl" | "zh" | "ja" | "ko" | null;
    autoplayNext: boolean;
    locale?: "en" | "pt" | "es" | "ar" | "fr" | null;
  };
  tvPaired: boolean;
  household: {
    role: "owner" | "member";
    owner: {
      email: string | null;
    };
    people: number;
    own: {
      usedBytes: number;
      limitBytes: number | null;
    };
  } | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `429` Rate limited.

### PATCH /v1/me/settings

Change account settings.

`fileRetentionDays` deletes each file that many days after it was added; `null` keeps files until you delete them. Files you already have count from the day of the change. A plan's own retention, if it has one, still applies; the earlier date wins. `audioLanguage` and `subtitleLanguage` are ISO 639-1 codes every app starts playback with: the audio track in that language when a file has one (`null` plays the title's original language when the file has it, else the file's default track), and subtitles in that language when a file has them (`null` keeps subtitles off). `autoplayNext` plays the next episode after a countdown at the credits (or the end); `false` offers it without playing it. `locale` is the language of the website, the emails, and Help (`en`, `pt`, `es`, `ar`, or `fr`); `null` follows the browser. Leave a field out to keep its value. Changing `fileRetentionDays` needs the `files:write` scope; the languages need only `progress:write`, which TV keys have.

Bearer token with `progress:write`.

Body (`application/json`):

```ts
{
  fileRetentionDays?: number | null;
  clearWatchedDays?: number | null;
  audioLanguage?: "en" | "es" | "fr" | "de" | "it" | "pt" | "nl" | "sv" | "no" | "da" | "fi" | "is" | "pl" | "cs" | "sk" | "hu" | "ro" | "bg" | "hr" | "sr" | "sl" | "et" | "lv" | "lt" | "el" | "tr" | "ru" | "uk" | "ca" | "eu" | "gl" | "he" | "ar" | "fa" | "hi" | "bn" | "ta" | "te" | "th" | "vi" | "id" | "ms" | "tl" | "zh" | "ja" | "ko" | null;
  subtitleLanguage?: "en" | "es" | "fr" | "de" | "it" | "pt" | "nl" | "sv" | "no" | "da" | "fi" | "is" | "pl" | "cs" | "sk" | "hu" | "ro" | "bg" | "hr" | "sr" | "sl" | "et" | "lv" | "lt" | "el" | "tr" | "ru" | "uk" | "ca" | "eu" | "gl" | "he" | "ar" | "fa" | "hi" | "bn" | "ta" | "te" | "th" | "vi" | "id" | "ms" | "tl" | "zh" | "ja" | "ko" | null;
  autoplayNext?: boolean;
  locale?: "en" | "pt" | "es" | "ar" | "fr" | null;
}
```

`200` Settings

```ts
{
  fileRetentionDays: number | null;
  clearWatchedDays?: number | null;
  audioLanguage: "en" | "es" | "fr" | "de" | "it" | "pt" | "nl" | "sv" | "no" | "da" | "fi" | "is" | "pl" | "cs" | "sk" | "hu" | "ro" | "bg" | "hr" | "sr" | "sl" | "et" | "lv" | "lt" | "el" | "tr" | "ru" | "uk" | "ca" | "eu" | "gl" | "he" | "ar" | "fa" | "hi" | "bn" | "ta" | "te" | "th" | "vi" | "id" | "ms" | "tl" | "zh" | "ja" | "ko" | null;
  subtitleLanguage: "en" | "es" | "fr" | "de" | "it" | "pt" | "nl" | "sv" | "no" | "da" | "fi" | "is" | "pl" | "cs" | "sk" | "hu" | "ro" | "bg" | "hr" | "sr" | "sl" | "et" | "lv" | "lt" | "el" | "tr" | "ru" | "uk" | "ca" | "eu" | "gl" | "he" | "ar" | "fa" | "hi" | "bn" | "ta" | "te" | "th" | "vi" | "id" | "ms" | "tl" | "zh" | "ja" | "ko" | null;
  autoplayNext: boolean;
  locale?: "en" | "pt" | "es" | "ar" | "fr" | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `429` Rate limited.

### GET /v1/transfers

List transfers, newest first.

Bearer token with `transfers:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `cursor` | query | `string` |  |
| `limit` | query | `number` | Default `50`. |
| `tmdbId` | query | `number` |  |
| `kind` | query | `"movie" \| "show"` |  |
| `season` | query | `number \| null` |  |
| `episode` | query | `number \| null` |  |
| `resumable` | query | `"true" \| "false"` |  |

`200` Transfers

```ts
{
  data: {
    id: string;
    status: "queued" | "downloading" | "ingesting" | "completed" | "failed" | "cancelled";
    waitingForSlot?: boolean;
    outcome: "hit" | "attached" | "miss";
    sourceType: "magnet" | "torrent" | "upload" | "putio";
    infoHash: string;
    name: string | null;
    totalBytes: number | null;
    progress: number;
    speedBps: number;
    etaSeconds: number | null;
    processingProgress: number | null;
    fileCount: number | null;
    error: string | null;
    folder: string | null;
    fileIds: string[];
    rssFeed: {
      id: string;
      title: string;
    } | null;
    restore?: boolean;
    title?: {
      tmdbId: number;
      kind: "movie" | "show";
      season: number | null;
      episode: number | null;
    } | null;
    resume?: {
      positionSeconds: number;
      durationSeconds: number;
      updatedAt: string; // date-time
    } | null;
    createdAt: string; // date-time
    updatedAt: string; // date-time
  }[];
  nextCursor: string | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `429` Rate limited.

### POST /v1/transfers

Add a magnet link or a .torrent file.

Send JSON `{ magnet }`, or multipart form data with a `torrent` file (and an optional `folder`). A torrent already in the cache completes at once.

Optional: `folder` files it under a folder, such as a show's `Name (Year)`. `fallbacks` lists other magnets for the same video, best first, tried in turn when one has no peers or stalls. `title` (a TMDB movie or episode) links it to the library; with `reuse`, an active transfer you already have for that title is returned instead of a new one. `episode` takes just that episode's files from a season pack.

Bearer token with `transfers:write`.

Body (`application/json`, optional):

```ts
{
  magnet: string;
  fallbacks?: string[];
  folder?: string;
  episode?: {
    season: number;
    episode: number;
  };
  title?: {
    tmdbId: number;
    kind: "movie" | "show";
    season?: number | null;
    episode?: number | null;
  };
  reuse?: boolean;
}
```

Body (`multipart/form-data`, optional):

```ts
{
  torrent: File;
  folder?: string;
}
```

`201` Created

```ts
{
  id: string;
  status: "queued" | "downloading" | "ingesting" | "completed" | "failed" | "cancelled";
  waitingForSlot?: boolean;
  outcome: "hit" | "attached" | "miss";
  sourceType: "magnet" | "torrent" | "upload" | "putio";
  infoHash: string;
  name: string | null;
  totalBytes: number | null;
  progress: number;
  speedBps: number;
  etaSeconds: number | null;
  processingProgress: number | null;
  fileCount: number | null;
  error: string | null;
  folder: string | null;
  fileIds: string[];
  rssFeed: {
    id: string;
    title: string;
  } | null;
  restore?: boolean;
  title?: {
    tmdbId: number;
    kind: "movie" | "show";
    season: number | null;
    episode: number | null;
  } | null;
  resume?: {
    positionSeconds: number;
    durationSeconds: number;
    updatedAt: string; // date-time
  } | null;
  createdAt: string; // date-time
  updatedAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `429` Rate limited.

### GET /v1/transfers/:id

Get a transfer.

Bearer token with `transfers:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` Transfer

```ts
{
  id: string;
  status: "queued" | "downloading" | "ingesting" | "completed" | "failed" | "cancelled";
  waitingForSlot?: boolean;
  outcome: "hit" | "attached" | "miss";
  sourceType: "magnet" | "torrent" | "upload" | "putio";
  infoHash: string;
  name: string | null;
  totalBytes: number | null;
  progress: number;
  speedBps: number;
  etaSeconds: number | null;
  processingProgress: number | null;
  fileCount: number | null;
  error: string | null;
  folder: string | null;
  fileIds: string[];
  rssFeed: {
    id: string;
    title: string;
  } | null;
  restore?: boolean;
  title?: {
    tmdbId: number;
    kind: "movie" | "show";
    season: number | null;
    episode: number | null;
  } | null;
  resume?: {
    positionSeconds: number;
    durationSeconds: number;
    updatedAt: string; // date-time
  } | null;
  createdAt: string; // date-time
  updatedAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `429` Rate limited.

### DELETE /v1/transfers/:id

Cancel an active transfer.

Bearer token with `transfers:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` Cancelled

```ts
{
  id: string;
  status: "queued" | "downloading" | "ingesting" | "completed" | "failed" | "cancelled";
  waitingForSlot?: boolean;
  outcome: "hit" | "attached" | "miss";
  sourceType: "magnet" | "torrent" | "upload" | "putio";
  infoHash: string;
  name: string | null;
  totalBytes: number | null;
  progress: number;
  speedBps: number;
  etaSeconds: number | null;
  processingProgress: number | null;
  fileCount: number | null;
  error: string | null;
  folder: string | null;
  fileIds: string[];
  rssFeed: {
    id: string;
    title: string;
  } | null;
  restore?: boolean;
  title?: {
    tmdbId: number;
    kind: "movie" | "show";
    season: number | null;
    episode: number | null;
  } | null;
  resume?: {
    positionSeconds: number;
    durationSeconds: number;
    updatedAt: string; // date-time
  } | null;
  createdAt: string; // date-time
  updatedAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `429` Rate limited.

### POST /v1/transfers/:id/retry

Retry a failed or cancelled transfer.

Creates a new transfer from the same magnet or .torrent file.

Bearer token with `transfers:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`201` Created

```ts
{
  id: string;
  status: "queued" | "downloading" | "ingesting" | "completed" | "failed" | "cancelled";
  waitingForSlot?: boolean;
  outcome: "hit" | "attached" | "miss";
  sourceType: "magnet" | "torrent" | "upload" | "putio";
  infoHash: string;
  name: string | null;
  totalBytes: number | null;
  progress: number;
  speedBps: number;
  etaSeconds: number | null;
  processingProgress: number | null;
  fileCount: number | null;
  error: string | null;
  folder: string | null;
  fileIds: string[];
  rssFeed: {
    id: string;
    title: string;
  } | null;
  restore?: boolean;
  title?: {
    tmdbId: number;
    kind: "movie" | "show";
    season: number | null;
    episode: number | null;
  } | null;
  resume?: {
    positionSeconds: number;
    durationSeconds: number;
    updatedAt: string; // date-time
  } | null;
  createdAt: string; // date-time
  updatedAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `429` Rate limited.

### PUT /v1/transfers/:id/progress

Save where the user is in a transfer they watch while it downloads.

Play while downloading: the file has no watch progress until it is stored, so the position waits on the transfer (`resume`, and `GET /v1/transfers?resumable=true`) and moves to the file's progress once it is stored. Send it every few seconds while playing, as `PUT /v1/files/{id}/progress`. A finished video keeps none.

Bearer token with `progress:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

Body (`application/json`):

```ts
{
  positionSeconds: number;
  durationSeconds: number;
  clientId?: string;
  updatedAt?: string; // date-time
}
```

`200` The transfer

```ts
{
  id: string;
  status: "queued" | "downloading" | "ingesting" | "completed" | "failed" | "cancelled";
  waitingForSlot?: boolean;
  outcome: "hit" | "attached" | "miss";
  sourceType: "magnet" | "torrent" | "upload" | "putio";
  infoHash: string;
  name: string | null;
  totalBytes: number | null;
  progress: number;
  speedBps: number;
  etaSeconds: number | null;
  processingProgress: number | null;
  fileCount: number | null;
  error: string | null;
  folder: string | null;
  fileIds: string[];
  rssFeed: {
    id: string;
    title: string;
  } | null;
  restore?: boolean;
  title?: {
    tmdbId: number;
    kind: "movie" | "show";
    season: number | null;
    episode: number | null;
  } | null;
  resume?: {
    positionSeconds: number;
    durationSeconds: number;
    updatedAt: string; // date-time
  } | null;
  createdAt: string; // date-time
  updatedAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/transfers/:id/watch

Wait on a downloading transfer to play it.

Play while downloading. Call it when the user presses Play or opens a transfer that is not ready, then every few seconds while the answer is `ready_in` or `starting_in`: each call keeps the download in order for the stream. `streaming` gives an HLS URL to play from the start; `ready` means the files are stored.

Bearer token with `transfers:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

Body (`application/json`, optional):

```ts
{
  clientId?: string;
  hevc?: "none" | "main" | "main10";
}
```

`200` When it plays

```ts
{
  state: "ready" | "ready_in" | "starting_in" | "streaming" | "unavailable";
  seconds: number | null;
  reason: "queued" | "measuring" | "finishing_soon" | "too_slow" | "not_streamable" | "needs_h264" | "processing" | "failed" | "cancelled" | null;
  hls: {
    url: string; // uri
    expiresAt: string; // date-time
  } | null;
  fileIds: string[];
  availableSeconds: number | null;
  durationSeconds: number | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `409` Every screen is taken (`screen_limit`); `429` Rate limited.

### GET /v1/archives/:token

A zip from POST /v1/files/archive.

The link `POST /v1/files/archive` returns. It needs no token.

No auth.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `token` | path | `string` | Required. |

`200` The zip

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/files

List files, newest first or by `sort`.

Filter by name (`q`), `type`, `transferId`, or `folder` (`subfolders=true` adds the folders inside it); `filed=false` leaves out files filed under a folder, and `clutter=false` leaves out release leftovers (`.nfo`, checksums, tracker `.txt` ads, `Thumbs.db`). `sort` is `newest` (default), `oldest`, `name` (A to Z), `name_desc`, `size` (largest first), or `smallest`. `total` counts every matching file; `clutterCount` counts the clutter among them, even when it is left out. Each file includes its watch progress.

Bearer token with `files:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `cursor` | query | `string` |  |
| `limit` | query | `number` | Default `50`. |
| `q` | query | `string` |  |
| `type` | query | `"video" \| "audio" \| "image" \| "subtitle" \| "other"` |  |
| `transferId` | query | `string` |  |
| `folder` | query | `string` |  |
| `subfolders` | query | `"true" \| "false"` |  |
| `filed` | query | `"true" \| "false"` |  |
| `clutter` | query | `"true" \| "false"` |  |
| `sort` | query | `"newest" \| "oldest" \| "name" \| "name_desc" \| "size" \| "smallest"` | Default `"newest"`. |
| `cleared` | query | `"true" \| "false"` |  |

`200` Files

```ts
{
  data: {
    id: string;
    name: string;
    sizeBytes: number;
    mimeType: string;
    type: "video" | "audio" | "image" | "subtitle" | "other";
    playable: boolean;
    mediaInfo: {
      container: string;
      durationSeconds: number | null;
      bitRate: number | null;
      video: {
        codec: string;
        profile: string | null;
        width: number;
        height: number;
        pixFmt: string | null;
      } | null;
      audio: {
        codec: string;
        channels: number | null;
        language: string | null;
        title: string | null;
        default: boolean;
      }[];
      subtitles: {
        codec: string;
        language: string | null;
        title: string | null;
        forced: boolean;
        default: boolean;
      }[];
      playable: boolean;
    } | null;
    original?: {
      name: string;
      sizeBytes: number;
      mimeType: string;
      mediaInfo: {
        container: string;
        durationSeconds: number | null;
        bitRate: number | null;
        video: {
          codec: string;
          profile: string | null;
          width: number;
          height: number;
          pixFmt: string | null;
        } | null;
        audio: {
          codec: string;
          channels: number | null;
          language: string | null;
          title: string | null;
          default: boolean;
        }[];
        subtitles: {
          codec: string;
          language: string | null;
          title: string | null;
          forced: boolean;
          default: boolean;
        }[];
        playable: boolean;
      } | null;
    } | null;
    subtitleCount: number;
    transferId: string;
    folder?: string | null;
    progress: {
      fileId: string;
      positionSeconds: number;
      durationSeconds: number;
      completed: boolean;
      clientId: string | null;
      updatedAt: string; // date-time
    } | null;
    expiresAt: string | null; // date-time
    kept?: "self" | "folder" | null;
    clearedAt?: string | null; // date-time
    media?: {
      titleId: string;
      kind: "movie" | "show";
      title: string;
      year: number | null;
      season: number | null;
      episode: number | null;
      episodeName: string | null;
      stillPath: string | null;
      posterPath: string | null;
      backdropPath: string | null;
      logoPath: string | null;
    } | null;
    clutter?: boolean;
    thumbnailUrl?: string | null;
    markers?: {
      intro: {
        startSeconds: number;
        endSeconds: number;
      } | null;
      credits: {
        startSeconds: number;
      } | null;
    } | null;
    createdAt: string; // date-time
    updatedAt: string; // date-time
  }[];
  nextCursor: string | null;
  total?: number;
  clutterCount?: number;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/folders

List the folders, newest first.

Folders hold files: a transfer added with `folder` (such as a show's `Name (Year)`) puts its files there, and so does a torrent with more than one file (named after it). Empty folders made with `POST /folders` are listed too. A folder inside another is a path, `Roms/GBA`; each `name` is the full path, and a folder's `fileCount` and `sizeBytes` take in the folders inside it. List a folder's files with `GET /files?folder=`.

Bearer token with `files:read`.

`200` Folders

```ts
{
  data: {
    name: string;
    kept?: "self" | "folder" | null;
    fileCount: number;
    sizeBytes: number;
    posterPath?: string | null;
    updatedAt: string; // date-time
  }[];
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/folders

Make an empty folder.

It stays until deleted. A path such as `Roms/GBA` makes it inside another folder. Names match without case.

Bearer token with `files:write`.

Body (`application/json`):

```ts
{
  name: string;
}
```

`201` Folder

```ts
{
  name: string;
  kept?: "self" | "folder" | null;
  fileCount: number;
  sizeBytes: number;
  posterPath?: string | null;
  updatedAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `409` A folder with this name exists; `429` Rate limited.

### POST /v1/folders/rename

Rename a folder.

`name` is the folder's path; `newName` is one name, which it takes in the same folder. Its files and the folders inside it move with it. A rename that changes only the case is allowed.

Bearer token with `files:write`.

Body (`application/json`):

```ts
{
  name: string;
  newName: string;
}
```

`200` Renamed

```ts
{
  name: string;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `409` A folder with the new name exists; `429` Rate limited.

### POST /v1/folders/move

Move a folder into another, or to the top.

`name` is the folder's path; `parent` is the folder to put it in (made if it does not exist), or null for the top. Its files and the folders inside it move with it. A folder cannot go inside itself.

Bearer token with `files:write`.

Body (`application/json`):

```ts
{
  name: string;
  parent: string | null;
}
```

`200` Moved

```ts
{
  name: string;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `409` The target has a folder with this name; `429` Rate limited.

### POST /v1/files/move

Move files to a folder, or to the top.

Up to 500 file IDs. `folder` is a path such as `Roms/GBA`; `folder: null` moves them out of any folder; a folder that does not exist is made. IDs that are not your files are skipped.

Bearer token with `files:write`.

Body (`application/json`):

```ts
{
  fileIds: string[];
  folder: string | null;
}
```

`200` Moved

```ts
{
  moved: number;
  folder: string | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/folders/keep

Keep a folder from auto-delete.

`keep: true` keeps every file in the folder and the folders inside it, including files added later, from the account's auto-delete setting; `keep: false` lets it delete them again. A plan's own retention, if it has one, still applies. A kept folder stays when it is empty.

Bearer token with `files:write`.

Body (`application/json`):

```ts
{
  name: string;
  keep: boolean;
}
```

`200` Kept

```ts
{
  name: string;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/files/keep

Keep files from auto-delete.

Up to 500 file IDs. `keep: true` keeps them from the account's auto-delete setting; `keep: false` lets it delete them again. A plan's own retention, if it has one, still applies. IDs that are not your files are skipped.

Bearer token with `files:write`.

Body (`application/json`):

```ts
{
  fileIds: string[];
  keep: boolean;
}
```

`200` Kept

```ts
{
  updated: number;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/folders/delete

Delete a folder and every file in it.

The folder's path matches without case, as in `GET /folders`. The folders inside it go too. `deleted` counts the files.

Bearer token with `files:write`.

Body (`application/json`):

```ts
{
  name: string;
}
```

`200` Deleted

```ts
{
  deleted: number;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/files/:id

Get a file with its media info and watch progress.

Bearer token with `files:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` File

```ts
{
  id: string;
  name: string;
  sizeBytes: number;
  mimeType: string;
  type: "video" | "audio" | "image" | "subtitle" | "other";
  playable: boolean;
  mediaInfo: {
    container: string;
    durationSeconds: number | null;
    bitRate: number | null;
    video: {
      codec: string;
      profile: string | null;
      width: number;
      height: number;
      pixFmt: string | null;
    } | null;
    audio: {
      codec: string;
      channels: number | null;
      language: string | null;
      title: string | null;
      default: boolean;
    }[];
    subtitles: {
      codec: string;
      language: string | null;
      title: string | null;
      forced: boolean;
      default: boolean;
    }[];
    playable: boolean;
  } | null;
  original?: {
    name: string;
    sizeBytes: number;
    mimeType: string;
    mediaInfo: {
      container: string;
      durationSeconds: number | null;
      bitRate: number | null;
      video: {
        codec: string;
        profile: string | null;
        width: number;
        height: number;
        pixFmt: string | null;
      } | null;
      audio: {
        codec: string;
        channels: number | null;
        language: string | null;
        title: string | null;
        default: boolean;
      }[];
      subtitles: {
        codec: string;
        language: string | null;
        title: string | null;
        forced: boolean;
        default: boolean;
      }[];
      playable: boolean;
    } | null;
  } | null;
  subtitleCount: number;
  transferId: string;
  folder?: string | null;
  progress: {
    fileId: string;
    positionSeconds: number;
    durationSeconds: number;
    completed: boolean;
    clientId: string | null;
    updatedAt: string; // date-time
  } | null;
  expiresAt: string | null; // date-time
  kept?: "self" | "folder" | null;
  clearedAt?: string | null; // date-time
  media?: {
    titleId: string;
    kind: "movie" | "show";
    title: string;
    year: number | null;
    season: number | null;
    episode: number | null;
    episodeName: string | null;
    stillPath: string | null;
    posterPath: string | null;
    backdropPath: string | null;
    logoPath: string | null;
  } | null;
  clutter?: boolean;
  thumbnailUrl?: string | null;
  markers?: {
    intro: {
      startSeconds: number;
      endSeconds: number;
    } | null;
    credits: {
      startSeconds: number;
    } | null;
  } | null;
  createdAt: string; // date-time
  updatedAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### PATCH /v1/files/:id

Rename a file.

Bearer token with `files:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

Body (`application/json`):

```ts
{
  name: string;
}
```

`200` Renamed

```ts
{
  id: string;
  name: string;
  sizeBytes: number;
  mimeType: string;
  type: "video" | "audio" | "image" | "subtitle" | "other";
  playable: boolean;
  mediaInfo: {
    container: string;
    durationSeconds: number | null;
    bitRate: number | null;
    video: {
      codec: string;
      profile: string | null;
      width: number;
      height: number;
      pixFmt: string | null;
    } | null;
    audio: {
      codec: string;
      channels: number | null;
      language: string | null;
      title: string | null;
      default: boolean;
    }[];
    subtitles: {
      codec: string;
      language: string | null;
      title: string | null;
      forced: boolean;
      default: boolean;
    }[];
    playable: boolean;
  } | null;
  original?: {
    name: string;
    sizeBytes: number;
    mimeType: string;
    mediaInfo: {
      container: string;
      durationSeconds: number | null;
      bitRate: number | null;
      video: {
        codec: string;
        profile: string | null;
        width: number;
        height: number;
        pixFmt: string | null;
      } | null;
      audio: {
        codec: string;
        channels: number | null;
        language: string | null;
        title: string | null;
        default: boolean;
      }[];
      subtitles: {
        codec: string;
        language: string | null;
        title: string | null;
        forced: boolean;
        default: boolean;
      }[];
      playable: boolean;
    } | null;
  } | null;
  subtitleCount: number;
  transferId: string;
  folder?: string | null;
  progress: {
    fileId: string;
    positionSeconds: number;
    durationSeconds: number;
    completed: boolean;
    clientId: string | null;
    updatedAt: string; // date-time
  } | null;
  expiresAt: string | null; // date-time
  kept?: "self" | "folder" | null;
  clearedAt?: string | null; // date-time
  media?: {
    titleId: string;
    kind: "movie" | "show";
    title: string;
    year: number | null;
    season: number | null;
    episode: number | null;
    episodeName: string | null;
    stillPath: string | null;
    posterPath: string | null;
    backdropPath: string | null;
    logoPath: string | null;
  } | null;
  clutter?: boolean;
  thumbnailUrl?: string | null;
  markers?: {
    intro: {
      startSeconds: number;
      endSeconds: number;
    } | null;
    credits: {
      startSeconds: number;
    } | null;
  } | null;
  createdAt: string; // date-time
  updatedAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### DELETE /v1/files/:id

Delete a file and its watch progress.

Bearer token with `files:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`204` Deleted

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/files/:id/restore

Bring back a watched video cleared from storage.

A video the user finished is cleared from their storage after their `clearWatchedDays` setting (the file's `clearedAt`): it stays in the library and stops counting against the quota. Playing or downloading it brings it back on its own; this does it ahead of time. `ready`: it is back in storage now and counts again. `restoring`: Fastwater is downloading it again in `transferId` (play it as it downloads with `POST /transfers/{id}/watch`). `unavailable`: its source is gone; add it again. A file in storage is `ready` as it is.

Bearer token with `files:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` Where the file is

```ts
{
  state: "ready" | "restoring" | "unavailable";
  transferId: string | null;
  file: {
    id: string;
    name: string;
    sizeBytes: number;
    mimeType: string;
    type: "video" | "audio" | "image" | "subtitle" | "other";
    playable: boolean;
    mediaInfo: {
      container: string;
      durationSeconds: number | null;
      bitRate: number | null;
      video: {
        codec: string;
        profile: string | null;
        width: number;
        height: number;
        pixFmt: string | null;
      } | null;
      audio: {
        codec: string;
        channels: number | null;
        language: string | null;
        title: string | null;
        default: boolean;
      }[];
      subtitles: {
        codec: string;
        language: string | null;
        title: string | null;
        forced: boolean;
        default: boolean;
      }[];
      playable: boolean;
    } | null;
    original?: {
      name: string;
      sizeBytes: number;
      mimeType: string;
      mediaInfo: {
        container: string;
        durationSeconds: number | null;
        bitRate: number | null;
        video: {
          codec: string;
          profile: string | null;
          width: number;
          height: number;
          pixFmt: string | null;
        } | null;
        audio: {
          codec: string;
          channels: number | null;
          language: string | null;
          title: string | null;
          default: boolean;
        }[];
        subtitles: {
          codec: string;
          language: string | null;
          title: string | null;
          forced: boolean;
          default: boolean;
        }[];
        playable: boolean;
      } | null;
    } | null;
    subtitleCount: number;
    transferId: string;
    folder?: string | null;
    progress: {
      fileId: string;
      positionSeconds: number;
      durationSeconds: number;
      completed: boolean;
      clientId: string | null;
      updatedAt: string; // date-time
    } | null;
    expiresAt: string | null; // date-time
    kept?: "self" | "folder" | null;
    clearedAt?: string | null; // date-time
    media?: {
      titleId: string;
      kind: "movie" | "show";
      title: string;
      year: number | null;
      season: number | null;
      episode: number | null;
      episodeName: string | null;
      stillPath: string | null;
      posterPath: string | null;
      backdropPath: string | null;
      logoPath: string | null;
    } | null;
    clutter?: boolean;
    thumbnailUrl?: string | null;
    markers?: {
      intro: {
        startSeconds: number;
        endSeconds: number;
      } | null;
      credits: {
        startSeconds: number;
      } | null;
    } | null;
    createdAt: string; // date-time
    updatedAt: string; // date-time
  };
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/files/:id/content

Read a text, PDF, or image file.

For AI assistants and scripts. A text file comes back as UTF-8 (`kind: "text"`), its first 1 MiB, with `truncated` set when there is more; a PDF as the text of its pages (up to 50 MiB files); a PNG, JPEG, GIF, or WebP image up to 3.75 MB as base64 (`kind: "image"`). Videos, audio, and other binary files answer `unsupported_file` (415): use the download link. Counts toward the same rate limit as download links.

Bearer token with `files:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` The file's text or image

```ts
{
  kind: "text";
  name: string;
  mimeType: string;
  sizeBytes: number;
  text: string;
  truncated: boolean;
  pages: number | null;
} | {
  kind: "image";
  name: string;
  mimeType: string;
  sizeBytes: number;
  data: string;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found; `415` Not a text, PDF, or image file, or too large to read; `429` Rate limited.

### POST /v1/files/delete

Delete many files at once.

Up to 500 file IDs. IDs that are not your files are skipped; `deleted` counts the rest.

Bearer token with `files:write`.

Body (`application/json`):

```ts
{
  fileIds: string[];
}
```

`200` Deleted

```ts
{
  deleted: number;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/files/archive

Download many files as one zip.

Up to 100 file IDs. Returns a link that works without a token for 10 minutes: open it to download the zip, which streams as it is made. Files are stored uncompressed, so the zip's size is known and downloads show progress.

Bearer token with `files:read`.

Body (`application/json`):

```ts
{
  fileIds: string[];
  original?: boolean;
}
```

`200` Zip link

```ts
{
  url: string; // uri
  expiresAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/files/:id/playback

Get a signed playback URL, subtitles, and the saved position.

The URL supports HTTP Range and expires at `expiresAt`. When it returns `403`, call this endpoint again for a new URL.

Send a stable `clientId` per device and the same one with progress updates. Each client that played in the last 60 seconds is a screen; a new client past the plan's screens gets `409` `screen_limit` with the active sessions.

`prepare: true` returns the same answer before the Play press, so a player can start buffering on the detail screen: it claims no screen, though it gets `409` `screen_limit` when other clients use every screen, the URL expires within 15 minutes, and it has its own rate limit. On Play, call again without `prepare` while playing the prepared URL, and stop if that call returns `409`.

Send `hevc` with what the screen decodes of HEVC. A screen that cannot decode the file's video plays an H.264 copy, which Fastwater makes the first time a screen asks. Until it is ready, the answer has `conversion` (queued or converting, with progress), claims no screen (with the same `409` as `prepare`), and its URL is the HEVC file: show the wait, and ask again with `prepare: true` every few seconds until `conversion` is null.

Bearer token with `files:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

Body (`application/json`, optional):

```ts
{
  clientId?: string;
  deviceLabel?: string;
  prepare?: boolean;
  original?: boolean;
  hevc?: "none" | "main" | "main10";
  inlineHls?: boolean;
}
```

`200` Playback

```ts
{
  url: string; // uri
  expiresAt: string; // date-time
  mimeType: string;
  playable: boolean;
  progress: {
    fileId: string;
    positionSeconds: number;
    durationSeconds: number;
    completed: boolean;
    clientId: string | null;
    updatedAt: string; // date-time
  } | null;
  subtitles: {
    id: string;
    language: string | null;
    label: string;
    forced: boolean;
    default: boolean;
    source: "embedded" | "external" | "opensubtitles" | "subdl" | "generated";
    url: string; // uri
  }[];
  conversion: {
    state: "queued" | "converting" | "failed";
    progress: number;
    etaSeconds: number | null;
    stream?: {
      url: string; // uri
      expiresAt: string; // date-time
    } | null;
    streamInSeconds?: number | null;
  } | null;
  hls?: {
    url: string; // uri
    tvUrl?: string; // uri
    inline?: {
      playlists: Record<string, string>;
      initSegments: Record<string, string>;
    };
  } | null;
  markers?: {
    intro: {
      startSeconds: number;
      endSeconds: number;
    } | null;
    credits: {
      startSeconds: number;
    } | null;
  } | null;
  trackPreference?: {
    audio: {
      language: string; // ISO 639-1 where known (`ja`), else the track's own tag in lowercase
      commentary: boolean;
      descriptive: boolean;
    } | null;
    subtitles: {
      language: string | null; // ISO 639-1 where known (`ja`), else the track's own tag in lowercase
      forced: boolean;
      hearingImpaired: boolean;
      commentary: boolean;
    } | null;
  } | null;
  originalLanguage?: string | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found; `409` Screen limit (`screen_limit`); `429` Rate limited.

### GET /v1/files/:id/subtitles/:trackId

Get a subtitle track as WebVTT.

The track `/playback` lists, read through the API. Players that can fetch the signed `url` should; this is for apps installed on a TV, whose requests come from `file://` and which storage's CORS rules do not admit.

Bearer token with `files:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |
| `trackId` | path | `string` | Required. |

`200` WebVTT

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/files/:id/download

Download a file.

Redirects (`302`) to a signed URL with `Content-Disposition: attachment`. With `redirect=false`, returns the URL as JSON. With `inline=true`, an image, PDF, audio, or text file gets `Content-Disposition: inline` and a type a browser shows (text is always `text/plain`), for a preview in the page.

Bearer token with `files:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |
| `redirect` | query | `"true" \| "false"` | Default `"true"`. |
| `original` | query | `"true" \| "false"` | Default `"false"`. |
| `inline` | query | `"true" \| "false"` | Default `"false"`. |

`200` Signed URL (redirect=false)

```ts
{
  url: string; // uri
  expiresAt: string; // date-time
}
```

`302` Redirect to the signed URL

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/files/:id/progress

Get the watch progress of a file.

Returns `null` when the user has not played the file.

Bearer token with `files:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` Progress

```ts
{
  fileId: string;
  positionSeconds: number;
  durationSeconds: number;
  completed: boolean;
  clientId: string | null;
  updatedAt: string; // date-time
} | null
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### PUT /v1/files/:id/progress

Save the watch progress of a file.

Send about every 10 seconds during playback, and on pause. A write with an `updatedAt` older than the stored one is ignored; the response is the stored progress. `409` `playback_stopped` means the user stopped this device's session: stop the player.

Bearer token with `progress:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

Body (`application/json`):

```ts
{
  positionSeconds: number;
  durationSeconds: number;
  clientId?: string;
  updatedAt?: string; // date-time
}
```

`200` Stored progress

```ts
{
  fileId: string;
  positionSeconds: number;
  durationSeconds: number;
  completed: boolean;
  clientId: string | null;
  updatedAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `409` Session stopped (`playback_stopped`); `429` Rate limited.

### PUT /v1/files/:id/track-preference

Remember the audio or subtitles picked for the file's show.

Send when the user picks an audio track or subtitles (or turns subtitles off) while an episode plays, with only the kinds they picked. Fastwater remembers them for the episode's show, and `/playback` returns them as `trackPreference` with the show's episodes, so every app starts each one with the matching tracks. Tracks are described by language and kind, not position: releases order them differently. Subtitles in a language the show's other episodes lack are searched for. Returns `null`, saving nothing, for a movie or a file not matched to a show.

Bearer token with `progress:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

Body (`application/json`):

```ts
{
  audio?: {
    language: string; // ISO 639-1 where known (`ja`), else the track's own tag in lowercase
    commentary: boolean;
    descriptive: boolean;
  };
  subtitles?: {
    language: string | null; // ISO 639-1 where known (`ja`), else the track's own tag in lowercase
    forced: boolean;
    hearingImpaired: boolean;
    commentary: boolean;
  };
}
```

`200` The show's remembered tracks

```ts
{
  audio: {
    language: string; // ISO 639-1 where known (`ja`), else the track's own tag in lowercase
    commentary: boolean;
    descriptive: boolean;
  } | null;
  subtitles: {
    language: string | null; // ISO 639-1 where known (`ja`), else the track's own tag in lowercase
    forced: boolean;
    hearingImpaired: boolean;
    commentary: boolean;
  } | null;
} | null
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/progress

Get the watch progress of up to 100 files.

Bearer token with `files:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `fileIds` | query | `string` | Required. |

`200` Progress for the files the user has played

```ts
{
  data: {
    fileId: string;
    positionSeconds: number;
    durationSeconds: number;
    completed: boolean;
    clientId: string | null;
    updatedAt: string; // date-time
  }[];
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/progress/recent

Continue watching: recent progress, newest first.

Without `completed`: unfinished videos, one per show (its newest position), and the next episode of each show whose last-watched episode was finished (`upNext`), when the library has it and nothing of it was played. With `completed`, every recent position.

Bearer token with `files:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `limit` | query | `number` | Default `20`. |
| `completed` | query | `"true" \| "false"` | Default `"false"`. |

`200` Recent progress with each file

```ts
{
  data: {
    fileId: string;
    positionSeconds: number;
    durationSeconds: number;
    completed: boolean;
    clientId: string | null;
    updatedAt: string; // date-time
    file: {
      id: string;
      name: string;
      sizeBytes: number;
      mimeType: string;
      type: "video" | "audio" | "image" | "subtitle" | "other";
      playable: boolean;
      mediaInfo: {
        container: string;
        durationSeconds: number | null;
        bitRate: number | null;
        video: {
          codec: string;
          profile: string | null;
          width: number;
          height: number;
          pixFmt: string | null;
        } | null;
        audio: {
          codec: string;
          channels: number | null;
          language: string | null;
          title: string | null;
          default: boolean;
        }[];
        subtitles: {
          codec: string;
          language: string | null;
          title: string | null;
          forced: boolean;
          default: boolean;
        }[];
        playable: boolean;
      } | null;
      original?: {
        name: string;
        sizeBytes: number;
        mimeType: string;
        mediaInfo: {
          container: string;
          durationSeconds: number | null;
          bitRate: number | null;
          video: {
            codec: string;
            profile: string | null;
            width: number;
            height: number;
            pixFmt: string | null;
          } | null;
          audio: {
            codec: string;
            channels: number | null;
            language: string | null;
            title: string | null;
            default: boolean;
          }[];
          subtitles: {
            codec: string;
            language: string | null;
            title: string | null;
            forced: boolean;
            default: boolean;
          }[];
          playable: boolean;
        } | null;
      } | null;
      subtitleCount: number;
      transferId: string;
      folder?: string | null;
      progress: {
        fileId: string;
        positionSeconds: number;
        durationSeconds: number;
        completed: boolean;
        clientId: string | null;
        updatedAt: string; // date-time
      } | null;
      expiresAt: string | null; // date-time
      kept?: "self" | "folder" | null;
      clearedAt?: string | null; // date-time
      media?: {
        titleId: string;
        kind: "movie" | "show";
        title: string;
        year: number | null;
        season: number | null;
        episode: number | null;
        episodeName: string | null;
        stillPath: string | null;
        posterPath: string | null;
        backdropPath: string | null;
        logoPath: string | null;
      } | null;
      clutter?: boolean;
      thumbnailUrl?: string | null;
      markers?: {
        intro: {
          startSeconds: number;
          endSeconds: number;
        } | null;
        credits: {
          startSeconds: number;
        } | null;
      } | null;
      createdAt: string; // date-time
      updatedAt: string; // date-time
    };
    upNext?: boolean;
  }[];
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/playback/support

What the user's screens decode.

The least HEVC support among the screens that played in the last 90 days and sent `hevc`, for choosing sources. Null before any did.

Bearer token with `files:read`.

`200` HEVC support

```ts
{
  hevc: "none" | "main" | "main10" | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/playback/reports

Report how a playback went.

Startup time, stalls, and throughput for one playback, for the performance report. Send the running totals about every 30 seconds and when the player closes or fails; the last report for a `playbackId` wins.

Bearer token with `progress:write`.

Body (`application/json`):

```ts
{
  playbackId: string;
  fileId: string;
  client: "tv" | "web" | "putflix" | "mobile";
  device?: string;
  urlMs: number | null;
  startupMs: number | null;
  firstByteMs?: number | null;
  metadataMs?: number | null;
  stalls: number;
  stallMs: number;
  seeks: number;
  seekWaitMs: number;
  playedMs: number;
  throughputBps: number | null;
  droppedFrames: number | null;
  error: string | null;
  timeZone?: string | null;
  prepared?: boolean;
  engine?: "hls.js" | "native-hls" | "file" | "avplay" | null;
}
```

`204` Saved

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/playback-sessions

Devices playing now.

Sessions with a playback request or progress update in the last 60 seconds.

Bearer token with `files:read`.

`200` Active sessions

```ts
{
  data: {
    id: string;
    clientId: string;
    deviceLabel: string;
    fileId: string;
    fileName: string;
    lastSeenAt: string; // date-time
  }[];
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### DELETE /v1/playback-sessions/:id

Stop playback on a device.

Frees the screen at once. The device's next progress update gets `409` `playback_stopped`. Its signed URL works until it expires.

Bearer token with `progress:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`204` Stopped

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/uploads

Start uploading a file from your device.

Reserves the file's size in your storage and returns how to split it: send each part with `PUT /v1/uploads/{id}/parts/{n}` (every part `partSize` bytes but the last), then `POST /v1/uploads/{id}/complete`. Fastwater then processes it like a downloaded file (media info, MP4, subtitles), as a transfer with `sourceType: "upload"`. Files up to 5 TiB. An upload left unfinished for 2 days is dropped.

Bearer token with `transfers:write`.

Body (`application/json`):

```ts
{
  name: string;
  sizeBytes: number;
  mimeType?: string;
  folder?: string;
}
```

`201` Upload started

```ts
{
  id: string;
  partSize: number;
  partCount: number;
  uploadedParts: number[];
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed, or over the storage quota (`quota_exceeded`); `404` Not found; `409` The upload has ended, or parts are missing; `429` Rate limited.

### POST /v1/uploads/errors

Report an upload that failed in the client.

Goes to Fastwater's logs, so support can see what went wrong. Send it once, when an upload gives up; leave the file's name out.

Bearer token with `transfers:write`.

Body (`application/json`):

```ts
{
  uploadId?: string;
  stage: "read" | "create" | "part" | "complete" | "resume";
  sizeBytes: number;
  extension?: string;
  status?: number;
  attempts: number;
  message: string;
  client: string;
}
```

`204` Logged

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed, or over the storage quota (`quota_exceeded`); `404` Not found; `409` The upload has ended, or parts are missing; `429` Rate limited.

### GET /v1/uploads/:id

The parts received so far, to resume an upload.

Bearer token with `transfers:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` Upload

```ts
{
  id: string;
  partSize: number;
  partCount: number;
  uploadedParts: number[];
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed, or over the storage quota (`quota_exceeded`); `404` Not found; `409` The upload has ended, or parts are missing; `429` Rate limited.

### DELETE /v1/uploads/:id

Cancel an upload and free its reserved space.

Bearer token with `transfers:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`204` Cancelled

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed, or over the storage quota (`quota_exceeded`); `404` Not found; `409` The upload has ended, or parts are missing; `429` Rate limited.

### PUT /v1/uploads/:id/parts/:n

Send one part of an upload.

The body is the part's bytes (`application/octet-stream`) with its `Content-Length`. Parts are numbered from 1, can go in any order and in parallel, and a part sent again replaces it.

Bearer token with `transfers:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |
| `n` | path | `number` | Required. |

`204` Stored

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed, or over the storage quota (`quota_exceeded`); `404` Not found; `409` The upload has ended, or parts are missing; `429` Rate limited.

### POST /v1/uploads/:id/complete

Finish an upload and queue it for processing.

Returns the transfer. Calling it again returns the same transfer. A 409 for a joined file of the wrong size drops the parts: get the upload again and send every part.

Bearer token with `transfers:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` Transfer

```ts
{
  id: string;
  status: "queued" | "downloading" | "ingesting" | "completed" | "failed" | "cancelled";
  waitingForSlot?: boolean;
  outcome: "hit" | "attached" | "miss";
  sourceType: "magnet" | "torrent" | "upload" | "putio";
  infoHash: string;
  name: string | null;
  totalBytes: number | null;
  progress: number;
  speedBps: number;
  etaSeconds: number | null;
  processingProgress: number | null;
  fileCount: number | null;
  error: string | null;
  folder: string | null;
  fileIds: string[];
  rssFeed: {
    id: string;
    title: string;
  } | null;
  restore?: boolean;
  title?: {
    tmdbId: number;
    kind: "movie" | "show";
    season: number | null;
    episode: number | null;
  } | null;
  resume?: {
    positionSeconds: number;
    durationSeconds: number;
    updatedAt: string; // date-time
  } | null;
  createdAt: string; // date-time
  updatedAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed, or over the storage quota (`quota_exceeded`); `404` Not found; `409` The upload has ended, or parts are missing; `429` Rate limited.

### GET /v1/shared/:token

The files a share link opens.

Needs no token. Send the browser's `viewerId` to learn whether it can still play (`canWatch`).

No auth.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `token` | path | `string` | Required. |
| `viewerId` | query | `string` |  |

`200` Shared files

```ts
{
  senderName: string | null;
  files: {
    id: string;
    name: string;
    sizeBytes: number;
    type: "video" | "audio" | "image" | "subtitle" | "other";
    playable: boolean;
    durationSeconds: number | null;
    media: {
      titleId: string;
      kind: "movie" | "show";
      title: string;
      year: number | null;
      season: number | null;
      episode: number | null;
      episodeName: string | null;
      stillPath: string | null;
      posterPath: string | null;
      backdropPath: string | null;
      logoPath: string | null;
    } | null;
    thumbnailUrl?: string | null;
  }[];
  maxViewers: number;
  viewers: number;
  canWatch: boolean;
  expiresAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/shared/:token/files/:fileId/playback

Play a shared file.

Needs no token. The first call from a `viewerId` takes a viewer place, and fails with `403` when every place is taken. The URL supports HTTP Range and never outlives the link.

No auth.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `token` | path | `string` | Required. |
| `fileId` | path | `string` | Required. |

Body (`application/json`):

```ts
{
  viewerId: string;
  deviceLabel?: string;
  hevc?: "none" | "main" | "main10";
  inlineHls?: boolean;
}
```

`200` Playback

```ts
{
  url: string; // uri
  expiresAt: string; // date-time
  mimeType: string;
  playable: boolean;
  progress: {
    fileId: string;
    positionSeconds: number;
    durationSeconds: number;
    completed: boolean;
    clientId: string | null;
    updatedAt: string; // date-time
  } | null;
  subtitles: {
    id: string;
    language: string | null;
    label: string;
    forced: boolean;
    default: boolean;
    source: "embedded" | "external" | "opensubtitles" | "subdl" | "generated";
    url: string; // uri
  }[];
  conversion: {
    state: "queued" | "converting" | "failed";
    progress: number;
    etaSeconds: number | null;
    stream?: {
      url: string; // uri
      expiresAt: string; // date-time
    } | null;
    streamInSeconds?: number | null;
  } | null;
  hls?: {
    url: string; // uri
    tvUrl?: string; // uri
    inline?: {
      playlists: Record<string, string>;
      initSegments: Record<string, string>;
    };
  } | null;
  markers?: {
    intro: {
      startSeconds: number;
      endSeconds: number;
    } | null;
    credits: {
      startSeconds: number;
    } | null;
  } | null;
  trackPreference?: {
    audio: {
      language: string; // ISO 639-1 where known (`ja`), else the track's own tag in lowercase
      commentary: boolean;
      descriptive: boolean;
    } | null;
    subtitles: {
      language: string | null; // ISO 639-1 where known (`ja`), else the track's own tag in lowercase
      forced: boolean;
      hearingImpaired: boolean;
      commentary: boolean;
    } | null;
  } | null;
  originalLanguage?: string | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/shares

Share links that still work.

Bearer token with `files:read`.

`200` Share links, newest first

```ts
{
  data: {
    id: string;
    url: string; // uri
    files: {
      id: string;
      name: string;
    }[];
    maxViewers: number;
    viewers: number;
    expiresAt: string; // date-time
    revokedAt: string | null; // date-time
    createdAt: string; // date-time
  }[];
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/shares

Share files with a link.

A link that streams up to 100 files to people without a Fastwater account. Each browser that plays from it takes one of `maxViewers` places (up to 10); a full link plays only for the browsers that already have a place. Links last `expiresInDays` (up to 30). Viewers use none of your screens. Deleting a file takes it out of every link.

Bearer token with `files:write`.

Body (`application/json`):

```ts
{
  fileIds: string[];
  maxViewers?: number;
  expiresInDays?: number;
}
```

`201` Share link

```ts
{
  id: string;
  url: string; // uri
  files: {
    id: string;
    name: string;
  }[];
  maxViewers: number;
  viewers: number;
  expiresAt: string; // date-time
  revokedAt: string | null; // date-time
  createdAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found; `409` Too many open links; `429` Rate limited.

### DELETE /v1/shares/:id

Turn off a share link.

The link stops working at once. A viewer who is playing keeps the video until its URL expires.

Bearer token with `files:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`204` Turned off

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/parties

Your open watch party.

At most one, with its `hostKey`, to take it up again after a reload.

Bearer token with `files:read`.

`200` Open parties

```ts
{
  data: {
    id: string;
    token: string;
    url: string; // uri
    hostKey: string;
    fileId: string;
    createdAt: string; // date-time
  }[];
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/parties

Start a watch party.

Plays one of your videos in sync for up to 10 guests at once, who need no Fastwater account and use none of your screens. Anyone in the party can play, pause, and seek for everyone, and chat. Guests open `url`. You take part with `hostKey` as your member key on the party's routes; your player keeps the party open through `GET /v1/parties/{token}/events`; it ends 5 minutes after you leave, after 24 hours, or when you end it. Starting a party ends the one you had open.

Bearer token with `files:write`.

Body (`application/json`):

```ts
{
  fileId: string;
  positionSeconds?: number;
  playing?: boolean;
}
```

`201` The party

```ts
{
  id: string;
  token: string;
  url: string; // uri
  hostKey: string;
  fileId: string;
  createdAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found; `429` Rate limited.

### DELETE /v1/parties/:id

End a watch party.

Guests see that it ended. A guest who is playing keeps the video until its URL expires.

Bearer token with `files:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`204` Ended

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/parties/:token

A watch party, from its link.

Needs no token. Send the member key to learn whether this member can join (`canJoin`). `404` once the party ended.

No auth.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `token` | path | `string` | Required. |
| `memberKey` | query | `string` |  |

`200` The party

```ts
{
  hostName: string | null;
  file: {
    id: string;
    name: string;
    sizeBytes: number;
    type: "video" | "audio" | "image" | "subtitle" | "other";
    playable: boolean;
    durationSeconds: number | null;
    media: {
      titleId: string;
      kind: "movie" | "show";
      title: string;
      year: number | null;
      season: number | null;
      episode: number | null;
      episodeName: string | null;
      stillPath: string | null;
      posterPath: string | null;
      backdropPath: string | null;
      logoPath: string | null;
    } | null;
    thumbnailUrl?: string | null;
  };
  state: {
    fileId: string;
    playing: boolean;
    positionSeconds: number;
    updatedAt: number;
    version: number;
    hostOnly: boolean;
  };
  members: {
    id: string;
    name: string;
    host: boolean;
  }[];
  memberId: string | null;
  messages: {
    id: string;
    memberId: string;
    name: string;
    text: string;
    sentAt: string; // date-time
  }[];
  maxGuests: number;
  canJoin: boolean;
  hostHere: boolean;
  serverTime: number;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/parties/:token/control

Play, pause, or seek for everyone.

Needs no token; the member must be in the party. Send it when the member plays, pauses, or seeks, not when the player follows the party. Only the host may send `fileId`, which moves the party to another of their videos. While the party's `hostOnly` is on, only the host may send it at all.

No auth.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `token` | path | `string` | Required. |

Body (`application/json`):

```ts
{
  memberKey: string;
  playing: boolean;
  positionSeconds: number;
  fileId?: string;
}
```

`200` Where the party is now

```ts
{
  fileId: string;
  playing: boolean;
  positionSeconds: number;
  updatedAt: number;
  version: number;
  hostOnly: boolean;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/parties/:token/settings

Change a watch party's settings.

Host only, with the host key. `hostOnly` lets only the host play, pause, and seek; guests' controls are then refused with `403`, and their players follow the host. Members get the change as a `state` event.

No auth.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `token` | path | `string` | Required. |

Body (`application/json`):

```ts
{
  memberKey: string;
  hostOnly: boolean;
}
```

`200` Where the party is now

```ts
{
  fileId: string;
  playing: boolean;
  positionSeconds: number;
  updatedAt: number;
  version: number;
  hostOnly: boolean;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/parties/:token/leave

Leave a watch party.

Needs no token. Send it when the page closes (`fetch` with `keepalive`): the member leaves at once, rather than when their event stream is noticed closed.

No auth.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `token` | path | `string` | Required. |

Body (`application/json`):

```ts
{
  memberKey: string;
}
```

`204` Left

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/parties/:token/messages

Chat in a watch party.

No auth.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `token` | path | `string` | Required. |

Body (`application/json`):

```ts
{
  memberKey: string;
  text: string;
}
```

`201` The message

```ts
{
  id: string;
  memberId: string;
  name: string;
  text: string;
  sentAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/parties/:token/playback

Play a watch party's video.

Needs no token; the member must be in the party. As a share link's playback: the URL supports HTTP Range and never outlives the party. Ask again when the party moves to another video.

No auth.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `token` | path | `string` | Required. |

Body (`application/json`):

```ts
{
  memberKey: string;
  deviceLabel?: string;
  hevc?: "none" | "main" | "main10";
  inlineHls?: boolean;
}
```

`200` Playback

```ts
{
  url: string; // uri
  expiresAt: string; // date-time
  mimeType: string;
  playable: boolean;
  progress: {
    fileId: string;
    positionSeconds: number;
    durationSeconds: number;
    completed: boolean;
    clientId: string | null;
    updatedAt: string; // date-time
  } | null;
  subtitles: {
    id: string;
    language: string | null;
    label: string;
    forced: boolean;
    default: boolean;
    source: "embedded" | "external" | "opensubtitles" | "subdl" | "generated";
    url: string; // uri
  }[];
  conversion: {
    state: "queued" | "converting" | "failed";
    progress: number;
    etaSeconds: number | null;
    stream?: {
      url: string; // uri
      expiresAt: string; // date-time
    } | null;
    streamInSeconds?: number | null;
  } | null;
  hls?: {
    url: string; // uri
    tvUrl?: string; // uri
    inline?: {
      playlists: Record<string, string>;
      initSegments: Record<string, string>;
    };
  } | null;
  markers?: {
    intro: {
      startSeconds: number;
      endSeconds: number;
    } | null;
    credits: {
      startSeconds: number;
    } | null;
  } | null;
  trackPreference?: {
    audio: {
      language: string; // ISO 639-1 where known (`ja`), else the track's own tag in lowercase
      commentary: boolean;
      descriptive: boolean;
    } | null;
    subtitles: {
      language: string | null; // ISO 639-1 where known (`ja`), else the track's own tag in lowercase
      forced: boolean;
      hearingImpaired: boolean;
      commentary: boolean;
    } | null;
  } | null;
  originalLanguage?: string | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/parties/:token/events

Join a watch party and follow it.

Needs no token. Server-Sent Events, each `data` one JSON event: `snapshot` first, and again when the host changes the video; `state` when anyone plays, pauses, or seeks; `members`; `message`; `ping` every 15 seconds with the server's time; `ended` last. The member key is the member: make a random one per device and keep it. The member is in the party while the stream is open. `403` when 10 guests are in.

No auth.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `token` | path | `string` | Required. |
| `memberKey` | query | `string` | Required. |
| `name` | query | `string` |  |

`200` The event stream

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/cache

Check which info hashes are cached (up to 50).

`cached` is true when every file of the torrent is stored, so a new transfer completes at once. Send hashes in hex or base32; the response keys are the hashes as sent.

Bearer token.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `hash` | query | `string` | Required. |

`200` Availability by hash

```ts
Record<string, {
  cached: boolean;
  files?: {
    name: string;
    path: string;
    sizeBytes: number;
    mimeType: string;
    playable: boolean;
    videoCodec: string | null;
    audioCodecs: string[];
    height: number | null;
  }[];
}>
```

Errors: `400` Invalid request; `401` Missing or invalid token; `429` Rate limited.

### POST /v1/cache

Check which info hashes are cached (up to 500).

`cached` is true when every file of the torrent is stored, so a new transfer completes at once. Send hashes in hex or base32; the response keys are the hashes as sent.

Bearer token.

Body (`application/json`):

```ts
{
  hashes: string[];
}
```

`200` Availability by hash

```ts
Record<string, {
  cached: boolean;
  files?: {
    name: string;
    path: string;
    sizeBytes: number;
    mimeType: string;
    playable: boolean;
    videoCodec: string | null;
    audioCodecs: string[];
    height: number | null;
  }[];
}>
```

Errors: `400` Invalid request; `401` Missing or invalid token; `429` Rate limited.

### GET /v1/cache/sources

List the cached torrents of a movie, season, or episode.

Torrents stored in full for a TMDB title, so a transfer of one completes at once. For an episode, the list includes season packs that hold it (single episodes first); for a season, only packs.

Bearer token.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `tmdbId` | query | `number` | Required. |
| `kind` | query | `"movie" \| "show"` | Required. |
| `season` | query | `number \| null` |  |
| `episode` | query | `number \| null` |  |

`200` Cached torrents, at most 20

```ts
{
  data: {
    infoHash: string;
    name: string;
    sizeBytes: number;
    episodes: number[];
    files: {
      name: string;
      path: string;
      sizeBytes: number;
      mimeType: string;
      playable: boolean;
      videoCodec: string | null;
      audioCodecs: string[];
      height: number | null;
    }[];
    storedAt: string; // date-time
  }[];
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `429` Rate limited.

### POST /v1/cache/usenet

Check which torrents download from Usenet (up to 100).

True for a torrent whose release is posted on Usenet: a transfer of it downloads from there, usually in seconds, whatever its seeders. Null while its posts are still being checked: likely true, and asking again in a couple of seconds settles it. Send each torrent's name and size as the site lists them, likeliest picks first: their posts are checked first. An empty object when Usenet is off.

Bearer token.

Body (`application/json`):

```ts
{
  sources: {
    hash: string;
    name: string;
    sizeBytes?: number | null;
  }[];
}
```

`200` Usenet availability by hash

```ts
Record<string, boolean | null>
```

Errors: `400` Invalid request; `401` Missing or invalid token; `429` Rate limited.

### GET /v1/apps

List the OAuth apps the user authorized.

Needs a full-access API key or a signed-in session.

Bearer token.

`200` Apps

```ts
{
  data: {
    id: string;
    clientId: string;
    name: string;
    firstSeenAt: string; // date-time
    lastSeenAt: string; // date-time
  }[];
}
```

Errors: `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### DELETE /v1/apps/:id

Revoke an app's access.

The app's tokens stop working at once. Needs a full-access API key or a signed-in session.

Bearer token.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`204` Revoked

Errors: `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/api-keys

List the user's API keys.

Keys of paired devices are under `/devices`. Needs a full-access API key or a signed-in session.

Bearer token.

`200` Keys

```ts
{
  data: {
    id: string;
    name: string;
    scopes: ("files:read" | "files:write" | "progress:write" | "transfers:read" | "transfers:write" | "feeds:read" | "feeds:write")[];
    createdAt: string; // date-time
    lastUsedAt: string | null; // date-time
  }[];
}
```

Errors: `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/api-keys

Create an API key.

The secret is in this response only. A key without scopes has full access. Needs a full-access API key or a signed-in session.

Bearer token.

Body (`application/json`):

```ts
{
  name: string;
  scopes?: ("files:read" | "files:write" | "progress:write" | "transfers:read" | "transfers:write" | "feeds:read" | "feeds:write")[];
}
```

`201` Created

```ts
{
  secret: string;
  key: {
    id: string;
    name: string;
    scopes: ("files:read" | "files:write" | "progress:write" | "transfers:read" | "transfers:write" | "feeds:read" | "feeds:write")[];
    createdAt: string; // date-time
    lastUsedAt: string | null; // date-time
  };
}
```

Errors: `401` Missing or invalid token; `403` Not allowed; `404` Not found; `409` A key with this name exists; `429` Rate limited.

### DELETE /v1/api-keys/:id

Revoke an API key.

The key stops working at once. Needs a full-access API key or a signed-in session.

Bearer token.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`204` Revoked

Errors: `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/feeds

List RSS feeds.

RSS feeds add a transfer for each new item that matches their keywords. Each is checked about every 15 minutes. URLs are shown as scheme and host only: the rest may hold a passkey.

Bearer token with `feeds:read`.

`200` Feeds

```ts
{
  data: {
    id: string;
    title: string;
    url: string;
    host: string;
    folder: string | null;
    include: string;
    exclude: string;
    status: "ok" | "error" | "paused";
    pauseReason: "user" | "errors" | "no_subscription" | null;
    lastError: string | null;
    lastFetchAt: string | null; // date-time
    lastSuccessAt: string | null; // date-time
    nextFetchAt: string; // date-time
    addedCount: number;
    failedCount: number;
    createdAt: string; // date-time
  }[];
}
```

Errors: `400` Invalid request, or the feed could not be fetched or read; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/feeds

Add an RSS feed.

Items may be magnets or .torrent links. The feed is fetched now: `feed_unreachable` or `feed_invalid` when it cannot be. Only items that appear later are added, unless `processExisting`. Include terms are comma-separated; a term matches when every word of it is in the title (case and `.`, `_`, `-` ignored, a word matching the start of a title word). An item is added when any include term matches (or there are none) and no exclude term does. At most 100 feeds (`too_many_feeds`).

Bearer token with `feeds:write`.

Body (`application/json`):

```ts
{
  url: string; // uri
  title?: string;
  folder?: string | null;
  include?: string;
  exclude?: string;
  processExisting?: boolean;
}
```

`201` Created

```ts
{
  feed: {
    id: string;
    title: string;
    url: string;
    host: string;
    folder: string | null;
    include: string;
    exclude: string;
    status: "ok" | "error" | "paused";
    pauseReason: "user" | "errors" | "no_subscription" | null;
    lastError: string | null;
    lastFetchAt: string | null; // date-time
    lastSuccessAt: string | null; // date-time
    nextFetchAt: string; // date-time
    addedCount: number;
    failedCount: number;
    createdAt: string; // date-time
  };
  preview: {
    title: string | null;
    itemCount: number;
    matchCount: number;
    items: {
      title: string;
      publishedAt: string | null; // date-time
      matches: boolean;
      hasTorrent: boolean;
    }[];
  };
}
```

Errors: `400` Invalid request, or the feed could not be fetched or read; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found; `409` Too many feeds; `429` Rate limited.

### POST /v1/feeds/preview

Preview a feed and its matches.

Fetches the feed and shows its newest 20 items and which the keywords take, without saving anything.

Bearer token with `feeds:read`.

Body (`application/json`):

```ts
{
  url: string; // uri
  include?: string;
  exclude?: string;
}
```

`200` Preview

```ts
{
  title: string | null;
  itemCount: number;
  matchCount: number;
  items: {
    title: string;
    publishedAt: string | null; // date-time
    matches: boolean;
    hasTorrent: boolean;
  }[];
}
```

Errors: `400` Invalid request, or the feed could not be fetched or read; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/feeds/:id

Get an RSS feed, with its full URL.

Bearer token with `feeds:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` Feed

```ts
{
  id: string;
  title: string;
  url: string;
  host: string;
  folder: string | null;
  include: string;
  exclude: string;
  status: "ok" | "error" | "paused";
  pauseReason: "user" | "errors" | "no_subscription" | null;
  lastError: string | null;
  lastFetchAt: string | null; // date-time
  lastSuccessAt: string | null; // date-time
  nextFetchAt: string; // date-time
  addedCount: number;
  failedCount: number;
  createdAt: string; // date-time
}
```

Errors: `400` Invalid request, or the feed could not be fetched or read; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### PATCH /v1/feeds/:id

Change an RSS feed.

Leave a field out to keep it. A new URL is fetched first. New keywords apply to items that appear later.

Bearer token with `feeds:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

Body (`application/json`):

```ts
{
  url?: string; // uri
  title?: string;
  folder?: string | null;
  include?: string;
  exclude?: string;
}
```

`200` Feed

```ts
{
  id: string;
  title: string;
  url: string;
  host: string;
  folder: string | null;
  include: string;
  exclude: string;
  status: "ok" | "error" | "paused";
  pauseReason: "user" | "errors" | "no_subscription" | null;
  lastError: string | null;
  lastFetchAt: string | null; // date-time
  lastSuccessAt: string | null; // date-time
  nextFetchAt: string; // date-time
  addedCount: number;
  failedCount: number;
  createdAt: string; // date-time
}
```

Errors: `400` Invalid request, or the feed could not be fetched or read; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### DELETE /v1/feeds/:id

Delete an RSS feed.

Its transfers and files stay.

Bearer token with `feeds:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`204` Deleted

Errors: `400` Invalid request, or the feed could not be fetched or read; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/feeds/:id/pause

Pause an RSS feed.

It is not checked until resumed.

Bearer token with `feeds:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` Feed

```ts
{
  id: string;
  title: string;
  url: string;
  host: string;
  folder: string | null;
  include: string;
  exclude: string;
  status: "ok" | "error" | "paused";
  pauseReason: "user" | "errors" | "no_subscription" | null;
  lastError: string | null;
  lastFetchAt: string | null; // date-time
  lastSuccessAt: string | null; // date-time
  nextFetchAt: string; // date-time
  addedCount: number;
  failedCount: number;
  createdAt: string; // date-time
}
```

Errors: `400` Invalid request, or the feed could not be fetched or read; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/feeds/:id/resume

Resume an RSS feed.

Checked within 5 minutes. Items that appeared while it was paused are added if they match.

Bearer token with `feeds:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` Feed

```ts
{
  id: string;
  title: string;
  url: string;
  host: string;
  folder: string | null;
  include: string;
  exclude: string;
  status: "ok" | "error" | "paused";
  pauseReason: "user" | "errors" | "no_subscription" | null;
  lastError: string | null;
  lastFetchAt: string | null; // date-time
  lastSuccessAt: string | null; // date-time
  nextFetchAt: string; // date-time
  addedCount: number;
  failedCount: number;
  createdAt: string; // date-time
}
```

Errors: `400` Invalid request, or the feed could not be fetched or read; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/feeds/:id/refresh

Check an RSS feed soon.

Checked on the next run, within 5 minutes.

Bearer token with `feeds:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` Feed

```ts
{
  id: string;
  title: string;
  url: string;
  host: string;
  folder: string | null;
  include: string;
  exclude: string;
  status: "ok" | "error" | "paused";
  pauseReason: "user" | "errors" | "no_subscription" | null;
  lastError: string | null;
  lastFetchAt: string | null; // date-time
  lastSuccessAt: string | null; // date-time
  nextFetchAt: string; // date-time
  addedCount: number;
  failedCount: number;
  createdAt: string; // date-time
}
```

Errors: `400` Invalid request, or the feed could not be fetched or read; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/feeds/:id/items

An RSS feed's history.

Every item seen, newest first, with what happened to it.

Bearer token with `feeds:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |
| `cursor` | query | `string` |  |
| `limit` | query | `number` | Default `50`. |

`200` Items

```ts
{
  data: {
    id: string;
    title: string;
    publishedAt: string | null; // date-time
    status: "baseline" | "skipped" | "waiting" | "added" | "failed";
    reason: string | null;
    transferId: string | null;
    detectedAt: string; // date-time
    processedAt: string | null; // date-time
  }[];
  nextCursor: string | null;
}
```

Errors: `400` Invalid request, or the feed could not be fetched or read; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### DELETE /v1/feeds/:id/items

Clear an RSS feed's history.

Items seen before are still not added again.

Bearer token with `feeds:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`204` Cleared

Errors: `400` Invalid request, or the feed could not be fetched or read; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/feeds/:id/items/:itemId/retry

Add an item now.

Adds a failed or skipped item now, whatever the keywords. `waiting` when at the active-transfer limit.

Bearer token with `feeds:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |
| `itemId` | path | `string` | Required. |

`200` Item

```ts
{
  id: string;
  title: string;
  publishedAt: string | null; // date-time
  status: "baseline" | "skipped" | "waiting" | "added" | "failed";
  reason: string | null;
  transferId: string | null;
  detectedAt: string; // date-time
  processedAt: string | null; // date-time
}
```

Errors: `400` Invalid request, or the feed could not be fetched or read; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found; `409` Already added; `429` Rate limited.

### POST /v1/feeds/:id/retry

Retry an RSS feed's failed items.

They are added on the next check, within 5 minutes.

Bearer token with `feeds:write`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` Queued

```ts
{
  retried: number;
}
```

Errors: `400` Invalid request, or the feed could not be fetched or read; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/devices/pairings

Start device pairing.

No token. The device shows the code and a QR code for `verificationUrl`, then polls. The code expires after 10 minutes.

No auth.

Body (`application/json`):

```ts
{
  platform: "android_tv" | "fire_tv" | "apple_tv" | "lg_tv" | "samsung_tv" | "roku" | "kodi" | "jellyfin" | "webdav" | "stremio" | "cli" | "ios" | "android" | "putflix_tv" | "putflix_agent";
}
```

`201` Pairing

```ts
{
  code: string;
  pollToken: string;
  verificationUrl: string;
  expiresAt: string; // date-time
  intervalSeconds: number;
}
```

Errors: `400` Invalid request; `429` Rate limited.

### POST /v1/devices/pairings/poll

Poll a device pairing.

No token. Poll every `intervalSeconds`. After the user approves, the first poll returns the API key, once.

No auth.

Body (`application/json`):

```ts
{
  pollToken: string;
}
```

`200` Pending, or claimed with the key

```ts
{
  status: "pending";
} | {
  status: "claimed";
  apiKey: string;
  device: {
    id: string;
    name: string;
    platform: "android_tv" | "fire_tv" | "apple_tv" | "lg_tv" | "samsung_tv" | "roku" | "kodi" | "jellyfin" | "webdav" | "stremio" | "cli" | "ios" | "android" | "putflix_tv" | "putflix_agent";
    createdAt: string; // date-time
    lastSeenAt: string; // date-time
  };
}
```

Errors: `400` Invalid request; `404` Not found; `429` Rate limited.

### GET /v1/devices/pairings/:code

Look up a pairing code before approving it.

Bearer token.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `code` | path | `string` | Required. |

`200` Pairing

```ts
{
  code: string;
  platform: "android_tv" | "fire_tv" | "apple_tv" | "lg_tv" | "samsung_tv" | "roku" | "kodi" | "jellyfin" | "webdav" | "stremio" | "cli" | "ios" | "android" | "putflix_tv" | "putflix_agent";
  expiresAt: string; // date-time
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/devices/pairings/:code/approve

Approve a pairing code.

Signs the device in to this account. Needs a full-access API key or a signed-in session.

Bearer token.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `code` | path | `string` | Required. |

Body (`application/json`, optional):

```ts
{
  deviceName?: string;
}
```

`204` Approved

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/devices

List paired devices.

Bearer token.

`200` Devices

```ts
{
  data: {
    id: string;
    name: string;
    platform: "android_tv" | "fire_tv" | "apple_tv" | "lg_tv" | "samsung_tv" | "roku" | "kodi" | "jellyfin" | "webdav" | "stremio" | "cli" | "ios" | "android" | "putflix_tv" | "putflix_agent";
    createdAt: string; // date-time
    lastSeenAt: string; // date-time
  }[];
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/devices/webdav

Create a WebDAV key.

A key with `files:read` for one WebDAV client, listed and revoked with the devices. The secret is returned only here. Needs a plan with WebDAV.

Bearer token.

Body (`application/json`, optional):

```ts
{
  name?: string;
}
```

`201` Key

```ts
{
  apiKey: string;
  url: string;
  keyUrl: string;
  device: {
    id: string;
    name: string;
    platform: "android_tv" | "fire_tv" | "apple_tv" | "lg_tv" | "samsung_tv" | "roku" | "kodi" | "jellyfin" | "webdav" | "stremio" | "cli" | "ios" | "android" | "putflix_tv" | "putflix_agent";
    createdAt: string; // date-time
    lastSeenAt: string; // date-time
  };
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### POST /v1/devices/stremio

Create a Stremio add-on.

A key with `files:read` for the Stremio library add-on, listed and revoked with the devices. The manifest URL holds the key and is returned only here. Needs a plan with WebDAV.

Bearer token.

Body (`application/json`, optional):

```ts
{
  name?: string;
}
```

`201` Add-on

```ts
{
  manifestUrl: string;
  installUrl: string;
  device: {
    id: string;
    name: string;
    platform: "android_tv" | "fire_tv" | "apple_tv" | "lg_tv" | "samsung_tv" | "roku" | "kodi" | "jellyfin" | "webdav" | "stremio" | "cli" | "ios" | "android" | "putflix_tv" | "putflix_agent";
    createdAt: string; // date-time
    lastSeenAt: string; // date-time
  };
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### DELETE /v1/devices/current

Sign this device out.

For a paired device: revokes the key the request uses.

Bearer token.

`204` Signed out

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### DELETE /v1/devices/:id

Sign a device out.

Revokes the device's API key at once.

Bearer token.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`204` Revoked

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/imports

The files brought from Put.io.

A Put.io switcher's files: each one's state (copying from Put.io, imported, not found, skipped past the quota of the plan after the trial, or failed), resumed files first, then the newest. Empty for anyone who did not switch from Put.io.

Bearer token with `files:read`.

`200` Imported files

```ts
{
  items: {
    id: string;
    putioFileId: number;
    name: string;
    sizeBytes: number;
    state: "copying" | "imported" | "not_found" | "skipped" | "failed";
    progress: number | null;
    fileId: string | null;
    startSeconds: number | null;
    putioCreatedAt: string; // date-time
  }[];
  counts: {
    copying?: number;
    imported?: number;
    not_found?: number;
    skipped?: number;
    failed?: number;
  };
  refused?: {
    name: string;
    reason: string;
    createdAt: string; // date-time
  }[];
}
```

Errors: `401` Missing or invalid token.

### GET /v1/library

Movies and shows in the user's files, newest addition first.

Titles matched to TMDB from the user's video files. Files with no match are only in `/files`. Images are TMDB paths, for `https://image.tmdb.org/t/p/<size><path>`.

Bearer token with `files:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `cursor` | query | `string` |  |
| `limit` | query | `number` | Default `50`. |
| `q` | query | `string` |  |
| `kind` | query | `"movie" \| "show"` |  |
| `tmdbId` | query | `number` |  |

`200` Titles

```ts
{
  data: {
    id: string;
    tmdbId: number;
    kind: "movie" | "show";
    title: string;
    year: number | null;
    overview: string | null;
    posterPath: string | null;
    backdropPath: string | null;
    logoPath: string | null;
    genres: string[];
    voteAverage: number | null;
    runtime: number | null;
    releaseDate: string | null;
    seasonCount: number | null;
    addedAt: string; // date-time
  }[];
  nextCursor: string | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/library/movies/:id

A movie with the user's copies.

Bearer token with `files:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` Movie

```ts
{
  id: string;
  tmdbId: number;
  kind: "movie" | "show";
  title: string;
  year: number | null;
  overview: string | null;
  posterPath: string | null;
  backdropPath: string | null;
  logoPath: string | null;
  genres: string[];
  voteAverage: number | null;
  runtime: number | null;
  releaseDate: string | null;
  seasonCount: number | null;
  addedAt: string; // date-time
  cast: {
    name: string;
    character: string | null;
    profilePath: string | null;
  }[];
  status: string | null;
  lastAirDate: string | null;
  files: {
    id: string;
    name: string;
    sizeBytes: number;
    mimeType: string;
    type: "video" | "audio" | "image" | "subtitle" | "other";
    playable: boolean;
    mediaInfo: {
      container: string;
      durationSeconds: number | null;
      bitRate: number | null;
      video: {
        codec: string;
        profile: string | null;
        width: number;
        height: number;
        pixFmt: string | null;
      } | null;
      audio: {
        codec: string;
        channels: number | null;
        language: string | null;
        title: string | null;
        default: boolean;
      }[];
      subtitles: {
        codec: string;
        language: string | null;
        title: string | null;
        forced: boolean;
        default: boolean;
      }[];
      playable: boolean;
    } | null;
    original?: {
      name: string;
      sizeBytes: number;
      mimeType: string;
      mediaInfo: {
        container: string;
        durationSeconds: number | null;
        bitRate: number | null;
        video: {
          codec: string;
          profile: string | null;
          width: number;
          height: number;
          pixFmt: string | null;
        } | null;
        audio: {
          codec: string;
          channels: number | null;
          language: string | null;
          title: string | null;
          default: boolean;
        }[];
        subtitles: {
          codec: string;
          language: string | null;
          title: string | null;
          forced: boolean;
          default: boolean;
        }[];
        playable: boolean;
      } | null;
    } | null;
    subtitleCount: number;
    transferId: string;
    folder?: string | null;
    progress: {
      fileId: string;
      positionSeconds: number;
      durationSeconds: number;
      completed: boolean;
      clientId: string | null;
      updatedAt: string; // date-time
    } | null;
    expiresAt: string | null; // date-time
    kept?: "self" | "folder" | null;
    clearedAt?: string | null; // date-time
    media?: {
      titleId: string;
      kind: "movie" | "show";
      title: string;
      year: number | null;
      season: number | null;
      episode: number | null;
      episodeName: string | null;
      stillPath: string | null;
      posterPath: string | null;
      backdropPath: string | null;
      logoPath: string | null;
    } | null;
    clutter?: boolean;
    thumbnailUrl?: string | null;
    markers?: {
      intro: {
        startSeconds: number;
        endSeconds: number;
      } | null;
      credits: {
        startSeconds: number;
      } | null;
    } | null;
    createdAt: string; // date-time
    updatedAt: string; // date-time
  }[];
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/library/shows/:id

A show with the user's episodes by season.

Bearer token with `files:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` Show

```ts
{
  id: string;
  tmdbId: number;
  kind: "movie" | "show";
  title: string;
  year: number | null;
  overview: string | null;
  posterPath: string | null;
  backdropPath: string | null;
  logoPath: string | null;
  genres: string[];
  voteAverage: number | null;
  runtime: number | null;
  releaseDate: string | null;
  seasonCount: number | null;
  addedAt: string; // date-time
  cast: {
    name: string;
    character: string | null;
    profilePath: string | null;
  }[];
  status: string | null;
  lastAirDate: string | null;
  seasons: {
    season: number;
    episodes: {
      season: number;
      episode: number;
      name: string | null;
      overview: string | null;
      stillPath: string | null;
      airDate: string | null;
      runtime: number | null;
      files: {
        id: string;
        name: string;
        sizeBytes: number;
        mimeType: string;
        type: "video" | "audio" | "image" | "subtitle" | "other";
        playable: boolean;
        mediaInfo: {
          container: string;
          durationSeconds: number | null;
          bitRate: number | null;
          video: {
            codec: string;
            profile: string | null;
            width: number;
            height: number;
            pixFmt: string | null;
          } | null;
          audio: {
            codec: string;
            channels: number | null;
            language: string | null;
            title: string | null;
            default: boolean;
          }[];
          subtitles: {
            codec: string;
            language: string | null;
            title: string | null;
            forced: boolean;
            default: boolean;
          }[];
          playable: boolean;
        } | null;
        original?: {
          name: string;
          sizeBytes: number;
          mimeType: string;
          mediaInfo: {
            container: string;
            durationSeconds: number | null;
            bitRate: number | null;
            video: {
              codec: string;
              profile: string | null;
              width: number;
              height: number;
              pixFmt: string | null;
            } | null;
            audio: {
              codec: string;
              channels: number | null;
              language: string | null;
              title: string | null;
              default: boolean;
            }[];
            subtitles: {
              codec: string;
              language: string | null;
              title: string | null;
              forced: boolean;
              default: boolean;
            }[];
            playable: boolean;
          } | null;
        } | null;
        subtitleCount: number;
        transferId: string;
        folder?: string | null;
        progress: {
          fileId: string;
          positionSeconds: number;
          durationSeconds: number;
          completed: boolean;
          clientId: string | null;
          updatedAt: string; // date-time
        } | null;
        expiresAt: string | null; // date-time
        kept?: "self" | "folder" | null;
        clearedAt?: string | null; // date-time
        media?: {
          titleId: string;
          kind: "movie" | "show";
          title: string;
          year: number | null;
          season: number | null;
          episode: number | null;
          episodeName: string | null;
          stillPath: string | null;
          posterPath: string | null;
          backdropPath: string | null;
          logoPath: string | null;
        } | null;
        clutter?: boolean;
        thumbnailUrl?: string | null;
        markers?: {
          intro: {
            startSeconds: number;
            endSeconds: number;
          } | null;
          credits: {
            startSeconds: number;
          } | null;
        } | null;
        createdAt: string; // date-time
        updatedAt: string; // date-time
      }[];
    }[];
  }[];
  nextUp: {
    season: number;
    episode: number;
    fileId: string;
    resume: boolean;
  } | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/history

How far the user got in a movie or in each episode of a show.

By TMDB id: the newest position on any copy, kept after the files are deleted, so a title shows the user's progress without a file. A new copy with no position of its own reports this one as its `progress`.

Bearer token with `files:read`.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `kind` | query | `"movie" \| "show"` | Required. |
| `tmdbId` | query | `number` | Required. |

`200` Positions, oldest episode first

```ts
{
  data: {
    season: number | null;
    episode: number | null;
    positionSeconds: number;
    durationSeconds: number;
    completed: boolean;
    updatedAt: string; // date-time
  }[];
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `429` Rate limited.

### GET /v1/plans

Plans, prices, and limits.

No token needed.

No auth.

`200` Plans

```ts
{
  data: {
    key: "lite" | "standard" | "pro";
    name: string;
    priceCents: number;
    storageQuotaBytes: number;
    maxActiveTransfers: number;
    maxScreens: number;
    fileRetentionDays: number | null;
    webdav: boolean;
    priorityDownloads: boolean;
    maxPeople: number;
  }[];
  trial: {
    days: number;
    plan: "lite" | "standard" | "pro";
    storageQuotaBytes: number;
  } | null;
}
```

### GET /v1/billing

Subscription, plans, and trial eligibility.

Needs a full-access API key or a signed-in session.

Bearer token.

`200` Billing

```ts
{
  subscription: {
    status: string;
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    trialEnd: string | null; // date-time
    periodEnd: string; // date-time
    cancelAtPeriodEnd: boolean;
    nextPlan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    } | null;
    nextPlanAt: string | null; // date-time
    card: {
      brand: string;
      last4: string;
    } | null;
    paymentMethod: {
      type: string;
      brand: string | null;
      last4: string | null;
      email: string | null;
    } | null;
    nextChargeCents: number | null;
    needsPaymentMethod: boolean;
    paymentActionUrl: string | null;
  } | null;
  plans: {
    key: "lite" | "standard" | "pro";
    name: string;
    priceCents: number;
    storageQuotaBytes: number;
    maxActiveTransfers: number;
    maxScreens: number;
    fileRetentionDays: number | null;
    webdav: boolean;
    priorityDownloads: boolean;
    maxPeople: number;
  }[];
  gift: {
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    since: string; // date-time
  } | null;
  prepaid: {
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    until: string; // date-time
  } | null;
  crypto: boolean;
  trial: {
    days: number;
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    storageQuotaBytes: number;
  } | null;
  referred: boolean;
  collectsTax: boolean;
  storedBytes: number;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found, or billing is not configured; `409` Not possible in the current state; `429` Rate limited.

### POST /v1/billing/checkout

Start checkout.

Returns a Checkout Session client secret for Stripe Elements. With a trial, the trial is on Standard and `plan` applies after it.

Bearer token.

Body (`application/json`, optional):

```ts
{
  plan: "lite" | "standard" | "pro";
}
```

`200` Checkout

```ts
{
  clientSecret: string;
  plan: {
    key: "lite" | "standard" | "pro";
    name: string;
    priceCents: number;
    storageQuotaBytes: number;
    maxActiveTransfers: number;
    maxScreens: number;
    fileRetentionDays: number | null;
    webdav: boolean;
    priorityDownloads: boolean;
    maxPeople: number;
  };
  trialPlan: {
    key: "lite" | "standard" | "pro";
    name: string;
    priceCents: number;
    storageQuotaBytes: number;
    maxActiveTransfers: number;
    maxScreens: number;
    fileRetentionDays: number | null;
    webdav: boolean;
    priorityDownloads: boolean;
    maxPeople: number;
  } | null;
  trialEnd: string | null; // date-time
  firstChargeAt: string; // date-time
  firstChargeCents: number;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found, or billing is not configured; `409` Not possible in the current state; `429` Rate limited.

### POST /v1/billing/sync

Read the subscription from Stripe now.

Needs a full-access API key or a signed-in session.

Bearer token.

`200` Billing

```ts
{
  subscription: {
    status: string;
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    trialEnd: string | null; // date-time
    periodEnd: string; // date-time
    cancelAtPeriodEnd: boolean;
    nextPlan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    } | null;
    nextPlanAt: string | null; // date-time
    card: {
      brand: string;
      last4: string;
    } | null;
    paymentMethod: {
      type: string;
      brand: string | null;
      last4: string | null;
      email: string | null;
    } | null;
    nextChargeCents: number | null;
    needsPaymentMethod: boolean;
    paymentActionUrl: string | null;
  } | null;
  plans: {
    key: "lite" | "standard" | "pro";
    name: string;
    priceCents: number;
    storageQuotaBytes: number;
    maxActiveTransfers: number;
    maxScreens: number;
    fileRetentionDays: number | null;
    webdav: boolean;
    priorityDownloads: boolean;
    maxPeople: number;
  }[];
  gift: {
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    since: string; // date-time
  } | null;
  prepaid: {
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    until: string; // date-time
  } | null;
  crypto: boolean;
  trial: {
    days: number;
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    storageQuotaBytes: number;
  } | null;
  referred: boolean;
  collectsTax: boolean;
  storedBytes: number;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found, or billing is not configured; `409` Not possible in the current state; `429` Rate limited.

### POST /v1/billing/plan

Change plan.

During a trial the plan applies at the trial end. An upgrade applies at once with proration; a downgrade at the next period, if the files fit.

Bearer token.

Body (`application/json`, optional):

```ts
{
  plan: "lite" | "standard" | "pro";
}
```

`200` Plan change

```ts
{
  billing: {
    subscription: {
      status: string;
      plan: {
        key: "lite" | "standard" | "pro";
        name: string;
        priceCents: number;
        storageQuotaBytes: number;
        maxActiveTransfers: number;
        maxScreens: number;
        fileRetentionDays: number | null;
        webdav: boolean;
        priorityDownloads: boolean;
        maxPeople: number;
      };
      trialEnd: string | null; // date-time
      periodEnd: string; // date-time
      cancelAtPeriodEnd: boolean;
      nextPlan: {
        key: "lite" | "standard" | "pro";
        name: string;
        priceCents: number;
        storageQuotaBytes: number;
        maxActiveTransfers: number;
        maxScreens: number;
        fileRetentionDays: number | null;
        webdav: boolean;
        priorityDownloads: boolean;
        maxPeople: number;
      } | null;
      nextPlanAt: string | null; // date-time
      card: {
        brand: string;
        last4: string;
      } | null;
      paymentMethod: {
        type: string;
        brand: string | null;
        last4: string | null;
        email: string | null;
      } | null;
      nextChargeCents: number | null;
      needsPaymentMethod: boolean;
      paymentActionUrl: string | null;
    } | null;
    plans: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    }[];
    gift: {
      plan: {
        key: "lite" | "standard" | "pro";
        name: string;
        priceCents: number;
        storageQuotaBytes: number;
        maxActiveTransfers: number;
        maxScreens: number;
        fileRetentionDays: number | null;
        webdav: boolean;
        priorityDownloads: boolean;
        maxPeople: number;
      };
      since: string; // date-time
    } | null;
    prepaid: {
      plan: {
        key: "lite" | "standard" | "pro";
        name: string;
        priceCents: number;
        storageQuotaBytes: number;
        maxActiveTransfers: number;
        maxScreens: number;
        fileRetentionDays: number | null;
        webdav: boolean;
        priorityDownloads: boolean;
        maxPeople: number;
      };
      until: string; // date-time
    } | null;
    crypto: boolean;
    trial: {
      days: number;
      plan: {
        key: "lite" | "standard" | "pro";
        name: string;
        priceCents: number;
        storageQuotaBytes: number;
        maxActiveTransfers: number;
        maxScreens: number;
        fileRetentionDays: number | null;
        webdav: boolean;
        priorityDownloads: boolean;
        maxPeople: number;
      };
      storageQuotaBytes: number;
    } | null;
    referred: boolean;
    collectsTax: boolean;
    storedBytes: number;
  };
  paymentClientSecret: string | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found, or billing is not configured; `409` Not possible in the current state; `429` Rate limited.

### POST /v1/billing/cancel

Cancel at the end of the period.

Needs a full-access API key or a signed-in session.

Bearer token.

`200` Billing

```ts
{
  subscription: {
    status: string;
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    trialEnd: string | null; // date-time
    periodEnd: string; // date-time
    cancelAtPeriodEnd: boolean;
    nextPlan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    } | null;
    nextPlanAt: string | null; // date-time
    card: {
      brand: string;
      last4: string;
    } | null;
    paymentMethod: {
      type: string;
      brand: string | null;
      last4: string | null;
      email: string | null;
    } | null;
    nextChargeCents: number | null;
    needsPaymentMethod: boolean;
    paymentActionUrl: string | null;
  } | null;
  plans: {
    key: "lite" | "standard" | "pro";
    name: string;
    priceCents: number;
    storageQuotaBytes: number;
    maxActiveTransfers: number;
    maxScreens: number;
    fileRetentionDays: number | null;
    webdav: boolean;
    priorityDownloads: boolean;
    maxPeople: number;
  }[];
  gift: {
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    since: string; // date-time
  } | null;
  prepaid: {
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    until: string; // date-time
  } | null;
  crypto: boolean;
  trial: {
    days: number;
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    storageQuotaBytes: number;
  } | null;
  referred: boolean;
  collectsTax: boolean;
  storedBytes: number;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found, or billing is not configured; `409` Not possible in the current state; `429` Rate limited.

### POST /v1/billing/resume

Undo a cancel.

Needs a full-access API key or a signed-in session.

Bearer token.

`200` Billing

```ts
{
  subscription: {
    status: string;
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    trialEnd: string | null; // date-time
    periodEnd: string; // date-time
    cancelAtPeriodEnd: boolean;
    nextPlan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    } | null;
    nextPlanAt: string | null; // date-time
    card: {
      brand: string;
      last4: string;
    } | null;
    paymentMethod: {
      type: string;
      brand: string | null;
      last4: string | null;
      email: string | null;
    } | null;
    nextChargeCents: number | null;
    needsPaymentMethod: boolean;
    paymentActionUrl: string | null;
  } | null;
  plans: {
    key: "lite" | "standard" | "pro";
    name: string;
    priceCents: number;
    storageQuotaBytes: number;
    maxActiveTransfers: number;
    maxScreens: number;
    fileRetentionDays: number | null;
    webdav: boolean;
    priorityDownloads: boolean;
    maxPeople: number;
  }[];
  gift: {
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    since: string; // date-time
  } | null;
  prepaid: {
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    until: string; // date-time
  } | null;
  crypto: boolean;
  trial: {
    days: number;
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    storageQuotaBytes: number;
  } | null;
  referred: boolean;
  collectsTax: boolean;
  storedBytes: number;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found, or billing is not configured; `409` Not possible in the current state; `429` Rate limited.

### POST /v1/billing/card

Start a card update.

Needs a full-access API key or a signed-in session.

Bearer token.

`200` Card setup

```ts
{
  clientSecret: string;
  sessionId: string;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found, or billing is not configured; `409` Not possible in the current state; `429` Rate limited.

### POST /v1/billing/card/complete

Use the confirmed card for future charges.

Needs a full-access API key or a signed-in session.

Bearer token.

Body (`application/json`, optional):

```ts
{
  sessionId: string;
}
```

`200` Billing

```ts
{
  subscription: {
    status: string;
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    trialEnd: string | null; // date-time
    periodEnd: string; // date-time
    cancelAtPeriodEnd: boolean;
    nextPlan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    } | null;
    nextPlanAt: string | null; // date-time
    card: {
      brand: string;
      last4: string;
    } | null;
    paymentMethod: {
      type: string;
      brand: string | null;
      last4: string | null;
      email: string | null;
    } | null;
    nextChargeCents: number | null;
    needsPaymentMethod: boolean;
    paymentActionUrl: string | null;
  } | null;
  plans: {
    key: "lite" | "standard" | "pro";
    name: string;
    priceCents: number;
    storageQuotaBytes: number;
    maxActiveTransfers: number;
    maxScreens: number;
    fileRetentionDays: number | null;
    webdav: boolean;
    priorityDownloads: boolean;
    maxPeople: number;
  }[];
  gift: {
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    since: string; // date-time
  } | null;
  prepaid: {
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    until: string; // date-time
  } | null;
  crypto: boolean;
  trial: {
    days: number;
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    storageQuotaBytes: number;
  } | null;
  referred: boolean;
  collectsTax: boolean;
  storedBytes: number;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found, or billing is not configured; `409` Not possible in the current state; `429` Rate limited.

### GET /v1/billing/invoices

Invoices, newest first.

Needs a full-access API key or a signed-in session.

Bearer token.

`200` Invoices

```ts
{
  invoices: {
    id: string;
    number: string | null;
    createdAt: string; // date-time
    totalCents: number;
    status: string;
    hostedUrl: string | null;
    pdfUrl: string | null;
  }[];
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found, or billing is not configured; `409` Not possible in the current state; `429` Rate limited.

### GET /v1/billing/crypto

Bitcoin payments that went through, newest first.

Needs a full-access API key or a signed-in session.

Bearer token.

`200` Payments

```ts
{
  payments: {
    id: string;
    status: "pending" | "processing" | "paid" | "underpaid" | "expired" | "refunded";
    plan: {
      key: "lite" | "standard" | "pro";
      name: string;
      priceCents: number;
      storageQuotaBytes: number;
      maxActiveTransfers: number;
      maxScreens: number;
      fileRetentionDays: number | null;
      webdav: boolean;
      priorityDownloads: boolean;
      maxPeople: number;
    };
    months: number;
    amountCents: number;
    createdAt: string; // date-time
    paidAt: string | null; // date-time
    prepaidUntil: string | null; // date-time
    checkoutUrl: string | null;
  }[];
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found, or billing is not configured; `409` Not possible in the current state; `429` Rate limited.

### POST /v1/billing/crypto

Buy prepaid time with Bitcoin.

Starts a one-time Bitcoin payment (on-chain or Lightning) for `months` of `plan`, at the plan's monthly price times the months. Send the user to `checkoutUrl` to pay. Once paid, the time is added to any prepaid time left, and nothing renews. A card subscription the account has ends then, with its unused part refunded. Needs a full-access API key or a signed-in session.

Bearer token.

Body (`application/json`, optional):

```ts
{
  plan: "lite" | "standard" | "pro";
  months: 1 | 3 | 6 | 12;
}
```

`200` The payment, with its checkout page

```ts
{
  id: string;
  status: "pending" | "processing" | "paid" | "underpaid" | "expired" | "refunded";
  plan: {
    key: "lite" | "standard" | "pro";
    name: string;
    priceCents: number;
    storageQuotaBytes: number;
    maxActiveTransfers: number;
    maxScreens: number;
    fileRetentionDays: number | null;
    webdav: boolean;
    priorityDownloads: boolean;
    maxPeople: number;
  };
  months: number;
  amountCents: number;
  createdAt: string; // date-time
  paidAt: string | null; // date-time
  prepaidUntil: string | null; // date-time
  checkoutUrl: string | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found, or billing is not configured; `409` Not possible in the current state; `429` Rate limited.

### GET /v1/billing/crypto/:id

A Bitcoin payment.

The payment's status, read again from the payment processor while it is open. Poll it after the user comes back from the checkout page. Needs a full-access API key or a signed-in session.

Bearer token.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`200` The payment

```ts
{
  id: string;
  status: "pending" | "processing" | "paid" | "underpaid" | "expired" | "refunded";
  plan: {
    key: "lite" | "standard" | "pro";
    name: string;
    priceCents: number;
    storageQuotaBytes: number;
    maxActiveTransfers: number;
    maxScreens: number;
    fileRetentionDays: number | null;
    webdav: boolean;
    priorityDownloads: boolean;
    maxPeople: number;
  };
  months: number;
  amountCents: number;
  createdAt: string; // date-time
  paidAt: string | null; // date-time
  prepaidUntil: string | null; // date-time
  checkoutUrl: string | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `402` No active subscription; `403` Not allowed; `404` Not found, or billing is not configured; `409` Not possible in the current state; `429` Rate limited.

### GET /v1/household

Your household.

Pro is shared by up to 6 people, each with their own account and files. The owner pays and manages the household; the storage and screens are pooled. Needs a full-access API key or a signed-in session.

Bearer token.

`200` Household

```ts
{
  role: "owner" | "member";
  owner: {
    email: string | null;
  };
  maxPeople: number;
  people: {
    id: string;
    email: string | null;
    role: "owner" | "member";
    you: boolean;
    joinedAt: string; // date-time
    storedBytes: number | null;
    storageLimitBytes: number | null;
  }[];
  invites: {
    id: string;
    email: string | null;
    createdAt: string; // date-time
    expiresAt: string; // date-time
  }[];
  storage: {
    usedBytes: number;
    quotaBytes: number;
  };
  inviteBlocked: string | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `409` Not possible in the current state; `429` Rate limited.

### POST /v1/household/invites

Invite someone.

Owner only. Returns a single-use link that expires in 14 days, and emails it to `email` when given. Needs a full-access API key or a signed-in session.

Bearer token.

Body (`application/json`, optional):

```ts
{
  email?: string; // email
}
```

`201` Invite

```ts
{
  invite: {
    id: string;
    email: string | null;
    createdAt: string; // date-time
    expiresAt: string; // date-time
  };
  url: string;
  emailed: boolean;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `409` Not possible in the current state; `429` Rate limited.

### DELETE /v1/household/invites/:id

Withdraw an invite.

Needs a full-access API key or a signed-in session.

Bearer token.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`204` Withdrawn

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `409` Not possible in the current state; `429` Rate limited.

### PATCH /v1/household/members/:id

Limit a member's storage.

Owner only. `null` lets the member use the whole plan. Needs a full-access API key or a signed-in session.

Bearer token.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

Body (`application/json`, optional):

```ts
{
  storageLimitBytes: number | null;
}
```

`200` Household

```ts
{
  role: "owner" | "member";
  owner: {
    email: string | null;
  };
  maxPeople: number;
  people: {
    id: string;
    email: string | null;
    role: "owner" | "member";
    you: boolean;
    joinedAt: string; // date-time
    storedBytes: number | null;
    storageLimitBytes: number | null;
  }[];
  invites: {
    id: string;
    email: string | null;
    createdAt: string; // date-time
    expiresAt: string; // date-time
  }[];
  storage: {
    usedBytes: number;
    quotaBytes: number;
  };
  inviteBlocked: string | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `409` Not possible in the current state; `429` Rate limited.

### DELETE /v1/household/members/:id

Remove a member.

Owner only. The member keeps their account, and their files stay for the lapse grace period unless they choose a plan. Needs a full-access API key or a signed-in session.

Bearer token.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `id` | path | `string` | Required. |

`204` Removed

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `409` Not possible in the current state; `429` Rate limited.

### POST /v1/household/leave

Leave the household.

Members only. Your files stay for the lapse grace period unless you choose a plan. Needs a full-access API key or a signed-in session.

Bearer token.

`204` Left

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `409` Not possible in the current state; `429` Rate limited.

### GET /v1/household/join/:token

Preview an invite.

What joining does: whose plan, whether your files fit, and the plan of yours it ends. Needs a full-access API key or a signed-in session.

Bearer token.

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `token` | path | `string` | Required. |

`200` Preview

```ts
{
  owner: {
    email: string | null;
  };
  planName: string | null;
  people: number;
  maxPeople: number;
  problem: string | null;
  ownPlan: {
    name: string;
    trialing: boolean;
    refundCents: number;
  } | null;
  storedBytes: number;
  freeBytes: number;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `409` Not possible in the current state; `429` Rate limited.

### POST /v1/household/join

Join a household.

Ends your own plan: a trial at once, a paid plan at once with the unused part refunded. Needs a full-access API key or a signed-in session.

Bearer token.

Body (`application/json`, optional):

```ts
{
  token: string;
}
```

`200` Household

```ts
{
  role: "owner" | "member";
  owner: {
    email: string | null;
  };
  maxPeople: number;
  people: {
    id: string;
    email: string | null;
    role: "owner" | "member";
    you: boolean;
    joinedAt: string; // date-time
    storedBytes: number | null;
    storageLimitBytes: number | null;
  }[];
  invites: {
    id: string;
    email: string | null;
    createdAt: string; // date-time
    expiresAt: string; // date-time
  }[];
  storage: {
    usedBytes: number;
    quotaBytes: number;
  };
  inviteBlocked: string | null;
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `404` Not found; `409` Not possible in the current state; `429` Rate limited.

### GET /v1/referrals

Your invite link and the friends who used it.

Give a month, get a month: a friend who signs up through the link gets a month-long free trial, and when they first pay, you get a month of your plan as credit on your next bill. `url` is null for a household member, whose owner pays.

Bearer token.

`200` Referrals

```ts
{
  url: string | null;
  friendTrialDays: number;
  earnedCents: number;
  friends: {
    id: string;
    email: string | null;
    status: "waiting" | "earned" | "not_counted";
    creditCents: number | null;
    joinedAt: string; // date-time
  }[];
}
```

Errors: `400` Invalid request; `401` Missing or invalid token; `403` Not allowed; `429` Rate limited.
