Actions17
- Bucket Actions
- Object Actions
- Batch Operations Actions
Object → List
AI-generatedSummary
List objects in an R2 bucket with optional prefix, pagination, and delimiter.
Inputs
- bucketName (required) — The name of the R2 bucket to list objects from.
- listOptions — Options for listing objects: prefix to filter, maxKeys for result limit, startAfter for pagination, delimiter to group keys.
Output shape
A list of objects with their keys, plus pagination metadata (truncated, continuation_token, results_count).
The returned objects array may be truncated; continuation_token can be used for further pages. All fields except objects are optional.
Examples
Example 1: List the first 50 images under the 'images/2024/' prefix.
bucketName: my-bucket; listOptions: {prefix: 'images/2024/', maxKeys: 50}
Example 2: Paginate through a large bucket using a startAfter key.
bucketName: logs; listOptions: {startAfter: 'access.log.2024-09-01', delimiter: '/'}
Example 3: Search for all PDF files larger than a certain size (using search operation but exemplifies list).
bucketName: documents; listOptions: {prefix: 'pdfs/', maxKeys: 1000}