Developer Questions 
Title: 401 Unauthorized Error When Uploading to Infura’s IPFS API via MetaMask-Linked Account
Description:
I’m experiencing a 401 Unauthorized
error when attempting to upload documents to Infura’s IPFS API (https://ipfs.infura.io:5001/api/v0/add
) using my JavaScript code and curl
commands. I’ve provided my Infura credentials (project ID and secret) obtained from my Infura dashboard, but the requests fail with a 401
status code. Here are the details:
- Request URL:
https://ipfs.infura.io:5001/api/v0/add?stream-channels=true&progress=false
- Request Method:
POST
- Status Code:
401 Unauthorized
- Remote Address:
52.5.117.114:5001
- Account Context: I’m redirected to the MetaMask Developer Dashboard (
app.infura.io
) when trying to log in to Infura, suggesting a possible linkage between my Infura and MetaMask accounts (email:ngs.naeemshraf@gmail.com
).
I’ve tried:
- Using
curl -X POST -u "<project_id>:<project_secret>" "https://ipfs.infura.io:5001/api/v0/add?stream-channels=true&progress=false" -F file=@your-document.pdf
, but it still returns401
. - Updating my JavaScript code with
ipfs-http-client
to include the credentials, but the error persists.
I suspect the issue might be related to:
- Incorrect or expired Infura credentials.
- Account linkage or restrictions due to my MetaMask/Infura integration.
- Free tier limits or configuration issues in my Infura project.
Pro Tips Used:
- I searched the MetaMask and Infura communities but couldn’t find a specific solution for this
401
error with MetaMask-linked Infura accounts. - I reviewed the MetaMask Help Center and Infura documentation, but the issue persists.
- This topic focuses on a single issue (the
401
error) to help others respond quickly.
Common Terms Used: IPFS, Infura, MetaMask, 401 Unauthorized, API, authentication.
Request for Help:
Can anyone clarify why I’m getting a 401 Unauthorized
error with my Infura IPFS API requests, especially given the redirection to the MetaMask Developer Dashboard? How can I verify or fix my credentials, and is there a known issue with MetaMask-linked Infura accounts affecting IPFS uploads?