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

# limits

> `org:files:read`

Get the upload limits of the account the JWT belongs to, to check an upload before sending it.

> [!NOTE]
>
> Requires `pinata` 2.7.0 or later (`npm i pinata@latest`).

## Usage

```typescript theme={null}
import { PinataSDK } from "pinata";

const pinata = new PinataSDK({
  pinataJwt: process.env.PINATA_JWT!,
  pinataGateway: "example-gateway.mypinata.cloud",
});

const limits = await pinata.upload.limits();
// { folder_max_files: 30000 }
```

## Returns

```typescript theme={null}
type UploadLimits = {
  folder_max_files: number;
};
```

`folder_max_files` is the most files one folder can hold: 30,000 unless your account has its own limit. [folder()](https://docs.pinata.cloud/sdk/upload/public/folder.md#folder-file-limit) checks it for you before uploading a new folder. A new path sent into a folder that holds as many is refused with HTTP 413; a path the folder already has can still be replaced.

A JWT Pinata refuses rejects with an `AuthenticationError`. Any other failure rejects with a `NetworkError`.


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