> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/workflow-builder/apps/box.md).

# Box

To use the Box integration in StackAI, add the Box node to your workflow. You can then select from a wide range of actions to interact with your Box account, such as uploading files, managing folders, sharing documents, and handling metadata. Each action can be configured with specific inputs and settings to match your automation needs.

***

## Establishing a Connection to Box

### Box OAuth2

Selecting the Box OAuth2 allows you to connect directly to your Box user account using StackAI's OAuth app. Sign in to Box and your Box connection will be automatically established.

### Box JSON Web Token

JWT (JSON Web Token) is a secure way for our platform to talk directly to your Box account without requiring a specific person to stay logged in. This type of connection connects directly to a Box service account unique to your organization. To set up this type of connection, visit the [Box Developer Console](https://app.box.com/developers/console).

Select **New App** in the top right corner, then name your app and select JWT.

<figure><img src="/files/9m4TvezDQu6ngM11tyYA" alt=""><figcaption></figcaption></figure>

Under Configuration, make sure you have the following:

* Read all files
* Write all files

If you plan to impersonate a user, additionally add the following scopes:

* App + Enterprise Access
* Make API calls using the as-user header

Then **Generate a Public/Private Keypair**.

Once your new app is configured, save your changes.

Go to the Authorization tab and click **Review and Submit.** Once your app is reviewed, it should be ready to use in StackAI.

#### Establishing a Connection

Under the Configuration tab of your App, go to App Settings and **Download as JSON**. This file will contain everything you need to create a connection.&#x20;

Inside StackAI, create a new connection by selecting **+ New Connection**. Go to Box -> Box (JWT) and fill in the fields with the data in your .json file.

<figure><img src="/files/8pQw51UlFuuhsZGYUCdr" alt=""><figcaption></figcaption></figure>

***

## Most Commonly Used Actions in Box

Below are the most frequently used Box actions in StackAI, along with their input, configuration, and output details:

***

### 1. Upload File

**Description:** Uploads a file to a specified folder in your Box account.

**Inputs:**

* **file** (Required): The file object or path to upload.
* **parent\_folder\_id** (Required): The ID of the destination folder in Box.
* **name** (Optional): The name for the uploaded file.

**Configurations:**

* **connection\_id** (Required): Your Box connection for authentication.

**Outputs:**

* **id**: The unique ID of the uploaded file.
* **name**: The name of the uploaded file.
* **created\_at**: Timestamp of file creation.
* **modified\_at**: Timestamp of last modification.
* **size**: File size in bytes.

**Example:**

```json
{
  "file": "{doc-0}",
  "parent_folder_id": "123456789",
  "name": "report.pdf"
}
```

***

### 2. Download File

**Description:** Downloads a file from Box using its file ID.

**Inputs:**

* **file\_id** (Required): The ID of the file to download.

**Configurations:**

* **connection\_id** (Required): Your Box connection for authentication.

**Outputs:**

* **file\_content**: The binary content of the downloaded file.

**Example:**

```json
{
  "file_id": "987654321"
}
```

***

### 3. Create Folder

**Description:** Creates a new folder in a specified parent folder.

**Inputs:**

* **name** (Required): The name of the new folder.
* **parent\_folder\_id** (Required): The ID of the parent folder.

**Configurations:**

* **connection\_id** (Required): Your Box connection for authentication.

**Outputs:**

* **id**: The unique ID of the new folder.
* **name**: The name of the new folder.

**Example:**

```json
{
  "name": "Project Files",
  "parent_folder_id": "123456789"
}
```

***

### 4. List Folder Items

**Description:** Lists all items (files and folders) within a specified folder.

**Inputs:**

* **folder\_id** (Required): The ID of the folder to list items from.

**Configurations:**

* **connection\_id** (Required): Your Box connection for authentication.

**Outputs:**

* **entries**: Array of items (files/folders) in the folder.
* **total\_count**: Total number of items.

**Example:**

```json
{
  "folder_id": "123456789"
}
```

***

### 5. Share File or Folder (Get Shared Link)

**Description:** Generates a shared link for a file or folder.

**Inputs:**

* **file\_id** or **folder\_id** (Required): The ID of the file or folder to share.
* **access** (Optional): Access level (e.g., "open", "company", "collaborators").

**Configurations:**

* **connection\_id** (Required): Your Box connection for authentication.

**Outputs:**

* **shared\_link**: The generated URL for sharing.

**Example:**

```json
{
  "file_id": "987654321",
  "access": "open"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.stackai.com/workflow-builder/apps/box.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
