Retrieve and filter assets stored in your Builder Space. Use these operations to query media by type, folder, and other attributes to support content delivery and management workflows.
Assets refer to media content uploaded to Builder. For more details on assets, see Asset Library.
To get all assets from your Builder Space, use the following query.
Use the following query to sort your assets by a particular key, such as the asset's name.
To filter assets by media type (such as images, videos, or specific formats), use the type field. Note that this corresponds to the MIME type of the asset.
Common asset types:
image/jpeg: jpeg images
image/png: png images
image/svg+xml: svg images
image/gif: gif images
image/webp: webp images
video/mp4: mp4 videos
application/pdf: pdf documents
To filter assets by folder, use the folders field with the folder ID. Assets can belong to multiple folders, so folders is an array field.
You can combine multiple filters to get more specific results. For example, to get all SVG images from a specific folder:
$eq: equal
$ne: not equal
$in: in array
$nin: not in array
$exists: field exists
$regex: regular expression match
Example with multiple operators:
This query returns jpeg or png images that have "logo" in their name and belong to at least one folder.
Use the GraphQL Explorer to try out these queries with your own Space and Organization. Then, visit the Admin API GraphQL Schema for more details on how to modify your queries.