Discover how to easily manage your files and collections with the File Management API.
The File Management API offers a range of methods to streamline file management tasks on your platform, such as adding files to your File Manager and creating, updating, or deleting collections. Whether you need to import assets from an external source, set up files for a new editor, or manage collections centrally as an administrator, the File Management API makes it simple and efficient.
This guide will help you get started with adding files and managing collections using the File Management API.
- You have a good understanding of how File Manager and Collections work on your platform. Learn more.
- You have the Collections feature activated on your platform.
- You have uploaded the files you want to add to the File Manager using the Media API. Learn more.
- You have generated an API token with editorial access via the Staffbase Studio. Learn more.
A simple workflow for creating a collection and adding files to it in a nutshell.
- Add a file, that was previously uploaded to the platform via Media API, to the File Manager by sending the
POST
request to/medialibrary/entries/{mediumId}
- Create a collection by sending the
POST
request to/medialibrary/collections
by providing the collection name and who can access and manage it in the request body - Add files to a collection by sending the
POST
request to/medialibrary/collections/{collectionId}/entries
- Optionally, get the list of files added to the collection by sending the
GET
request to/medialibrary/collections/{collectionId}/entries
A simple workflow for managing collections. Most steps are optional and you can use them according to your requirements.
- Get the details of a collection by sending the
GET
request to/medialibrary/collections/{collectionId}
- Update a collection by sending the
PUT
request to/medialibrary/collections/{collectionId}
by providing the collection name and who can access and manage it in the request body - List all the files in a collection by sending the
GET
request to/medialibrary/collections/{collectionId}/entries
and see which files you want to remove or add - Remove files by sending the
POST
request to/medialibrary/collections/{collectionId}/entries/delete
Or
Add files by sending thePOST
request to/medialibrary/collections/{collectionId}/entries
For request and response samples, see the File Management API.