# Source: https://docs.pinata.cloud/sdk/x402/payment-instructions/update.md

# Source: https://docs.pinata.cloud/sdk/groups/public/update.md

# Source: https://docs.pinata.cloud/sdk/groups/private/update.md

# Source: https://docs.pinata.cloud/sdk/files/public/update.md

# Source: https://docs.pinata.cloud/sdk/files/private/update.md

> ## 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.

# update

> `org:files:write`

Update information for an existing file

## Usage

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

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

const update = await pinata.files.private.update({
  id: "52681e41-86f4-407b-8f79-33a7e7e5df68",
  name: "New File Name",
})
```

## Returns

```typescript  theme={null}
type FileListItem = {
	id: string;
	name: string | null;
	cid: "pending" | string;
	size: number;
	numberOfFiles: number;
	mimeType: string;
	groupId: string;
	updatedAt: string;
	createdAt: string;
};
```

## Parameters

### id

* Type: `string`

ID of the target file to update

```typescript {2} theme={null}
const update = await pinata.files.private.update({
  id: "8809812b-cd36-499f-b9b3-a37258a9cd6a",
  name: "New File Name",
})
```

### name (Optional)

* Type: `string`

Update the name of a file

```typescript {3} theme={null}
const update = await pinata.files.private.update({
  id: "8809812b-cd36-499f-b9b3-a37258a9cd6a",
  name: "New File Name"
})
```

### keyvalues (Optional)

* Type: `string`

Update the name of a file

```typescript {3-5} theme={null}
const update = await pinata.files.private.update({
  id: "8809812b-cd36-499f-b9b3-a37258a9cd6a",
  keyvalues: {
    env: "prod"
  }
})
```