## List files `client.File.List(ctx, query) (*FileListResponse, error)` **get** `/v1/files` Returns a paginated list of files in your workspace. Use `offset` and `limit` to paginate through results. See [List endpoints](/using-the-api/list-endpoints/) for more information about pagination. **[Required scope](/using-the-api/scopes/):** `files:read` **[Rate limit category](/using-the-api/rate-limits/):** Search ### Parameters - `query FileListParams` - `Limit param.Field[int64]` Maximum number of records to return. Defaults to 25, maximum 25. - `Offset param.Field[int64]` Number of records to skip for pagination. Defaults to 0. ### Returns - `type FileListResponse struct{…}` - `Data []FileListResponseData` Array of file objects for the current page. - `ID string` Unique identifier for the file. - `CompletedAt string` When the file upload was completed. - `CreatedAt string` When the file upload session was created. - `ExpiresAt string` When the upload session expires. Null once completed, cancelled, or expired. - `Filename string` Original filename. - `MimeType string` MIME type of the file. - `SizeBytes int64` File size in bytes. - `Status string` Current upload status of the file. - `const FileListResponseDataStatusPending FileListResponseDataStatus = "PENDING"` - `const FileListResponseDataStatusCompleted FileListResponseDataStatus = "COMPLETED"` - `const FileListResponseDataStatusCancelled FileListResponseDataStatus = "CANCELLED"` - `const FileListResponseDataStatusExpired FileListResponseDataStatus = "EXPIRED"` - `Object string` The object type, always `"list"`. - `TotalCount int64` Total number of matching files. ### Example ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) fileListResponse, err := client.File.List(context.TODO(), githubcomlightfldlightfieldgo.FileListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", fileListResponse.Data) } ``` #### Response ```json { "data": [ { "id": "id", "completedAt": "completedAt", "createdAt": "createdAt", "expiresAt": "expiresAt", "filename": "filename", "mimeType": "mimeType", "sizeBytes": -9007199254740991, "status": "PENDING" } ], "object": "object", "totalCount": 0 } ```