Update information for an existing file
import { PinataSDK } from "pinata"; const pinata = new PinataSDK({ pinataJwt: process.env.PINATA_JWT!, pinataGateway: "example.mypinata.cloud", }); const update = await pinata.files.update({ id: "52681e41-86f4-407b-8f79-33a7e7e5df68", name: "New File Name", })
type FileListItem = { id: string; name: string | null; cid: "pending" | string; size: number; numberOfFiles: number; mimeType: string; groupId: string; updatedAt: string; createdAt: string; };
string
ID of the target file to update
const update = await pinata.files.update({ id: "8809812b-cd36-499f-b9b3-a37258a9cd6a", name: "New File Name", })
Update the name of a file
const update = await pinata.files.update({ id: "8809812b-cd36-499f-b9b3-a37258a9cd6a", name: "New File Name" })