Pagination and filtering
Use continuation cursors to page through results and filters to select the assets your app needs.
Pagination
Every list in the API pages the same way, with an opaque continuation cursor:
| Field | Meaning |
|---|---|
cursor | The previous response’s nextCursor. Omit it for the first page. |
pageSize | Items per page, from 1 through 100. The default is 50. |
sort | The sort order, where the list supports one: a comma-separated list of fields, each ascending unless prefixed with -, such as -createdAt,id. Lists sorted by createdAt add an id tie-breaker in the first field's direction. |
Responses include items, nextCursor and hasMore. Pass nextCursor unchanged as cursor until hasMore is false. A cursor continues only the request it came from: keep the project, filter, folder, search and sort unchanged, or the request fails with 400 cursor/invalid. Exact totals and numbered page jumps are not provided.
| List | Order |
|---|---|
GET /, GET /, GET /, GET / and GET / | createdAt and id, up to two fields, newest first (-createdAt) by default |
GET / | createdAt and id, up to two fields, oldest first (createdAt) by default |
GET / | One field, name (the default, A to Z) or createdAt |
GET / | Time order, with no sort |
GET / | Oldest first, with no sort |
GET / is not a list: it returns its best pageSize matches (1 to 20, default 10) ranked by relevance, without a cursor. Refine the query, or list assets with a filter, to go further.
Inserts and deletions before your position do not shift later pages. This is not a snapshot: items deleted before you reach them disappear, and assets whose filter membership changes may enter or leave the results. Every list in the SDKs has an iterator that follows the cursors for you.
The events feed is the one list you keep reading after it ends. Without a cursor it returns no events and a nextCursor for the current time, and its nextCursor is never null: when hasMore is false, save it and poll with it later to receive newer events. See Events.
const page = await client.assets.list({
pageSize: 25,
sort: "-createdAt",
});
Query values
A query parameter that takes a list, such as the events feed's types, takes its values comma-separated in one parameter: types=asset.blocked,asset.purged. Upload query parameters that take structured values, processingOptions, metadata, tags and context, take URL-encoded JSON, such as tags=%5B%22homepage%22%5D for ["homepage"].
Asset filters
The asset list accepts an RSQL-style filter, which is also how you list one folder: folderId==fldr_…, or folderId==null for the project root. The operators are equality (==), inequality (!=), comparisons (>, >=, <, <=), inclusion (=in=) and exclusion (=out=). Use ; for AND, , for OR, and parentheses for grouping.
A filter can name only these asset fields. Nested fields use the dotted names they have on the asset:
| Fields | Values |
|---|---|
id, parentId, folderId, uploadPresetId | IDs, or null for parentId, folderId and uploadPresetId |
name, description, externalId, externalUrl, authorId | Text, or null for every field but name |
type, visibility | The asset's type and visibility values |
tags | Only =in=, assets that have any of the listed tags, and =out=, assets that have none of them, including assets without tags |
upload.status, classification.status, classification.moderation.status, content.status, content.removalReason | Status and removal reason values |
content.format, content.extension | A MIME type such as image/png, and a file extension such as png |
content.sizeInBytes | A number of bytes |
createdAt, updatedAt, upload.updatedAt, classification.updatedAt, classification.completedAt, content.updatedAt | Unix timestamps in milliseconds |
In an == or != value, * matches any run of characters, ignoring case: externalId==order:* matches every external ID that starts with order:. Every other character matches itself, and a value without * matches only that exact value, case included. A comparison never matches an asset that has no value for the field, so externalId!=order:1 leaves out assets without an external ID; use ==null to find those. Quote a value that contains ,, ;, parentheses or spaces, such as name=="Summer photos*".
# Allowed assets
classification.moderation.status==allowed
# Allowed or pending assets
classification.moderation.status=in=(allowed,pending)
# Blocked or purged top-level assets
classification.moderation.status=in=(blocked,purged);parentId==null
# Private assets awaiting or passing moderation
(classification.moderation.status==allowed,classification.moderation.status==pending);visibility==private
# Assets whose external ID starts with order:
externalId==order:*
# Assets whose processing failed
classification.status==failed
# Assets whose content was removed
content.status==removed
# PNG images
content.format==image/png
# Assets tagged homepage
tags=in=(homepage)
# Assets tagged neither archive nor draft
tags=out=(archive,draft)Pass the expression as one URL-encoded query value or directly through the SDK:
const page = await client.assets.list({
filter: "classification.moderation.status==allowed;tags=in=(homepage)",
});
A filter with invalid syntax, an unsupported operator, such as == on tags, or a field outside the list above returns 400 filter/invalid. When you build a filter from your users' input, quote their values rather than inserting them as raw filter syntax.