v8

OpenAPI 3.1.02026-08-04192135175.3 KB
Library management

Get File By Id

Retrieve a list of documents in the user's library. Optionally specify a filter to find only files with matching labels or paths. This method returns only metadata about files; to download a file, call GET .../files/{file_id}/download

When specifying qualifiers with your request, only files that match all qualifiers will be returns. So, for example, if you specify label='financial' and status='UPLOADED', only files with the label "financial" AND status UPLOADED will be returned.

get/studio/v1/library/files/{file_id}

Path parameters

file_idstring uuid required

Response

Successful Response

fileIdstring uuid required

The unique identifier of the file, generated by AI21.

namestring required

The name of the file. This is the local file name from when the file was uploaded. It cannot be modified.

pathstring

An arbitrary file-path-like string to indicate the content of a file. This has nothing to do with the location of the file in storage or on disk, and is only another label that you can assign to the file in path-like format to help you organize the contents of the file or filter queries against your files. Example paths might be pets/fish or pets/dogs. Then, when searching your library, you can filter files by the full path or path prefix. So to search only files in the "dog folder", filter by the path /pets/dogs. To search all files in the "pet folder", filter your search by the path pets/ when searching by path. There isn't a restriction on whether a path must start or end with a / mark, but be consistent in your usage, and all matches are prefix matching, not substring matching. So filtering by dog/ matches dog/ and dog/setter but not pets/dog/.

fileTypestring required

The file type. See the file upload method to learn what file types are supported.

sizeBytesinteger required

The size of the file, in bytes.

labelsstring[]

Any string labels you have associated with the file. You can apply arbitrary string labels to your files and limit queries to files with one or more labels. Similar to paths, but labels do not prefix match. Labels are case-sensitive. There can be a maximum of 20 unique labels per account.

publicUrlstring

The public URL of the file, if any. This URL is not validated by AI21 or used in any way. It is strictly a piece of metadata that you can optionally attach to a file.

createdBystring uuid required

An internal identifier of the user who uploaded the file.

creationDatestring date required

The date when the file was uploaded.

lastUpdatedstring date required

When the file data or metadata was last changed.

statusstring required

File status. One of the following values: "DB_RECORD_CREATED", "UPLOADED", "UPLOAD_FAILED", "PROCESSED", "PROCESSING_FAILED"

dataSourcestring