This article summarizes the pitfalls and solutions when using the group feature with Pinata’s Files API v3.

Background

There are cases where you want to manage files uploaded to Pinata by groups and retrieve only files belonging to a specific group. For example, storing input images used in an NFT registration form in an “input” group and allowing image selection only from that group.

Pitfalls

1. Legacy API and V3 API File Management Are Separate

Problem: Files uploaded with the legacy API (pinFileToIPFS) cannot be retrieved with the V3 API (/v3/files). The reverse is also true.

LVe3gaAcPyIAPIv3(/pfiinlLeiss)t)OnOlnylyshsohwoswsfiflielsesupulpolaodaeddedvivaialeVg3acy

Solution: Unify on one API. When migrating to V3 API, use V3 for new uploads and consider manually adding existing files to groups or performing a migration.

2. V3 API Endpoints Require the {network} Parameter

Problem: V3 API endpoints require the {network} parameter (public or private).

GGEETTv33//ffiilleess?/gpruobulpi=c{?ggrroouupp_=i{dg}roup_id}

Solution: Use public for regular IPFS files.

3. Group Filter Parameter Names Differ

Problem: Parameter names differ between upload and list retrieval.

OperationParameter Name
Uploadgroup_id
List Retrievalgroup

4. Authentication Differences by JWT Type

Problem: JWTs generated with Scoped Keys may not work with the V3 API.

Solution: Generate a new API Key with Admin permissions from the Pinata dashboard.

Implementation Examples

Environment Variables

#P#PIIPNGNiArAnToTaAuAt_p_aJIWINJTDPW=UTe(Tyc_(JhGAheRdbcOmGkUicPnii_OnIpiDeJP=rIibmUn6iza5sIt4s1a3iN3oid7nIa2sss-.hdr.bae.odcador-md4m)8e2ndd-e9d4)09-98e9c2e079ff

Upload API (V3)

ice}moxpnpcccppppc)cr}aosooooiiiio;oe)prtrnnnnnnnn"{}ntsi;pttsssaaaashsuup/Itttttttttmh}btrcfa{Naaaaatee,oncspPsffpFFFFrptaAddeHiNUyoiiooooeshduyaNsa/eTnrlnrrrrs:oet:tesspx_cmeammmmpdrhax:hitGDtDDDD/:sopt:nRRfa=aaaaanu:ri=RtaeOutFttttsp"inerdtqUnafoaaaaelP{zaasuaauPcor....oOatwpet/e_t=rmaaaa=aStaao,ausIimDppppdTiFin.ptDoaDappppas"ootsdl,nwateeeew.,nreao=atannnnap:mr.taNPiaddddiiDejadepOt.=((((tn`ass./xrSg""""aBtpocrtoTrenfnngfteaonioRc(eteiaereaa,n(dueerq(wlmtot.rs{,tsseu"eewucceeepsqefF""ophlr..o.usio,,r_(ojtneetlrkiu$sssns.emff"dd{oevtf"Dii,"/pnI.:o)all,vr(n}Prtee"3o)INmaa).pI/c;VfNeDs(;nuNfe3rAxa)abPis,oTttF;mlUlsmARaieiTe.i_e(l)c_set"Iq)e;"G"n'nNu;;)R,vsePe;O.xUsUPdtTtPIa/_)_NtsGIAaeR{DVT.rO)3AdvU;_aePuJtr_pWa"IlT.;Do}c;RAa`iedd,dqdueitnrodepdgorionutp

List Retrieval API (V3)

ice}moxpnpccuuc}ccr}aosooorro)ooe)prtrnnllnmh};nntsi};pttsVs..see,sVsuum)/It3tssttaAt3trcainds)a{Naeehduncgpaai,pPsleuaaroetdrfeefmtziNUyinrrredrhaeiNssseee/eTnmdlccs:sotsles:H:P:px_ciphhp:rapex:aiitGto=PPo"iostfsfnfnRRfiaanG{z=nRtihiniaeOu=nnrrsEas=erl:leltqUnteaaeTtaesueedeauPcrwmm"iwdpesf.:./e_tess=,oasao,.inslsIiq/U..nittnmlafiitDoupRssa:trasaemizs,neuLeewu.ep.elet=sb(tta`rcd.(c,e,/NGtl"((iBetaj(i.repE.ih""tesutsfdcoxrTnctglapraoi,ruto(etrifroe?nletRcrxipomeen.(eaeeeetssuitrsf{)t.ssqU:ptceietpsurr/""h$.l=dso.ele/,,({je>_nes.qaupssasntsupIlrro(tev:eiiNilon{,.ar.Pm.c(}PNrepUite)IecdiTtos;[fNxh)n_)Ss]rAtPaG;t.;oTRatRremAeraOin_qa.Unv"IumcPg.nNesl_(PePs.oI)IxUtguD,NtT)ed)A/_t/;{TsG{(vAeR"3_rOl/JvUifWePmiTr_il"}"Iteg`;D"sr,;)/opuupb"l,"i5cn0"o")t;;"group_id"

V3 API Endpoint List

OperationMethodEndpoint
File UploadPOSThttps://uploads.pinata.cloud/v3/files
File ListGEThttps://api.pinata.cloud/v3/files/{network}
Create GroupPOSThttps://api.pinata.cloud/v3/groups/{network}
Add File to GroupPUThttps://api.pinata.cloud/v3/groups/{network}/{group_id}/ids/{file_id}

How to Find the Group ID

When you select a group in the Pinata dashboard, the group ID is displayed in the URL:

https://app.pinata.cloud/ipfs/groups/b6T5h4i3s37i2s-dtahded-g4r8o2udp-9I4D09-98e9c2e079ff

Alternatively, when retrieving files via the V3 API, you can find it in the group_id field of each file:

{}"}da"]tfai{}"l:e""""sincg{"dair:"mdo:e"u[":p":_0"i1"bd9ea"bxf:5ayfmb"8peb0li6-e.5c..42j.39p"38g,7-"27,-dd6afd-d9-f4f802-d5-89b420e91-69b8fec93c82"e,079ff"

Debugging Tips

  1. First retrieve the list without a group filter: Confirm that files exist
  2. Check the group_id in the response: Confirm files belong to the expected group
  3. Check the endpoint URL: Confirm it includes /public or /private

Summary

ItemLegacy APIV3 API
Uploadapi.pinata.cloud/pinning/pinFileToIPFSuploads.pinata.cloud/v3/files
Listapi.pinata.cloud/data/pinListapi.pinata.cloud/v3/files/{network}
Group Parameter (Upload)Nonegroup_id
Group Parameter (List)groupIdgroup
Getting CIDresponse.IpfsHashresponse.data.cid

When migrating to the V3 API, be mindful of these differences during implementation.