# Get catalogs

- Operation ID: `getBags`
- HTTP method: `GET`
- Path: `/catalogs/bags`
- [Human-readable API reference](https://hub.synerise.com/api-reference/data-management#tag/Catalogs/operation/getBags)

## 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:
  /catalogs/bags:
    get:
      tags:
        - Catalogs
      summary: Get catalogs
      description: |
        Retrieve all catalogs from the Workspace. You can filter and sort the results.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `CATALOGS_CATALOG_READ`

        **User role permission required:** `assets_catalogs: read`
      operationId: getBags
      security:
        - JWT: []
      parameters:
        - in: query
          name: searchBy
          description: A search string. You can search the catalogs by their name or the first or last name of the author.
          required: false
          schema:
            type: string
        - in: query
          name: orderBy
          description: The parameter to order the results by. Order is always ascending.
          required: false
          schema:
            type: string
            enum:
              - id
              - author
              - lastModified
              - creationDate
        - in: query
          name: offset
          description: The offset for the search. For example, if your `limit` is 10 and you want to retrieve the third page of items, set the offset to 20. Items with indexes 20 to 29 are returned (the first item on the first page has the index 0).
          required: false
          schema:
            type: integer
        - in: query
          name: limit
          description: "The maximum number of items to include in the response. `offset` must be defined. Default: 100"
          required: false
          schema:
            type: integer
      responses:
        "200":
          description: List of catalogs
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: A list of catalogs
                    items:
                      type: object
                      description: This object holds the details of the catalog.
                      properties:
                        id:
                          type: integer
                          description: Catalog ID
                        name:
                          type: string
                          description: Catalog name
                        businessProfileId:
                          type: integer
                          description: ID of the Business Profile that contains this catalog
                        createdBy:
                          type: object
                          description: Data of user
                          properties:
                            id:
                              type: integer
                              description: Id of the user
                            name:
                              type: string
                              description: Name of the user
                            iconUrl:
                              type: string
                              description: URL of the user's avatar icon
                        creationDate:
                          format: date-time
                          type: string
                          description: Creation date
                        modifiedBy:
                          type: object
                          description: Data of user
                          properties:
                            id:
                              type: integer
                              description: Id of the user
                            name:
                              type: string
                              description: Name of the user
                            iconUrl:
                              type: string
                              description: URL of the user's avatar icon
                        lastModified:
                          type: string
                          format: date-time
                          description: Last modification date
                        primaryKey:
                          type: object
                          required:
                            - name
                          properties:
                            name:
                              type: string
                            description:
                              type: string
                        mappings:
                          type: array
                          items:
                            type: object
                            required:
                              - bpActionParamKey
                              - bagId
                              - itemId
                              - action
                              - paramKey
                              - enrichmentFields
                            properties:
                              bpActionParamKey:
                                type: string
                              bagId:
                                type: integer
                                format: int64
                              itemId:
                                type: integer
                                format: int64
                              action:
                                type: string
                              paramKey:
                                type: string
                              enrichmentFields:
                                type: array
                                items:
                                  type: string
                        beforeFiltering:
                          type: boolean
                        fields:
                          type: array
                          items:
                            type: string
                  metaData:
                    type: object
                    description: This object holds the metadata of the response.
                    properties:
                      totalCount:
                        type: integer
                        description: The total number of matching values (key-value pairs; array items; objects) in the database
                      requestTime:
                        type: string
                        description: The processing time of the request
                        example: 0.11 [s]
        "401":
          description: "Unauthorized: token missing/expired/invalid; invalid API key; etc."
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: Status code
                  error:
                    type: string
                    description: Error summary
                  message:
                    type: string
                    description: Error message
                  timestamp:
                    type: string
                    description: Time when the error occurred
        "403":
          description: "Forbidden: insufficient permissions; wrong consumer scope"
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: Status code
                  error:
                    type: string
                    description: Error summary
                  message:
                    type: string
                    description: Error message
                  timestamp:
                    type: string
                    description: Time when the error occurred
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Catalogs/operation/getBags
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/catalogs/bags?searchBy=SOME_STRING_VALUE&orderBy=SOME_STRING_VALUE&offset=SOME_INTEGER_VALUE&limit=SOME_INTEGER_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", "/catalogs/bags?searchBy=SOME_STRING_VALUE&orderBy=SOME_STRING_VALUE&offset=SOME_INTEGER_VALUE&limit=SOME_INTEGER_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/catalogs/bags?searchBy=SOME_STRING_VALUE&orderBy=SOME_STRING_VALUE&offset=SOME_INTEGER_VALUE&limit=SOME_INTEGER_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": "/catalogs/bags?searchBy=SOME_STRING_VALUE&orderBy=SOME_STRING_VALUE&offset=SOME_INTEGER_VALUE&limit=SOME_INTEGER_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/catalogs/bags');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'searchBy' => 'SOME_STRING_VALUE',
              'orderBy' => 'SOME_STRING_VALUE',
              'offset' => 'SOME_INTEGER_VALUE',
              'limit' => 'SOME_INTEGER_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/catalogs/bags?searchBy=SOME_STRING_VALUE&orderBy=SOME_STRING_VALUE&offset=SOME_INTEGER_VALUE&limit=SOME_INTEGER_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: Catalogs
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.
```
