# List files from workspace

- Operation ID: `getFilesV2`
- HTTP method: `GET`
- Path: `/uploader-service/v2/list`
- [Human-readable API reference](https://hub.synerise.com/api-reference/asset-management#tag/Uploader/operation/getFilesV2)

## Self-contained OpenAPI method

The fenced document below contains this method's documentation and all of its local references. It is self-contained; no category or master specification fetch is required.

```yaml
openapi: 3.0.0
info:
  title: Synerise Public API
  version: 1.9.1
paths:
  /uploader-service/v2/list:
    get:
      tags:
        - Uploader
      summary: List files from workspace
      description: |
        Retrieve a list of all files in the Workspace.

        ---

        **API consumer:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **User role permission required:** `assets_explorer: read`
      operationId: getFilesV2
      parameters:
        - name: page
          in: query
          required: false
          description: page number
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: limit
          in: query
          required: false
          description: number of elements in a page
          schema:
            type: integer
            minimum: 0
            default: 50
        - name: sortBy
          in: query
          required: false
          description: field to sort by and order
          schema:
            type: string
            pattern: ^(updatedYear|createdAt):(asc|desc)$
            example: createdAt:asc
            default: updatedYear:desc
        - name: mediatype
          in: query
          required: false
          description: filter by media type
          schema:
            type: string
            example: image/jpeg
        - name: extensions
          in: query
          required: false
          description: filter by extension files
          schema:
            type: string
            example: pdf,jpeg
        - name: search
          in: query
          required: false
          description: file id or substring of file name
          schema:
            type: string
      responses:
        "200":
          description: Files
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                  - data
                properties:
                  meta:
                    type: object
                    description: Pagination metadata
                    properties:
                      links:
                        type: array
                        description: Links to the neighboring pages and the first page
                        items:
                          type: object
                          required:
                            - url
                            - rel
                          properties:
                            url:
                              type: string
                              description: URL of the page, used for navigation
                            rel:
                              type: string
                              description: The type of relation to the current page. `first` is always the first page.
                              enum:
                                - first
                                - prev
                                - next
                      limit:
                        type: integer
                        format: int32
                        description: Limit of items per page
                      count:
                        type: integer
                        nullable: true
                        description: Currently unused
                  data:
                    type: array
                    description: Array of external sources
                    items:
                      type: object
                      properties:
                        author:
                          type: object
                          description: Author of a file.
                          properties:
                            id:
                              type: number
                            email:
                              type: string
                            displayName:
                              type: string
                            avatar:
                              type: string
                          required:
                            - id
                            - email
                            - displayName
                        permissions:
                          type: object
                          properties:
                            canEdit:
                              type: boolean
                            canRemove:
                              type: boolean
                        createdAt:
                          description: Creation date
                          type: string
                        filename:
                          description: Name of the file
                          type: string
                        id:
                          description: ID of the file
                          type: string
                        uuid:
                          type: string
                          description: UUID of the file, without dashes
                        isStarred:
                          type: boolean
                          description: Informs if the file is starred.
                        mimetype:
                          type: string
                          description: The MIME type of the file.
                          enum:
                            - image/png
                            - image/jpeg
                            - image/jpg
                            - image/gif
                            - video/mp4
                            - application/pdf
                            - application/vnd.openxmlformats-officedocument.wordprocessingml.document
                            - application/vnd.ms-excel
                        path:
                          type: object
                          description: Paths to different versions of the resource. Some MIME types only have `origin`.
                          properties:
                            large:
                              type: string
                              description: Path to the large version of the file
                            origin:
                              type: string
                              description: Path to the original file
                            thumb:
                              type: string
                              description: Path to the thumbnail
                        size:
                          type: number
                          description: Size of the file in bytes
                        storageId:
                          type: string
                          description: Name of the container where the file is stored
                        updatedYear:
                          type: integer
                          description: Year of last update
                        url:
                          type: string
                          description: URL of the file
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/asset-management#tag/Uploader/operation/getFilesV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/uploader-service/v2/list?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&sortBy=createdAt%3Aasc&mediatype=image%2Fjpeg&extensions=pdf%2Cjpeg&search=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/uploader-service/v2/list?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&sortBy=createdAt%3Aasc&mediatype=image%2Fjpeg&extensions=pdf%2Cjpeg&search=SOME_STRING_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/uploader-service/v2/list?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&sortBy=createdAt%3Aasc&mediatype=image%2Fjpeg&extensions=pdf%2Cjpeg&search=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/uploader-service/v2/list?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&sortBy=createdAt%3Aasc&mediatype=image%2Fjpeg&extensions=pdf%2Cjpeg&search=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/uploader-service/v2/list');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_INTEGER_VALUE',
              'limit' => 'SOME_INTEGER_VALUE',
              'sortBy' => 'createdAt:asc',
              'mediatype' => 'image/jpeg',
              'extensions' => 'pdf,jpeg',
              'search' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/uploader-service/v2/list?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&sortBy=createdAt%3Aasc&mediatype=image%2Fjpeg&extensions=pdf%2Cjpeg&search=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: Uploader
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer
      description: |-
        JWT Bearer token. The header looks like this: `Bearer {JWT}`

        Remember to include the space between 'Bearer' and the token.

        Generate a token via the **Authorization** endpoints.
```
