ApiKeys
Generate W3IPFS API key
This endpoint is used to programmatically generate W3IPFS API keys. This endpoint can only be called by using an "Admin" key. When generating new keys, specific scopes and limits can be implemented.
Make sure to record the API Secret as they will not be accessible again.
The request body when generating a W3IPFS API key will look like this:
{
"name": "(A name for your new key for easy reference - Required)",
"scopes": {
"admin": boolean,
"data": {
"pin_list": boolean,
"nft_list": boolean
},
"pinning": {
"unpin": boolean,
"pin_by_hash": boolean,
"pin_file_to_ipfs": boolean
},
"pin_nft":{
"unpin_nft": boolean,
"pin_nft_to_ipfs": boolean
}
}
}
Notice the name
is required. When setting the permissions, it is necessary to include all properties and sub-properties unless you are creating an admin key. If you are creating an admin key, the sub-properties can be omitted.
For example, this would be a simplified body for admin key generation:
{
"name": "Admin api key",
"scopes": {
"admin": true
}
}
Headers
Body
Response
curl --location --request POST 'https://api.w3ipfs.storage/api/apiKeys/' \
--header 'Authorization: Bearer JWT' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "test-api-key",
"scopes": {
"admin": true,
"data": {
"pin_list": true,
"nft_list":true
},
"pinning": {
"unpin": true,
"pin_by_hash": true,
"pin_file_to_ipfs": true
},
"pin_nft":{
"unpin_nft": true,
"pin_nft_to_ipfs": true
}
}
}'
List API Keys
This API allows you to retrieve a list of API keys associated with the authenticated user.
Headers
Response
curl --location --request GET 'https://api.w3ipfs.storage/api/apiKeys/list' \
--header 'Authorization: Bearer JWT' \
Delete API Key
This API allows you to delete an API key associated with the authenticated user.
Parameters
Headers
Response
curl --location --request DELETE 'https://api.w3ipfs.storage/api/apiKeys/{ID}' \
--header 'Authorization: Bearer JWT'
Test Authentication
This API allows you to test the authentication and communication with the Web3 IPFS API using the provided pinning API key and secret key.
Headers
Response
curl --location --request GET 'https://api.w3ipfs.storage/api/apiKeys/testAuthentication' \
--header 'pinning_api_key: KEY' \
--header 'pinning_secret_key: SECRET'