Private Groups
Private Groups allow you to organize your Pinata content through the Pinata App or through the Private IPFS API, giving you a clearer picture of what your files are being used for.
SDK and API
With the Private IPFS SDK, you can create groups, add files to groups, list details about a group, and more! You can also mange groups using the Private IPFS API.
Create a Group
To create a group you can use the create method and passing in the name
you want to give a group.
This will return the Group info
Add or Remove Files from a Group
There are two ways you can add files to a group. The first is to add the file to a group on upload.
Another option is to add files after the fact using the addFiles method.
Removing files can be done the exact same way with the removeFiles method.
Get a Group
To fetch details of an already existing group you can use the get and pass in the groupId
.
This will return the same group info received upon creation.
List All Groups
If you want to get all Groups or filter through them, you can use the list method.
Results can be filtered with the following queries.
name
- Type:
boolean
Filters groups based on the group name
limit
- Type:
number
Limits the number of results
This will return an array of Groups and their respective info:
Updating a Group
You can update the name of a group using either the SDK or the API.
This will return the updated Group info.
Delete a Group
Deleting a Group that has CIDs inside of it will not unpin/delete the files. Please use the delete method to actually delete a file from your account
To delete a Group you can use the delete method and pass in the groupId
.
If successful the endpoint will return an OK
response.