# List documents

- Operation ID: `listDocumentsGet`
- HTTP method: `GET`
- Path: `/schema-service/document`
- [Human-readable API reference](https://hub.synerise.com/api-reference/asset-management#tag/Documents-(legacy)/operation/listDocumentsGet)

## 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:
  /schema-service/document:
    get:
      deprecated: true
      tags:
        - Documents (legacy)
      summary: List documents
      description: |
        List all documents in the workspace. You can sort and filter the results. The content is raw.

        ---

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

        **User role permission required:** `assets_docs: read`
      operationId: listDocumentsGet
      security:
        - JWT: []
      parameters:
        - in: query
          name: search
          description: "Search term. The following fields are searched: `name`, `description`, `version`, `slug`."
          required: false
          schema:
            type: string
        - in: query
          name: sortBy
          description: Parameter to sort by
          required: false
          schema:
            type: string
            enum:
              - slug:asc
              - slug:desc
              - name:asc
              - name:desc
              - version:asc
              - version:desc
              - id:asc
              - id:desc
        - in: query
          name: limit
          description: The maximum number of items to retrieve for pagination
          required: false
          schema:
            type: string
        - in: query
          name: offset
          description: Offset for pagination. The first item of the first page has the offset of `0`.
          required: false
          schema:
            type: string
      responses:
        "200":
          description: List of documents
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: A list of documents that match the request
                    items:
                      type: object
                      properties:
                        author:
                          type: integer
                          description: ID of the user who created this version of the document
                        content:
                          type: object
                          description: JSON content of the document
                        createdAt:
                          type: string
                          description: Creation date
                          format: date-time
                        description:
                          type: string
                          description: Document description. Can be an empty string.
                        id:
                          type: integer
                          description: Document ID. Generated automatically.
                        isActive:
                          type: boolean
                          description: Informs if the document is isActive
                          default: true
                        name:
                          type: string
                          description: Document name
                        published:
                          type: boolean
                          description: Publishing status
                          default: false
                        schema:
                          type: string
                          description: Schema of the document (called "Type" in the Synerise Web Application)
                          example: containers
                        slug:
                          type: string
                          description: Slug of the document
                          example: basket
                          pattern: "[a-z0-9]+(?:-[a-z0-9]+)*"
                        uuid:
                          type: string
                          format: uuid
                          description: Document UUID. Generated automatically.
                        version:
                          type: string
                          description: Document version
                  total:
                    type: integer
                    description: The total number of documents that match the request
                  offset:
                    type: integer
                    description: The current offset
                  limit:
                    type: integer
                    description: The maximum number of items to retrieve for pagination
      x-snr-doc-urls:
        - /api-reference/asset-management#tag/Documents-(legacy)/operation/listDocumentsGet
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/schema-service/document?search=SOME_STRING_VALUE&sortBy=SOME_STRING_VALUE&limit=SOME_STRING_VALUE&offset=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", "/schema-service/document?search=SOME_STRING_VALUE&sortBy=SOME_STRING_VALUE&limit=SOME_STRING_VALUE&offset=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/schema-service/document?search=SOME_STRING_VALUE&sortBy=SOME_STRING_VALUE&limit=SOME_STRING_VALUE&offset=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": "/schema-service/document?search=SOME_STRING_VALUE&sortBy=SOME_STRING_VALUE&limit=SOME_STRING_VALUE&offset=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/schema-service/document');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'search' => 'SOME_STRING_VALUE',
              'sortBy' => 'SOME_STRING_VALUE',
              'limit' => 'SOME_STRING_VALUE',
              'offset' => '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/schema-service/document?search=SOME_STRING_VALUE&sortBy=SOME_STRING_VALUE&limit=SOME_STRING_VALUE&offset=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: Documents (legacy)
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.
```
