# Get tag list

- Operation ID: `getTagList`
- HTTP method: `GET`
- Path: `/tags-collector/tags`
- [Human-readable API reference](https://hub.synerise.com/api-reference/data-management#tag/Asset-tags/operation/getTagList)

## 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:
  /tags-collector/tags:
    get:
      tags:
        - Asset tags
      summary: Get tag list
      description: |
        Gets a paginated list of tags that can be assigned to assets, for example promotions.

        ---

        **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=authenticateUsingPOST_v3" target="_blank" rel="noopener">Profile (Client)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `TAGS_COLLECTOR_TAG_READ`

        **User role permission required:** `assets_tags: read`
      operationId: getTagList
      parameters:
        - in: query
          name: page
          description: Page to retrieve
          required: false
          schema:
            type: integer
            default: 0
        - in: query
          name: size
          description: Limit of items per page
          required: false
          schema:
            type: integer
            default: 10
        - in: query
          name: directoryType
          description: Directory type
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: A list of tags on the retrieved page
                    items:
                      type: object
                      properties:
                        authorId:
                          type: integer
                          description: ID of the user who created the tag
                        color:
                          type: string
                          description: Hex code of the tag color
                          nullable: true
                        createdAt:
                          type: string
                          format: date-time
                          description: Creation time
                        description:
                          type: string
                          description: Description of the tag
                        directory:
                          type: object
                          description: Details of the directory where the tag is assigned
                          properties:
                            createdAt:
                              type: string
                              format: date-time
                              description: Creation time
                            hash:
                              type: string
                              description: Hash ID of the directory
                            name:
                              type: string
                              description: Name of the directory
                            type:
                              type: object
                              description: Details of the directory type
                              properties:
                                createdAt:
                                  type: string
                                  format: date-time
                                  description: Creation time
                                hash:
                                  type: string
                                  description: HashID of the directory type
                                name:
                                  type: string
                                  description: Name of the directory type
                        hash:
                          type: string
                          description: HashID of a tag
                        icon:
                          type: string
                          description: URL of the tag's icon
                          nullable: true
                        priority:
                          type: integer
                          description: Tag priority. Lower values mean higher priority.
                          default: 0
                        value:
                          type: string
                          description: Name of the tag
                  pagination:
                    type: object
                    description: Pagination details
                    properties:
                      limit:
                        type: integer
                        format: int32
                        description: Limit of items per page
                        default: 10
                      page:
                        type: integer
                        format: int32
                        description: Current page number
                        default: 0
                      pages:
                        type: integer
                        format: int32
                        description: Total number of pages
                      total:
                        type: integer
                        format: int64
                        description: Total number of items on all pages
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Not Found
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Asset-tags/operation/getTagList
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/tags-collector/tags?page=SOME_INTEGER_VALUE&size=SOME_INTEGER_VALUE&directoryType=SOME_STRING_VALUE'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            conn.request("GET", "/tags-collector/tags?page=SOME_INTEGER_VALUE&size=SOME_INTEGER_VALUE&directoryType=SOME_STRING_VALUE")

            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/tags-collector/tags?page=SOME_INTEGER_VALUE&size=SOME_INTEGER_VALUE&directoryType=SOME_STRING_VALUE");

            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": "/tags-collector/tags?page=SOME_INTEGER_VALUE&size=SOME_INTEGER_VALUE&directoryType=SOME_STRING_VALUE",
              "headers": {}
            };

            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/tags-collector/tags');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_INTEGER_VALUE',
              'size' => 'SOME_INTEGER_VALUE',
              'directoryType' => 'SOME_STRING_VALUE'
            ]);

            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/tags-collector/tags?page=SOME_INTEGER_VALUE&size=SOME_INTEGER_VALUE&directoryType=SOME_STRING_VALUE")
              .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: Asset tags
```
