Manage files
Getting the file’s metadata
To get the details of a file you can use the Get File API endpoint.
You can also use this endpoint to retrieve a new temporary pre-signed URL to download a file if the previous pre-signed URL has already expired.
Listing existing files of a bot
To list all the files of a bot you can use the List Files API endpoint.
Filtering by tags
If you need to filter files by tags, you can just pass the tags
parameter which should be an object with key-value pairs of tags a file must have in order to be returned. Tag filtering works in an “AND” fashion, so only the files that have all the specified tags will be returned.
Pagination
The List Files API endpoint will return by default the 20 most recent files your bot has. If you need to list older files you can use the nextToken
property returned in the API response to retrieve the next page (if any) of files. The nextToken
will be included for each page if there are files remaining to be listed.
For example:
Updating the file metadata
Only the tags and access policies of a file can be updated.
Here’s an example of how to update the access policies and tags of a file using the Botpress Client:
Updating file content
If you need to update the content of a file, you can create a new file with the updated content and then delete the old file. The file ID will change in this case.
Deleting a file
To delete a file you can use the “Delete File” API endpoint.
Was this page helpful?