openapi: 3.0.0
info:
  title: Automation - Synerise Public API
  version: 1.2.2
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: Workflows
  - name: Data Processing Job Logs
x-tagGroups:
  - name: Automation
    tags:
      - Workflows
      - Data Processing Job Logs
paths:
  /automation-brain/diagrams:
    get:
      security:
        - JWT: []
      tags:
        - Workflows
      summary: Get list of workflows
      operationId: getPaginatedDiagrams
      description: |
        Retrieve a paginated list of workflows.

        ---

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

        **User role permission required:** `automation_2_journeys: read`
      parameters:
        - $ref: "#/components/parameters/automation-brain-page"
        - $ref: "#/components/parameters/automation-brain-limit"
        - $ref: "#/components/parameters/automation-brain-filterByStatus"
        - $ref: "#/components/parameters/automation-brain-sortDiagrams"
        - $ref: "#/components/parameters/automation-brain-sortByDiagrams"
        - $ref: "#/components/parameters/automation-brain-sortingOrder"
        - $ref: "#/components/parameters/automation-brain-search"
        - $ref: "#/components/parameters/automation-brain-directoryId"
      responses:
        "200":
          description: A page of workflows
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/automation-brain-PaginatedDiagrams"
        "400":
          $ref: "#/components/responses/automation-brain-400"
        "401":
          $ref: "#/components/responses/automation-brain-401"
        "403":
          $ref: "#/components/responses/automation-brain-403"
        "404":
          $ref: "#/components/responses/automation-brain-404"
      x-snr-doc-urls:
        - /api-reference/automation#tag/Workflows/operation/getPaginatedDiagrams
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/automation-brain/diagrams?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&status=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&sortBy=createdTime%3Adesc&order=SOME_STRING_VALUE&search=SOME_STRING_VALUE&directoryId=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", "/automation-brain/diagrams?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&status=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&sortBy=createdTime%3Adesc&order=SOME_STRING_VALUE&search=SOME_STRING_VALUE&directoryId=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/automation-brain/diagrams?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&status=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&sortBy=createdTime%3Adesc&order=SOME_STRING_VALUE&search=SOME_STRING_VALUE&directoryId=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": "/automation-brain/diagrams?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&status=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&sortBy=createdTime%3Adesc&order=SOME_STRING_VALUE&search=SOME_STRING_VALUE&directoryId=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/automation-brain/diagrams');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_NUMBER_VALUE',
              'limit' => 'SOME_NUMBER_VALUE',
              'status' => 'SOME_STRING_VALUE',
              'sort' => 'SOME_STRING_VALUE',
              'sortBy' => 'createdTime:desc',
              'order' => 'SOME_STRING_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'directoryId' => '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/automation-brain/diagrams?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&status=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&sortBy=createdTime%3Adesc&order=SOME_STRING_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /automation-brain/v2/diagrams:
    get:
      security:
        - JWT: []
      tags:
        - Workflows
      summary: Get list of workflows
      operationId: getPaginatedDiagramsV2
      description: |
        Retrieve a paginated list of workflows.

        ---

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

        **User role permission required:** `automation_2_journeys: read`
      parameters:
        - $ref: "#/components/parameters/automation-brain-page"
        - $ref: "#/components/parameters/automation-brain-limit50"
        - $ref: "#/components/parameters/automation-brain-filterByStatus"
        - $ref: "#/components/parameters/automation-brain-sortDiagrams"
        - $ref: "#/components/parameters/automation-brain-sortByDiagrams"
        - $ref: "#/components/parameters/automation-brain-sortingOrder"
        - $ref: "#/components/parameters/automation-brain-search"
        - $ref: "#/components/parameters/automation-brain-directoryId"
        - $ref: "#/components/parameters/automation-brain-tagIds"
      responses:
        "200":
          description: A page of workflows
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/automation-brain-PaginatedDiagramsV2"
        "400":
          $ref: "#/components/responses/automation-brain-400"
        "401":
          $ref: "#/components/responses/automation-brain-401"
        "403":
          $ref: "#/components/responses/automation-brain-403"
        "404":
          $ref: "#/components/responses/automation-brain-404"
      x-snr-doc-urls:
        - /api-reference/automation#tag/Workflows/operation/getPaginatedDiagramsV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/automation-brain/v2/diagrams?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&status=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&sortBy=createdTime%3Adesc&order=SOME_STRING_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE&tags=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", "/automation-brain/v2/diagrams?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&status=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&sortBy=createdTime%3Adesc&order=SOME_STRING_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE&tags=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/automation-brain/v2/diagrams?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&status=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&sortBy=createdTime%3Adesc&order=SOME_STRING_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE&tags=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": "/automation-brain/v2/diagrams?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&status=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&sortBy=createdTime%3Adesc&order=SOME_STRING_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE&tags=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/automation-brain/v2/diagrams');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_NUMBER_VALUE',
              'limit' => 'SOME_NUMBER_VALUE',
              'status' => 'SOME_STRING_VALUE',
              'sort' => 'SOME_STRING_VALUE',
              'sortBy' => 'createdTime:desc',
              'order' => 'SOME_STRING_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'directoryId' => 'SOME_STRING_VALUE',
              'tags' => '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/automation-brain/v2/diagrams?page=SOME_NUMBER_VALUE&limit=SOME_NUMBER_VALUE&status=SOME_STRING_VALUE&sort=SOME_STRING_VALUE&sortBy=createdTime%3Adesc&order=SOME_STRING_VALUE&search=SOME_STRING_VALUE&directoryId=SOME_STRING_VALUE&tags=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /automation-brain/diagrams/{diagramId}/run:
    post:
      security:
        - JWT: []
      tags:
        - Workflows
      summary: Run/resume workflow
      operationId: runAutomationDiagram
      description: |
        Run a or resume workflow.

        ---

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

        **User role permission required:** `automation_2_journeys: execute`
      parameters:
        - $ref: "#/components/parameters/automation-brain-diagramId"
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/automation-brain-DiagramActionRequest"
      responses:
        "200":
          description: Workflow run/resumed or was already running
          content:
            text/plain:
              schema:
                type: string
                enum:
                  - OK
        "400":
          $ref: "#/components/responses/automation-brain-genericError"
        "401":
          $ref: "#/components/responses/automation-brain-401"
        "403":
          $ref: "#/components/responses/automation-brain-403"
        "404":
          $ref: "#/components/responses/automation-brain-404"
      x-snr-doc-urls:
        - /api-reference/automation#tag/Workflows/operation/runAutomationDiagram
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/run \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"scheduleAction":"On"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"scheduleAction\":\"On\"}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/automation-brain/diagrams/%7BdiagramId%7D/run", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "scheduleAction": "On"
            });

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

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

            xhr.open("POST", "https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/run");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

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

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/automation-brain/diagrams/%7BdiagramId%7D/run",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            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.write(JSON.stringify({scheduleAction: 'On'}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/run');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"scheduleAction":"On"}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/run")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"scheduleAction\":\"On\"}")
              .asString();
  /automation-brain/diagrams/{diagramId}/pause:
    post:
      security:
        - JWT: []
      tags:
        - Workflows
      summary: Pause workflow
      operationId: pauseAutomationDiagram
      description: |
        Pause a workflow.

        ---

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

        **User role permission required:** `automation_2_journeys: execute`
      parameters:
        - $ref: "#/components/parameters/automation-brain-diagramId"
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/automation-brain-DiagramActionRequest"
      responses:
        "200":
          description: Diagram paused or was already paused
          content:
            text/plain:
              schema:
                type: string
                enum:
                  - OK
        "400":
          $ref: "#/components/responses/automation-brain-genericError"
        "401":
          $ref: "#/components/responses/automation-brain-401"
        "403":
          $ref: "#/components/responses/automation-brain-403"
        "404":
          $ref: "#/components/responses/automation-brain-404"
      x-snr-doc-urls:
        - /api-reference/automation#tag/Workflows/operation/pauseAutomationDiagram
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/pause \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"scheduleAction":"On"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"scheduleAction\":\"On\"}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/automation-brain/diagrams/%7BdiagramId%7D/pause", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "scheduleAction": "On"
            });

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

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

            xhr.open("POST", "https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/pause");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

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

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/automation-brain/diagrams/%7BdiagramId%7D/pause",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            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.write(JSON.stringify({scheduleAction: 'On'}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/pause');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"scheduleAction":"On"}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/pause")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"scheduleAction\":\"On\"}")
              .asString();
  /automation-brain/diagrams/{diagramId}/stop:
    post:
      security:
        - JWT: []
      tags:
        - Workflows
      summary: Stop workflow
      operationId: stopAutomationDiagram
      description: |
        Stop a workflow.

        <span style="color:red"><strong>WARNING:</strong> A stopped workflow can't be restarted.</span>


        ---

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

        **User role permission required:** `automation_2_journeys: execute`
      parameters:
        - $ref: "#/components/parameters/automation-brain-diagramId"
      responses:
        "200":
          description: Workflow stopped or was already stopped
          content:
            text/plain:
              schema:
                type: string
                enum:
                  - OK
        "400":
          $ref: "#/components/responses/automation-brain-genericError"
        "401":
          $ref: "#/components/responses/automation-brain-401"
        "403":
          $ref: "#/components/responses/automation-brain-403"
        "404":
          $ref: "#/components/responses/automation-brain-404"
      x-snr-doc-urls:
        - /api-reference/automation#tag/Workflows/operation/stopAutomationDiagram
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/stop \
              --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("POST", "/automation-brain/diagrams/%7BdiagramId%7D/stop", 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("POST", "https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/stop");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

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

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/automation-brain/diagrams/%7BdiagramId%7D/stop",
              "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/automation-brain/diagrams/%7BdiagramId%7D/stop');
            $request->setMethod(HTTP_METH_POST);

            $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.post("https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/stop")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /automation-brain/diagrams/{diagramId}/schedule-on:
    post:
      security:
        - JWT: []
      tags:
        - Workflows
      summary: Enable schedule for workflow
      operationId: scheduleOnAutomationDiagram
      description: |
        Enable schedule for workflow.

        ---

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

        **User role permission required:** `automation_2_journeys: execute`
      parameters:
        - $ref: "#/components/parameters/automation-brain-diagramId"
      responses:
        "200":
          description: Workflow scheduled or was already scheduled
          content:
            text/plain:
              schema:
                type: string
                enum:
                  - OK
        "400":
          $ref: "#/components/responses/automation-brain-genericError"
        "401":
          $ref: "#/components/responses/automation-brain-401"
        "403":
          $ref: "#/components/responses/automation-brain-403"
        "404":
          $ref: "#/components/responses/automation-brain-404"
      x-snr-doc-urls:
        - /api-reference/automation#tag/Workflows/operation/scheduleOnAutomationDiagram
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/schedule-on \
              --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("POST", "/automation-brain/diagrams/%7BdiagramId%7D/schedule-on", 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("POST", "https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/schedule-on");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

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

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/automation-brain/diagrams/%7BdiagramId%7D/schedule-on",
              "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/automation-brain/diagrams/%7BdiagramId%7D/schedule-on');
            $request->setMethod(HTTP_METH_POST);

            $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.post("https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/schedule-on")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /automation-brain/diagrams/{diagramId}/schedule-off:
    post:
      security:
        - JWT: []
      tags:
        - Workflows
      summary: Disable schedule for workflow
      operationId: scheduleOffAutomationDiagram
      description: |
        Disable schedule for workflow.

        ---

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

        **User role permission required:** `automation_2_journeys: execute`
      parameters:
        - $ref: "#/components/parameters/automation-brain-diagramId"
      responses:
        "200":
          description: Workflow unscheduled or was already unscheduled
          content:
            text/plain:
              schema:
                type: string
                enum:
                  - OK
        "400":
          $ref: "#/components/responses/automation-brain-genericError"
        "401":
          $ref: "#/components/responses/automation-brain-401"
        "403":
          $ref: "#/components/responses/automation-brain-403"
        "404":
          $ref: "#/components/responses/automation-brain-404"
      x-snr-doc-urls:
        - /api-reference/automation#tag/Workflows/operation/scheduleOffAutomationDiagram
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/schedule-off \
              --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("POST", "/automation-brain/diagrams/%7BdiagramId%7D/schedule-off", 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("POST", "https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/schedule-off");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

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

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/automation-brain/diagrams/%7BdiagramId%7D/schedule-off",
              "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/automation-brain/diagrams/%7BdiagramId%7D/schedule-off');
            $request->setMethod(HTTP_METH_POST);

            $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.post("https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/schedule-off")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /automation-brain/diagrams/{diagramId}/statistics:
    get:
      security:
        - JWT: []
      tags:
        - Workflows
      summary: Get workflow statistics with node details
      operationId: getDiagramStatistics
      description: |
        Retrieve workflow execution statistics, including node statistics and metadata (name, type).

        ---

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

        **User role permission required:** `automation_2_journeys: read`
      parameters:
        - $ref: "#/components/parameters/automation-brain-diagramId"
        - name: timePeriod
          in: query
          description: Time period for the statistics
          required: false
          schema:
            type: string
            enum:
              - currentHour
              - currentDay
              - previousHour
              - previousDay
      responses:
        "200":
          description: Diagram statistics with node info
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/automation-brain-ExternalDiagramStatsWithInfo"
        "400":
          $ref: "#/components/responses/automation-brain-genericError"
        "403":
          description: Insufficient permissions to perform this action
        "404":
          description: Diagram not found
      x-snr-doc-urls:
        - /api-reference/automation#tag/Workflows/operation/getDiagramStatistics
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/statistics?timePeriod=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", "/automation-brain/diagrams/%7BdiagramId%7D/statistics?timePeriod=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/automation-brain/diagrams/%7BdiagramId%7D/statistics?timePeriod=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": "/automation-brain/diagrams/%7BdiagramId%7D/statistics?timePeriod=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/automation-brain/diagrams/%7BdiagramId%7D/statistics');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'timePeriod' => '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/automation-brain/diagrams/%7BdiagramId%7D/statistics?timePeriod=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /automation-brain/diagrams/{diagramId}/blocks/{blockId}/statistics:
    get:
      security:
        - JWT: []
      tags:
        - Workflows
      summary: Get node statistics
      operationId: getBlockStatistics
      description: |
        Retrieve execution statistics for a single block enriched with block metadata (name, type).

        ---

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

        **User role permission required:** `automation_2_journeys: read`
      parameters:
        - $ref: "#/components/parameters/automation-brain-diagramId"
        - name: blockId
          in: path
          description: UUID of the node
          required: true
          schema:
            type: string
        - name: timePeriod
          in: query
          description: Time period for statistics
          required: false
          schema:
            type: string
            enum:
              - currentHour
              - currentDay
              - previousHour
              - previousDay
      responses:
        "200":
          description: Block statistics with block info
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/automation-brain-ExternalBlockStatsWithInfo"
        "400":
          $ref: "#/components/responses/automation-brain-genericError"
        "403":
          description: Insufficient permissions to perform this action
        "404":
          description: Diagram or block not found
      x-snr-doc-urls:
        - /api-reference/automation#tag/Workflows/operation/getBlockStatistics
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/automation-brain/diagrams/%7BdiagramId%7D/blocks/%7BblockId%7D/statistics?timePeriod=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", "/automation-brain/diagrams/%7BdiagramId%7D/blocks/%7BblockId%7D/statistics?timePeriod=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/automation-brain/diagrams/%7BdiagramId%7D/blocks/%7BblockId%7D/statistics?timePeriod=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": "/automation-brain/diagrams/%7BdiagramId%7D/blocks/%7BblockId%7D/statistics?timePeriod=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/automation-brain/diagrams/%7BdiagramId%7D/blocks/%7BblockId%7D/statistics');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'timePeriod' => '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/automation-brain/diagrams/%7BdiagramId%7D/blocks/%7BblockId%7D/statistics?timePeriod=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /morph/logs/automation/{automationWorkflowId}/last-run/with-stages:
    get:
      tags:
        - Data Processing Job Logs
      operationId: getExtendedInfoAboutLastRun
      summary: Get last log with stages
      description: |
        
        Retrieve the status of a workflow's last run and its stages.

        The workflow must contain at least one of the following nodes:
        - Any Data Transformation node
        - Any node that pulls data into a workflow (for example local file, SFTP, Azure Blob Storage)
        - Any node that pushes data out of the workflow (for example SFTP, Pub/Sub)
        - Any node that imports data into Synerise


        ---

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

        **User role permission required:** `automation_2_journeys: read`
      parameters:
        - name: automationWorkflowId
          in: path
          required: true
          description: "`diagramId` of the workflow to fetch last job from"
          schema:
            type: string
            format: uuid
        - $ref: "#/components/parameters/morph-LogsLimitInQuery"
      responses:
        "200":
          description: Information about last data transformation journey status
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/morph-DtDiagramLastRunResponse"
        "401":
          $ref: "#/components/responses/morph-401"
        "403":
          $ref: "#/components/responses/morph-403"
        "404":
          description: |
            - workflow doesn't exist; 
            - no journeys exist for a workflow; 
            - workflow doesn't contain any of the required nodes (returns a "no journeys found" error)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/morph-HttpErrorDetails"
              example:
                error: Not found
                status: 404
                timestamp: 2023-09-06T11:54:08.564Z
                message: No journeys for diagram fe7e3a80-91bb-433a-94cf-744253cc442c found
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/automation#tag/Data-Processing-Job-Logs/operation/getExtendedInfoAboutLastRun
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/morph/logs/automation/%7BautomationWorkflowId%7D/last-run/with-stages?limit=SOME_NUMBER_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", "/morph/logs/automation/%7BautomationWorkflowId%7D/last-run/with-stages?limit=SOME_NUMBER_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/morph/logs/automation/%7BautomationWorkflowId%7D/last-run/with-stages?limit=SOME_NUMBER_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": "/morph/logs/automation/%7BautomationWorkflowId%7D/last-run/with-stages?limit=SOME_NUMBER_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/morph/logs/automation/%7BautomationWorkflowId%7D/last-run/with-stages');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'limit' => 'SOME_NUMBER_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/morph/logs/automation/%7BautomationWorkflowId%7D/last-run/with-stages?limit=SOME_NUMBER_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
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.
    TrackerKey:
      type: apiKey
      name: token
      in: query
      description: Authorization by tracker key sent as a query parameter. This is the same key as used in the website tracking code.
  schemas:
    automation-brain-HTTP400:
      type: object
      properties:
        error:
          type: string
          description: Summary of the error
        status:
          type: integer
          format: int32
          description: Status code
        timestamp:
          type: string
          description: Time when the message was sent
        message:
          type: string
          description: Description of the problem
    automation-brain-PaginatedDiagrams:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          description: An array of workflows
          items:
            $ref: "#/components/schemas/automation-brain-DiagramDetails"
        meta:
          $ref: "#/components/schemas/automation-brain-Pagination"
    automation-brain-Pagination:
      type: object
      description: Pagination data
      required:
        - limit
        - page
        - totalPages
        - totalCount
      properties:
        limit:
          type: number
          example: 3
          description: Maximum number of items per page
        page:
          type: number
          example: 1
          description: Current page number
        totalPages:
          type: number
          example: 10
          description: Total number of pages
        totalCount:
          description: Total number of workflows on all pages
          type: number
          example: 29
    automation-brain-DiagramDetails:
      type: object
      description: Details of the workflow
      required:
        - diagramId
        - author
        - listingAuthor
        - name
        - created
        - updated
        - status
        - scheduleStatus
        - configuration
        - catalogId
        - context
        - tags
        - description
        - hasTransformation
        - businessProfileId
      properties:
        diagramId:
          description: UUID of the workflow
          type: string
          example: 030a9be3-8ccc-44c7-b20b-27768816cab7
        author:
          description: Author of the workflow
          type: string
          example: example@synerise.com
        listingAuthor:
          type: object
          properties:
            userId:
              type: number
            clientId:
              type: number
            clientApiHash:
              type: string
            businessProfileApiHash:
              type: string
        name:
          description: Name of the workflow
          type: string
          example: Example name
        created:
          description: Creation time
          type: string
          format: date-time
          example: 2019-01-04T13:17:18.315Z
        updated:
          description: Last update time
          type: string
          format: date-time
          example: 2019-01-04T13:17:18.315Z
        status:
          $ref: "#/components/schemas/automation-brain-DiagramStatus"
        scheduleStatus:
          description: Workflow schedule status
          type: string
          enum:
            - On
            - Off
            - NoSchedule
        configuration:
          $ref: "#/components/schemas/automation-brain-DiagramConfiguration"
        catalogId:
          description: UUID of the catalog where the workflow is saved
          type: string
          example: 030a9be3-8ccc-44c7-b20b-27768816cab7
        context:
          $ref: "#/components/schemas/automation-brain-AutomationContext"
        tags:
          description: Tags associated with this workflow
          type: array
          items:
            $ref: "#/components/schemas/automation-brain-TagDetails"
        description:
          description: Workflow description
          type: string
          example: Sample workflow description
        hasTransformation:
          type: boolean
          description: "`true` if the workflow contains Data Transformation nodes"
        businessProfileId:
          type: number
    automation-brain-TagDetails:
      type: object
      required:
        - hash
        - value
        - color
      properties:
        hash:
          type: string
          example: 030a9be3-8ccc-44c7-b20b-27768816cab7
          description: Unique ID of the tag
        value:
          type: string
          description: Name of the tag
        color:
          type: string
          description: Color of the tag, hexadecimal
          example: "#0b68ff"
        description:
          type: string
          description: Description of the tag
        icon:
          type: string
          description: URL of the tag's icon
    automation-brain-AutomationContext:
      description: |
        Context of the workflow.
        - `Client` workflows are triggered by "Profile Event"; "Data Changed"; and "Audience" nodes.
        - `Business` workflows are triggered by "Business Event" and "Scheduled Run" nodes.
        - `Undefined` workflows have no trigger and can't be started until their configuration is finished.
      type: string
      enum:
        - Client
        - Business
        - Undefined
    automation-brain-DiagramConfiguration:
      description: Workflow configuration
      type: object
      properties:
        capping:
          $ref: "#/components/schemas/automation-brain-LimitConfiguration"
        multipleJourneys:
          type: boolean
          description: Diagram has multiple journeys enabled
          default: false
    automation-brain-LimitConfiguration:
      type: object
      description: Capping configuration of the workflow
      required:
        - limit
        - period
      properties:
        limit:
          type: number
          description: The maximum number of times the a journey for a single profile within the limits defined in `period`
        period:
          type: object
          description: The time period for the quantitative limit defined in `limit`
          required:
            - type
          properties:
            type:
              type: string
              description: |-
                The type of time limit. `Time` is the only type available for workflows. A journey can be started X times in a period defined by `timeSeconds`.
                X is defined by the `limit` field.
              enum:
                - Time
            timeSeconds:
              type: number
              description: The length of the limit, in seconds (the limit is always calculated into seconds, even if another unit of time is used in the Synerise Web Application).
    automation-brain-DiagramStatus:
      type: string
      description: The status of a diagram
      enum:
        - Draft
        - Pending
        - Running
        - Paused
        - Stopped
    automation-brain-PaginatedDiagramsV2:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          description: An array of workflows
          items:
            $ref: "#/components/schemas/automation-brain-DiagramDetails"
        meta:
          $ref: "#/components/schemas/automation-brain-PaginationV2"
    automation-brain-PaginationV2:
      type: object
      description: Pagination data
      required:
        - limit
        - links
      properties:
        limit:
          type: number
          example: 3
          description: Maximum number of items per page
        links:
          type: array
          items:
            $ref: "#/components/schemas/automation-brain-ListingLink"
    automation-brain-ListingLink:
      type: object
      required:
        - rel
        - url
      properties:
        rel:
          type: string
          example: first
        url:
          type: string
          example: http://automation-brain/v2/diagrams?page=1&limit=10
    automation-brain-Error:
      type: object
      properties:
        httpStatus:
          type: integer
          description: HTTP status code of error
        errorCode:
          type: string
          description: Synerise error code. See [API error reference](https://developers.synerise.com/errors.html)
        message:
          type: string
          description: A description of the problem
        timestamp:
          type: string
          format: date-time
          description: Time when the problem occurred
        help:
          type: string
          description: Link to the error reference
        traceId:
          type: string
          description: Trace ID for troubleshooting
        errors:
          type: array
          description: Array of errors
          items:
            $ref: "#/components/schemas/automation-brain-Error"
        source:
          $ref: "#/components/schemas/automation-brain-PointerSource"
        details:
          $ref: "#/components/schemas/automation-brain-ErrorDetails"
        field:
          type: string
          description: JSON field which caused a problem
      required:
        - errorCode
        - httpStatus
        - message
    automation-brain-ErrorDetails:
      type: object
      description: Additional details
      additionalProperties:
        type: string
    automation-brain-PointerSource:
      type: object
      description: Source of the problem
      properties:
        pointer:
          type: string
        value:
          type: string
      required:
        - pointer
    automation-brain-DiagramActionRequest:
      type: object
      properties:
        scheduleAction:
          type: string
          enum:
            - On
            - Off
            - NoAction
    automation-brain-ExternalDiagramStatsWithInfo:
      type: object
      required:
        - started
        - finished
        - inProgress
        - blocks
      properties:
        started:
          type: integer
          format: int64
          description: The number of times a workdlow was started (a trigger node was activated)
        finished:
          type: integer
          format: int64
          description: The number of times an "End" node was reached.
        inProgress:
          type: integer
          format: int64
          description: The number of profiles currently in the workflow.
        blocks:
          type: object
          description: Statistics for individual nodes.
          additionalProperties:
            $ref: "#/components/schemas/automation-brain-ExternalBlockStatsWithInfo"
    automation-brain-ExternalBlockStatsWithInfo:
      type: object
      description: The name of this object is the UUID of the node
      required:
        - type
        - entered
      properties:
        name:
          type: string
          description: Name of the node, if defined
        type:
          type: string
          description: Node type
          example: EventTrigger
        entered:
          type: integer
          format: int64
          description: The number of profiles which entered this node
        executed:
          type: integer
          format: int64
          description: "The number of profiles which completed this node. NOT available for: Trigger nodes, End nodes, ABx Test nodes, Split Path nodes, and Merge Paths nodes."
      additionalProperties:
        type: integer
        description: Additional statistics, depending on node type. See the [User guide](https://hub.synerise.com/docs/automation/automation-activity-tracking/#statistics-reference) for a list.
        format: int64
    morph-HttpErrorDetails:
      type: object
      required:
        - error
        - status
      properties:
        error:
          type: string
          description: Summary of the error
        status:
          type: integer
          format: int32
          description: Status code
        timestamp:
          type: string
          description: Time when the error occurred
        message:
          type: string
          description: Description of the problem. If an error code is included, check the [API Error Reference](https://developers.synerise.com/errors.html) for details.
    morph-DtDiagramLastRunResponse:
      type: object
      required:
        - startTime
        - pipelineResponse
        - overallRunStatus
      properties:
        startTime:
          $ref: "#/components/schemas/morph-StartTime"
        runId:
          $ref: "#/components/schemas/morph-RunId"
        pipelineResponse:
          $ref: "#/components/schemas/morph-AutomationLogsResponse"
        overallRunStatus:
          $ref: "#/components/schemas/morph-JobStatus"
    morph-JobStatus:
      type: string
      description: High-level status of the job. If a given type of job doesn't exist in a workflow (for example, `transformData` in a workflow without any Data Transformation nodes), the status is `Pending`.
      enum:
        - Pending
        - InProgress
        - Finished
        - Failed
        - Warning
      example: Pending
    morph-AutomationLogsResponse:
      description: Logs for each stage in the workflow
      type: object
      properties:
        importData:
          description: Logs for pulling data into the workflow
          allOf:
            - $ref: "#/components/schemas/morph-LogsForStage"
        transformData:
          description: Logs for Data Transformation processing
          allOf:
            - $ref: "#/components/schemas/morph-LogsForStage"
        exportData:
          description: Logs for pushing data from the workflow
          allOf:
            - $ref: "#/components/schemas/morph-LogsForStage"
    morph-LogsForStage:
      type: object
      required:
        - status
        - logs
        - logsSize
      properties:
        status:
          $ref: "#/components/schemas/morph-JobStatus"
        runDate:
          type: string
          description: Time when this job started
          example: 2022-01-31T12:37:25.109Z
        logs:
          type: array
          description: An array of log lines
          items:
            type: string
            example: 2022-01-31T12:37:25.109412Z INFO Job finished with success!
        logsSize:
          type: number
          description: The number of returned log lines
        failedRecordsFileId:
          type: string
          format: uuid
          description: UUID of the input file that couldn't be processed
        successCount:
          type: integer
          description: Number of rows successfully processed by the job
        failureCount:
          type: integer
          description: Number of rows that failed during processing by the job
    morph-RunId:
      type: string
      format: uuid
      description: "`journeyId` of the last Automation run"
    morph-StartTime:
      description: Time when the journey started
      type: string
      format: date-time
      example: 2023-09-05T14:07:44.264Z
  parameters:
    automation-brain-directoryId:
      name: directoryId
      in: query
      description: UUID of the directory
      schema:
        type: string
        format: uuid
    automation-brain-search:
      name: search
      in: query
      description: A string to search for in workflow names and email addresses of authors. Workflows that don't match the search aren't returned at all.
      schema:
        type: string
    automation-brain-sortingOrder:
      name: order
      in: query
      description: Sorting order
      schema:
        type: string
        enum:
          - Asc
          - Desc
        default: Desc
    automation-brain-sortByDiagrams:
      name: sortBy
      in: query
      description: Sort workflows clause
      example: createdTime:desc
      schema:
        type: string
    automation-brain-sortDiagrams:
      name: sort
      in: query
      description: Sort workflows by a property value
      schema:
        type: string
        enum:
          - Author
          - Name
          - CreatedTime
          - UpdatedTime
          - Status
        default: UpdatedTime
    automation-brain-filterByStatus:
      name: status
      in: query
      description: Filter workflows by status
      schema:
        type: string
        enum:
          - All
          - Recent
          - Draft
          - Pending
          - Active
          - Paused
          - Stopped
          - Inactive
          - Scheduled
          - NoSchedule
          - ScheduleOn
          - ScheduleOff
        default: All
    automation-brain-limit:
      name: limit
      in: query
      description: Selected page
      schema:
        type: number
        default: 10
    automation-brain-page:
      name: page
      in: query
      description: The selected page
      schema:
        type: number
        default: 1
        minimum: 1
    automation-brain-tagIds:
      name: tags
      in: query
      required: false
      schema:
        type: string
        description: List of comma separated tags
    automation-brain-limit50:
      name: limit
      in: query
      description: Selected page
      schema:
        type: number
        default: 50
    automation-brain-diagramId:
      name: diagramId
      in: path
      description: UUID of the workflow/diagram.
      required: true
      schema:
        type: string
    morph-LogsLimitInQuery:
      name: limit
      in: query
      required: false
      schema:
        type: number
        default: 500
        maximum: 5000
      description: The maximum number of log lines in each stage
  responses:
    automation-brain-404:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/automation-brain-HTTP400"
    automation-brain-403:
      description: Forbidden; insufficient permissions
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/automation-brain-HTTP400"
    automation-brain-401:
      description: "Unauthorized: wrong consumer scope; token missing/expired/invalid; invalid API key; etc."
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/automation-brain-HTTP400"
    automation-brain-400:
      description: "Bad request: input data missing or malformed"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/automation-brain-HTTP400"
    automation-brain-genericError:
      description: See error message for details
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/automation-brain-Error"
    morph-403:
      description: Forbidden; insufficient permissions
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/morph-HttpErrorDetails"
    morph-401:
      description: "Unauthorized: wrong consumer scope; token missing/expired/invalid; invalid API key; etc."
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/morph-HttpErrorDetails"
