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

# Files

> Upload files for tasks and agents to use.

Upload a file to Skyvern storage and pass the returned URL to a task or agent.

Every method here also accepts `request_options` (Python) or a final `requestOptions` argument (TypeScript) to override the timeout, retries or headers for one call; see [request options](/docs/sdk-reference/overview#request-options).

***

## upload\_file

Upload a file

<Warning>
  The `upload_file` method in the current Python and TypeScript SDKs does not send the file's contents: it posts `file` as a text field, and the API rejects the request with a 422 error. Until the SDKs are fixed, call the REST endpoint directly with a multipart upload:

  <CodeGroup>
    ```bash curl theme={null}
    curl -X POST https://api.skyvern.com/v1/upload_file \
      -H "x-api-key: $SKYVERN_API_KEY" \
      -F file=@invoice.pdf
    ```

    ```python Python theme={null}
    import httpx

    with open("invoice.pdf", "rb") as f:
        response = httpx.post(
            "https://api.skyvern.com/v1/upload_file",
            headers={"x-api-key": "YOUR_API_KEY"},
            files={"file": ("invoice.pdf", f)},
        )
    response.raise_for_status()
    print(response.json())
    ```
  </CodeGroup>
</Warning>

<CodeGroup>
  ```python Python theme={null}
  await skyvern.upload_file(*, file: str) -> UploadFileResponse
  ```

  ```typescript TypeScript theme={null}
  skyvern.uploadFile(request: BodyUploadFileV1UploadFilePost): Promise<UploadFileResponse>
  ```
</CodeGroup>

**Parameters**

| Parameter | TypeScript | Type | Required | Default | Description |
| - | - | - | - | - | - |
| `file` | `file` | `str` | Yes | — | |

**Returns** `UploadFileResponse` · TypeScript `Promise<UploadFileResponse>`

<Accordion title="UploadFileResponse fields">
  | Field | Type | Description |
  | - | - | - |
  | `s3uri` | `str` | S3 URI where the file was uploaded |
  | `presigned_url` | `str` | Presigned URL to access the uploaded file |
</Accordion>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.