- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- FileMetadata
- FileOriginType
- FileView
- ImageCharacteristics
- ColorSpace
- VideoCharacteristics
- FileCharacteristics
Lists metadata for all files in the current session.
HTTP request
GET https://discoveryengine.googleapis.com/v1alpha/{parent=projects/*/locations/*/collections/*/engines/*/sessions/*}/files
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
parent |
Required. The resource name of the Session. Format: |
Query parameters
Parameters | |
---|---|
filter |
Optional. The filter syntax consists of an expression language for constructing a predicate from one or more fields of the files being filtered. Filter expression is case-sensitive. Currently supported field names are: * uploadTime * lastAddTime * lastUseTime * fileName * mimeType Some examples of filters would be: * "fileName = 'file_1'" * "fileName = 'file_1' AND mimeType = 'text/plain'" * "lastUseTime > '2025-06-14T12:00:00Z'" For a full description of the filter format, please see https://google.aip.dev/160. |
pageSize |
Optional. The maximum number of files to return. The service may return fewer than this value. If unspecified, at most 100 files will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. If user specifies a value less than or equal to 0 - the request will be rejected with an INVALID_ARGUMENT error. |
pageToken |
Optional. A page token received from a previous When paginating, all other parameters provided to |
Request body
The request body must be empty.
Response body
Response message for SessionService.ListFiles
method.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{
"files": [
{
object ( |
Fields | |
---|---|
files[] |
The |
nextPageToken |
A token to retrieve next page of results. Pass this value in the |
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
Requires the following IAM permission on the parent
resource:
discoveryengine.sessions.listSessionFileMetadata
For more information, see the IAM documentation.
FileMetadata
Represents a file attached to a session (context file)
JSON representation |
---|
{ "fileId": string, "name": string, "mimeType": string, "byteSize": string, "originalUri": string, "originalSourceType": enum ( |
Fields | |
---|---|
fileId |
Output only. The ID of the file. |
name |
Output only. The name of the file uploaded. |
mimeType |
The content type of the file, see https://www.iana.org/assignments/media-types/media-types.xhtml. |
byteSize |
Output only. The size of the context file in bytes. |
originalUri |
Optional. The original location of the file. It may be a local file path, or any other URI that allows accessing the file in an external system. There are two scenarios in which this url may be empty: 1. If the file was sent as inline data (e.g. pasted from the clipboard). 2. If the original location is not available. Note that there's no guarantee that the URI will be pointing to a valid or actually existing file. For example, a file might have been uploaded to the session, and then deleted from the original source. |
originalSourceType |
Optional. The type of the original source of the file. |
uploadTime |
Output only. The time the file was uploaded (If this is a file generated by an internal process and then made available to the session, this indicates the moment it happened). Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
lastAddTime |
Output only. The time the file was added to the session. Note that if a file was added, then modified externally, then added again, the add time will be updated. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
metadata |
Optional. Represents metadata related to the file that can suit particular use cases. The prefix "google." is reserved for the key for use by Google, but other prefixes can be freely used. |
downloadUri |
Output only. The |
fileOriginType |
Optional. The origin of the file. |
views |
Output only. Alternate views of this file object. Each file view is attached to a specific role. Possible example keys: - "thumbnail" - "mobile_thumbnail" - "clip" - "summary" - "translation" |
FileOriginType
The origin of the file.
Enums | |
---|---|
FILE_ORIGIN_TYPE_UNSPECIFIED |
Default value. |
USER_PROVIDED |
The file was provided by the user. |
AI_GENERATED |
The file was generated by an AI model. |
INTERNALLY_GENERATED |
The file was generated from other files by an internal process. |
FileView
Represents a specific alternate version or "view" of a file object, such as a summary, a thumbnail, a translated version, etc.
JSON representation |
---|
{ "viewId": string, "uri": string, "mimeType": string, "byteSize": string, "createTime": string, // Union field |
Fields | |
---|---|
viewId |
Output only. Globally Unique id for this specific view. |
uri |
Output only. The URI to access this media view. |
mimeType |
Output only. MIME type (e.g., "image/jpeg", "image/png", "text/plain", "video/mp4") |
byteSize |
Output only. The size of the view in bytes. |
createTime |
Output only. The time the view was created. Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
Union field characteristics . Characteristics of the media view, allowing for flexible extensions. Metadata is always internally generated by the process creating the view. characteristics can be only one of the following: |
|
imageCharacteristics |
Output only. Characteristics of an image media view. |
videoCharacteristics |
Output only. Characteristics of a video media view. |
fileCharacteristics |
Output only. Characteristics of other file types. |
ImageCharacteristics
Standard characteristics of an image media view.
JSON representation |
---|
{
"width": integer,
"height": integer,
"colorSpace": enum ( |
Fields | |
---|---|
width |
Output only. Image width in pixels. |
height |
Output only. Image height in pixels. |
colorSpace |
Output only. color space of the image (e.g., "RGB", "CMYK", "Grayscale"). |
bitDepth |
Output only. Bit depth of the image (e.g., 8-bit, 16-bit). |
ColorSpace
Possible color spaces of an image (e.g., "RGB", "CMYK", "Grayscale").
Enums | |
---|---|
COLOR_SPACE_UNSPECIFIED |
Default value. Unknown color space. |
RGB |
Red, green, blue colorspace. |
CMYK |
Cyan, magenta, yellow, and black colorspace. |
GRAYSCALE |
Grayscale colorspace. |
YUV |
YUV colorspace. |
OTHER_COLOR_SPACE |
Other colorspace. |
VideoCharacteristics
Standard characteristics of a video media view.
JSON representation |
---|
{ "width": integer, "height": integer, "duration": string, "frameRate": number, "audioCodecs": [ string ], "videoCodecs": [ string ], "videoBitrateKbps": integer, "audioBitrateKbps": integer } |
Fields | |
---|---|
width |
Output only. Video width in pixels. |
height |
Output only. Video height in pixels. |
duration |
Output only. Video duration. A duration in seconds with up to nine fractional digits, ending with ' |
frameRate |
Output only. Frame rate (frames per second). |
audioCodecs[] |
Output only. Audio codecs used in the video. |
videoCodecs[] |
Output only. Video codecs used in the video. |
videoBitrateKbps |
Output only. Bitrate of the video in kbps. |
audioBitrateKbps |
Output only. Bitrate of the audio in kbps. |
FileCharacteristics
Caracteristics of other file types.
JSON representation |
---|
{ "characteristics": { string: string, ... } } |
Fields | |
---|---|
characteristics |
Output only. Generic map of characteristics. |