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

# Overview

> Upload files to use as case inputs through the File API

## Overview

The File API lets you upload files that your workflows take as inputs (type: `file` or `array_files`). Uploading is a two-step process: request a presigned URL from Opus, then upload the file's binary content directly to that URL.

## Base URL

All API requests should be made to the following base URL:

```text theme={null}
https://operator.opus.com/api/v1/file/
```

## Authentication

The [Get Upload URL](/api-reference/v1-file/get-upload-url) endpoint requires authentication with your Opus API key, sent in the `x-service-key` header.

```text theme={null}
x-service-key: <your_api_key>
```

A request with a missing, invalid, or expired key returns `401`.

<Warning>
  The [Upload File](/api-reference/v1-file/upload-file) step goes to **AWS S3**, not the Opus API — do not include the `x-service-key` header on that request.
</Warning>

<Note>
  Your API key is a unique, secret credential. Store it securely and never expose it in client-side code.
</Note>

## Upload Flow

The typical flow for uploading a file follows these steps:

<Steps>
  <Step title="Get a Presigned URL">
    Request an upload URL using `POST /upload/presigned`, providing the file extension and a target `workspaceId` or `workflowId`. Call it once for **each file** you need to upload.
  </Step>

  <Step title="Upload the File">
    `PUT` the file's raw binary content to the returned `presignedUrl` with the matching `Content-Type` header.
  </Step>

  <Step title="Reference the File">
    Use the `fileUrl` returned by Get Upload URL as the input value in your [Execute Case](/api-reference/v1-case/execute-case) payload.
  </Step>
</Steps>

## Usage Notes

* **Size limit**: Files exceeding **10 MB** are rejected.
* **One URL per file**: Each presigned URL covers a single file — request a new one for every upload.
* **Workspace check**: Every upload is checked against a workspace; provide either `workspaceId` or `workflowId` when requesting the URL.
* **Access scope**: Files are uploaded as **unlisted** by default — tracked by the platform but not shown in the file library. Pass `accessScope: "workspace"` to make them visible there.
* **Supported types**: `.pdf`, `.docx`, `.csv`, `.xls`, `.xlsx`, `.txt`, `.json`, `.html`, `.xml`, `.jpeg`, `.jpg`, `.png` — see [Get Upload URL](/api-reference/v1-file/get-upload-url) for the full table.

## Available Endpoints

<CardGroup cols={2}>
  <Card title="Get Upload URL" icon="link" href="/api-reference/v1-file/get-upload-url">
    Generate a presigned URL for uploading a file
  </Card>

  <Card title="Upload File" icon="cloud-arrow-up" href="/api-reference/v1-file/upload-file">
    Upload your file's binary content to the presigned URL
  </Card>
</CardGroup>
