# List expressions

- Operation ID: `analytics2-expressions-list`
- HTTP method: `GET`
- Path: `/analytics/{Namespace}/expressions`
- [Human-readable API reference](https://hub.synerise.com/api-reference/data-management#tag/Analytics:-Expressions/operation/analytics2-expressions-list)

## 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:
  /analytics/{Namespace}/expressions:
    get:
      tags:
        - "Analytics: Expressions"
      summary: List expressions
      description: |
        Returns a paginated list of expressions.

        ---

        **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:** `ANALYTICS_BACKEND_EXPRESSIONS_LIST_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-expressions-list
      parameters:
        - name: page
          description: The number of the page to retrieve
          in: query
          required: false
          style: form
          explode: true
          schema:
            type: integer
            format: int32
            default: 1
            minimum: 1
        - name: limit
          in: query
          description: Limit of items per page
          required: false
          style: form
          explode: true
          schema:
            type: integer
            format: int32
            default: 50
        - name: search
          description: A string to search for in analyses' titles
          in: query
          required: false
          schema:
            type: string
        - name: sortBy
          description: |
            You can sort the results. The sorting direction is selected by adding `asc` or `desc`, for example `sortBy=name:desc`.
          in: query
          required: false
          style: form
          explode: true
          schema:
            type: string
            example: name:asc
            default: updatedAt:desc
            enum:
              - name:asc
              - name:desc
              - author:asc
              - author:desc
              - updatedAt:asc
              - updatedAt:desc
              - createdAt:asc
              - createdAt:desc
              - id:asc
              - id:desc
              - directoryId:asc
              - directoryId:desc
        - name: Namespace
          in: path
          description: Namespace. Currently, only `profiles` is available.
          required: true
          style: simple
          explode: false
          schema:
            type: string
            enum:
              - profiles
        - name: directoryId
          description: Unique ID of the directory to retrieve analyses from
          in: query
          required: false
          schema:
            type: string
            format: uuid
        - name: ids
          in: query
          description: Comma-separated list of IDs (in UUID format) to filter results through
          required: false
          style: form
          explode: false
          schema:
            type: string
        - name: type
          description: Filter by expression type. When omitted, expressions of all types are returned.
          in: query
          required: false
          schema:
            type: string
            enum:
              - CLIENT
              - EVENT
        - name: actionName
          description: Filter event expressions by their action's event name. When omitted, expressions for all actions are returned.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: List of expressions
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Array of expressions
                    items:
                      allOf:
                        - type: object
                          properties:
                            action:
                              type: object
                              description: The analyzed event
                              nullable: true
                              required:
                                - name
                              properties:
                                id:
                                  type: integer
                                  format: int64
                                  deprecated: true
                                  nullable: true
                                  description: Deprecated parameter. DO NOT use. Has no effect in create/update requests.
                                name:
                                  type: string
                                  description: Action name of the event.
                                  example: page.visit
                            type:
                              type: string
                              x-class-name: ExpressionType
                              enum:
                                - EVENT
                                - CLIENT
                          required:
                            - action
                            - type
                        - type: object
                          description: Common elements retrieved in lists of analyses
                          properties:
                            id:
                              type: string
                              format: uuid
                              description: Unique ID of the resource
                            name:
                              type: string
                              description: Name of the resource
                            author:
                              type: object
                              description: Data of the author of the analysis
                              properties:
                                id:
                                  type: integer
                                  format: int64
                                  description: Unique ID of the original creator. `1` means the resource was created by a request with workspace authorization.
                                name:
                                  type: string
                                  description: Name of the author
                                icon:
                                  type: string
                                  description: URL of the author's avatar icon
                              required:
                                - id
                                - name
                            updatedAt:
                              type: string
                              format: date-time
                              description: Last update time
                            usedAt:
                              type: string
                              format: date-time
                              description: The date and time when the item was last used
                              nullable: true
                            createdAt:
                              type: string
                              format: date-time
                              description: Creation time
                            directoryId:
                              type: string
                              format: uuid
                              description: Unique ID of the directory which contains this analysis. A 'default' directory is automatically created in every workspace.
                            isDynamicAnalytic:
                              type: boolean
                              description: "`true` if the analysis contains any [dynamic values](https://hub.synerise.com/docs/analytics/i_events-parameter-value/#dynamic-key)."
                            variables:
                              type: array
                              description: Dynamic keys used in this analysis
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                                    description: The name of the variable (dynamic key) which will receive this value for the current calculation.
                                  value:
                                    description: |
                                      The value of the variable. Can be one of: string, integer, boolean, string[], integer[], or a DateFilter object (with type ABSOLUTE/RELATIVE).
                                    example: example-string-value
                                required:
                                  - name
                                  - value
                          required:
                            - author
                            - createdAt
                            - directoryId
                            - id
                            - isDynamicAnalytic
                            - name
                            - updatedAt
                            - usedAt
                            - variables
                  meta:
                    type: object
                    description: Pagination metadata
                    properties:
                      links:
                        type: array
                        description: Links to the neighboring pages and the first page
                        items:
                          type: object
                          properties:
                            url:
                              type: string
                              description: URL of the page, used for navigation
                            rel:
                              type: string
                              x-class-name: LinkRel
                              description: The type of relation to the current page. `first` is always the first page.
                              enum:
                                - first
                                - prev
                                - next
                          required:
                            - rel
                            - url
                      limit:
                        type: integer
                        format: int32
                        description: Limit of items per page
                      count:
                        type: integer
                        description: Currently unused
                        nullable: true
                    required:
                      - links
                      - limit
                required:
                  - data
        4XX:
          description: See error message for details
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      source:
                        type: object
                        nullable: true
                        description: Information about a parameter that caused the error, if applicable.
                        properties:
                          pointer:
                            type: string
                            description: Information about a parameter
                          value:
                            type: string
                            nullable: true
                            description: Currently unused
                      errors:
                        type: array
                        description: An array of errors, if applicable
                        items:
                          type: object
                          properties:
                            timestamp:
                              type: string
                              format: date-time
                              description: Time when the error occurred
                            errorCode:
                              type: string
                              description: Code of the error, needed for troubleshooting. See [https://developers.synerise.com/errors.html](https://developers.synerise.com/errors.html).
                            httpStatus:
                              type: integer
                              description: HTTP status code
                            message:
                              type: string
                              description: Description of the problem
                            traceId:
                              type: string
                              description: Currently unused
                              nullable: true
                            help:
                              type: string
                              nullable: true
                              description: Currently unused
                  - type: object
                    properties:
                      timestamp:
                        type: string
                        format: date-time
                        description: Time when the error occurred
                      errorCode:
                        type: string
                        description: Code of the error, needed for troubleshooting. See [https://developers.synerise.com/errors.html](https://developers.synerise.com/errors.html).
                      httpStatus:
                        type: integer
                        description: HTTP status code
                      message:
                        type: string
                        description: Description of the problem
                      traceId:
                        type: string
                        description: Currently unused
                        nullable: true
                      help:
                        type: string
                        nullable: true
                        description: Currently unused
        5XX:
          description: See error message for details
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      source:
                        type: object
                        nullable: true
                        description: Information about a parameter that caused the error, if applicable.
                        properties:
                          pointer:
                            type: string
                            description: Information about a parameter
                          value:
                            type: string
                            nullable: true
                            description: Currently unused
                      errors:
                        type: array
                        description: An array of errors, if applicable
                        items:
                          type: object
                          properties:
                            timestamp:
                              type: string
                              format: date-time
                              description: Time when the error occurred
                            errorCode:
                              type: string
                              description: Code of the error, needed for troubleshooting. See [https://developers.synerise.com/errors.html](https://developers.synerise.com/errors.html).
                            httpStatus:
                              type: integer
                              description: HTTP status code
                            message:
                              type: string
                              description: Description of the problem
                            traceId:
                              type: string
                              description: Currently unused
                              nullable: true
                            help:
                              type: string
                              nullable: true
                              description: Currently unused
                  - type: object
                    properties:
                      timestamp:
                        type: string
                        format: date-time
                        description: Time when the error occurred
                      errorCode:
                        type: string
                        description: Code of the error, needed for troubleshooting. See [https://developers.synerise.com/errors.html](https://developers.synerise.com/errors.html).
                      httpStatus:
                        type: integer
                        description: HTTP status code
                      message:
                        type: string
                        description: Description of the problem
                      traceId:
                        type: string
                        description: Currently unused
                        nullable: true
                      help:
                        type: string
                        nullable: true
                        description: Currently unused
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Expressions/operation/analytics2-expressions-list
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/analytics/%7BNamespace%7D/expressions?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&type=SOME_STRING_VALUE&actionName=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", "/analytics/%7BNamespace%7D/expressions?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&type=SOME_STRING_VALUE&actionName=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/analytics/%7BNamespace%7D/expressions?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&type=SOME_STRING_VALUE&actionName=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": "/analytics/%7BNamespace%7D/expressions?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&type=SOME_STRING_VALUE&actionName=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/analytics/%7BNamespace%7D/expressions');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_INTEGER_VALUE',
              'limit' => 'SOME_INTEGER_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'sortBy' => 'name:asc',
              'directoryId' => 'SOME_STRING_VALUE',
              'ids' => 'SOME_STRING_VALUE',
              'type' => 'SOME_STRING_VALUE',
              'actionName' => '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/analytics/%7BNamespace%7D/expressions?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&type=SOME_STRING_VALUE&actionName=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: "Analytics: Expressions"
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.
```
