> ## Documentation Index
> Fetch the complete documentation index at: https://figranium.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CabinetsResource: Manage Download Queues

> Manage Figranium Cabinets with the JavaScript SDK: list, create, rename, clear, delete, update item status, ZIP/unzip, and build download URLs.

# CabinetsResource

`figranium.cabinets` is the SDK's typed client for the Cabinets API.

Cabinets are durable, installation-wide download queues. Tasks can route intercepted downloads into a selected Cabinet, and later actions can upload the newest unuploaded item from that queue.

## Access the resource

```ts theme={null}
import { Figranium } from "@figranium/sdk";

const figranium = new Figranium({
  apiKey: process.env.FIGRANIUM_API_KEY!,
});

const cabinets = await figranium.cabinets.list();
```

## Supported operations

`CabinetsResource` covers the Cabinet lifecycle and item-management API.

<CardGroup cols={2}>
  <Card title="Cabinet lifecycle" icon="folder-plus">
    List, create, rename, migrate, clear, and delete Cabinets.
  </Card>

  <Card title="Item management" icon="list-check">
    List Cabinet items, update upload status, and remove one or many items.
  </Card>

  <Card title="Archives" icon="file-zipper">
    Create ZIP archives and safely extract compatible archives.
  </Card>

  <Card title="Downloads" icon="download">
    Build item download URLs for files stored in a Cabinet.
  </Card>
</CardGroup>

<Info>
  The exact return types are exported by `@figranium/sdk`, so TypeScript consumers get typed Cabinet metadata and item records.
</Info>

## Use a Cabinet from a task

Tasks can set `cabinetId` to select where intercepted browser downloads are stored:

```ts theme={null}
import { actions, type Task } from "@figranium/sdk";

const task: Task = {
  name: "Download and reuse file",
  url: "https://example.com/export",
  mode: "agent",
  cabinetId: "cab_basic",
  actions: [
    actions.click("#download"),
    actions.upload({ selector: "input[type=file]" }),
    actions.finalizeUploads(),
  ],
};
```

If a task omits `cabinetId`, Figranium uses the instance's default Cabinet. An individual Upload action can override the task-level selection with its own `cabinetId`.

## Upload status

Cabinet items track whether they have been uploaded. The `upload` action normally selects the newest unuploaded item. You can mark an item uploaded immediately with `markAsUploaded`, or keep finalization separate and call `finalize_uploads` later in the workflow.

<Tip>
  Keep finalization separate when attaching a file and successfully submitting it are two different steps. That lets the workflow consume the Cabinet item only after the later step succeeds.
</Tip>

## Related

<CardGroup cols={3}>
  <Card title="Action helpers" icon="code" href="/docs/sdk/js/actions">
    Build typed Upload and Finalize Uploads actions.
  </Card>

  <Card title="Tasks resource" icon="list-check" href="/docs/sdk/js/resources/tasks">
    Save and run tasks that select a Cabinet with `cabinetId`.
  </Card>

  <Card title="File downloads" icon="download" href="/docs/file-downloads">
    Understand Cabinets, intercepted downloads, and the upload lifecycle.
  </Card>
</CardGroup>
