POST
/
pinning
/
pinFileToIPFS
curl --request POST \
  --url https://api.pinata.cloud/pinning/pinFileToIPFS \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file=readstream \
  --form 'pinataMetadata={
  "name": "Pinnie.json"
}' \
  --form 'pinataOptions={
  "cidVersion": 1
}'
{
  "IpfsHash": "<string>",
  "PinSize": 123,
  "Timestamp": "<string>",
  "isDuplicate": true
}

Guides

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
file
file
required
pinataMetadata
object

Optional stringified object

pinataOptions
object

Optional stringified object

Response

200 - application/json
{ "IpfsHash": "This is the IPFS multi-hash (CID) provided back for your content," "PinSize": "This is how large (in bytes) the content you just pinned is," "Timestamp": "This is the timestamp for your content pinning (represented in ISO 8601 format)" }
IpfsHash
string
PinSize
integer
Timestamp
string
isDuplicate
boolean