{
  "asyncapi": "3.0.0",
  "info": {
    "title": "reports",
    "version": ""
  },
  "channels": {
    "systemEventsReport": {
      "address": "system-events.report",
      "messages": {
        "reportCollected": {
          "$ref": "#/components/messages/report.reportCollected"
        },
        "reportTriggered": {
          "$ref": "#/components/messages/report.reportTriggered"
        }
      }
    }
  },
  "operations": {
    "reportCollected": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/systemEventsReport"
      },
      "messages": [
        {
          "$ref": "#/channels/systemEventsReport/messages/reportCollected"
        }
      ]
    },
    "reportTriggered": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/systemEventsReport"
      },
      "messages": [
        {
          "$ref": "#/channels/systemEventsReport/messages/reportTriggered"
        }
      ]
    }
  },
  "components": {
    "messages": {
      "report.reportCollected": {
        "name": "com.qlik.v1.report.collected",
        "tags": [
          {
            "name": "report"
          }
        ],
        "title": "Report processing data collected",
        "payload": {
          "type": "object",
          "allOf": [
            {
              "$ref": "#/components/schemas/cloudEventsContextAttributes"
            },
            {
              "$ref": "#/components/schemas/cloudEventsQlikExtensionsAttributes"
            },
            {
              "type": "object",
              "required": [
                "data",
                "type"
              ],
              "properties": {
                "data": {
                  "$ref": "#/components/schemas/dataPayload"
                },
                "type": {
                  "enum": [
                    "com.qlik.v1.report.collected"
                  ],
                  "type": "string",
                  "default": "com.qlik.v1.report.collected",
                  "description": "Unique identifier for the event type."
                }
              }
            }
          ]
        },
        "description": "Emitted when the processing of a report has completed, whether it succeeded or failed. It carries the report data and the outcome, and it is immediately followed by the report finished event, unless the latter is suppressed by configuration. It is not emitted for the parent request of a cycle-based request, but it is emitted for each report generated by the cycle.",
        "x-qlik-deprecated": false,
        "x-qlik-stability": "stable",
        "x-qlik-visibility": "public"
      },
      "report.reportTriggered": {
        "name": "com.qlik.v1.report.triggered",
        "tags": [
          {
            "name": "report"
          }
        ],
        "title": "Cycle-based report generation triggered",
        "payload": {
          "type": "object",
          "allOf": [
            {
              "$ref": "#/components/schemas/cloudEventsContextAttributes"
            },
            {
              "$ref": "#/components/schemas/cloudEventsQlikExtensionsAttributes"
            },
            {
              "type": "object",
              "required": [
                "data",
                "type"
              ],
              "properties": {
                "data": {
                  "$ref": "#/components/schemas/dataPayload"
                },
                "type": {
                  "enum": [
                    "com.qlik.v1.report.triggered"
                  ],
                  "type": "string",
                  "default": "com.qlik.v1.report.triggered",
                  "description": "Unique identifier for the event type."
                }
              }
            }
          ]
        },
        "description": "Event emitted when a cycle-based request has generated its individual report requests. A cycle-based request uses template cycle fields to produce multiple reports. Each generated report emits its own report collected and report finished events, while no report finished event is emitted for the parent request.",
        "x-qlik-deprecated": false,
        "x-qlik-stability": "stable",
        "x-qlik-visibility": "public"
      }
    },
    "schemas": {
      "act": {
        "type": "object",
        "properties": {
          "issuer": {
            "type": "string",
            "example": "example-issuer",
            "description": "Identifier of the issuer of the acting party's identity."
          },
          "subject": {
            "type": "string",
            "example": "0d5fff2b-8429-4184-b4e6-1bc08cd1c840",
            "description": "Identifier of the acting party (the sub claim of the act claim)."
          },
          "subtype": {
            "type": "string",
            "example": "service",
            "description": "Type of the acting party, for example user or service."
          }
        },
        "description": "The actor on whose behalf, or through which, the request was made, taken from the act claim of the access token (RFC 8693). It is present only when the request was made by a party acting for the principal identified by subject, for example a service acting for a user."
      },
      "cloudEventsContextAttributes": {
        "type": "object",
        "required": [
          "id",
          "source",
          "specversion",
          "type"
        ],
        "properties": {
          "id": {
            "type": "string",
            "examples": [
              "A234-1234-1234"
            ],
            "minLength": 1,
            "description": "Identifies the event."
          },
          "time": {
            "type": "string",
            "format": "date-time",
            "examples": [
              "2024-01-15T10:30:00Z"
            ],
            "minLength": 1,
            "description": "Timestamp of when the occurrence happened. Must adhere to RFC 3339."
          },
          "type": {
            "type": "string",
            "examples": [
              "com.qlik.v1.report.collected"
            ],
            "minLength": 1,
            "description": "Describes the type of event related to the originating occurrence."
          },
          "source": {
            "type": "string",
            "format": "uri-reference",
            "examples": [
              "com.qlik/reporting-service"
            ],
            "minLength": 1,
            "description": "Identifies the context in which an event happened."
          },
          "specversion": {
            "type": "string",
            "examples": [
              "1.0"
            ],
            "minLength": 1,
            "description": "The version of the CloudEvents specification which the event uses."
          },
          "datacontenttype": {
            "type": "string",
            "default": "application/json",
            "examples": [
              "application/json"
            ],
            "minLength": 1,
            "description": "Content type of the data value. Must adhere to RFC 2046 format."
          }
        },
        "description": "CloudEvents Specification JSON Schema"
      },
      "cloudEventsQlikExtensionsAttributes": {
        "type": "object",
        "required": [
          "tenantid"
        ],
        "properties": {
          "userid": {
            "type": "string",
            "examples": [
              "VZhiEfgW2bLd7HgR-jjzAh6VnicipweT"
            ],
            "description": "Unique identifier for the user triggering the event."
          },
          "authtype": {
            "type": "string",
            "examples": [
              "user"
            ],
            "description": "Representing the type of principal that triggered the occurrence."
          },
          "tenantid": {
            "type": "string",
            "examples": [
              "VZhiEfgW2bLd7HgR-jjzAh6VnicipweT"
            ],
            "description": "Unique identifier for the tenant related to the event."
          },
          "authclaims": {
            "type": "string",
            "examples": [
              "{\"sub\":\"VZhiEfgW2bLd7HgR-jjzAh6VnicipweT\"}"
            ],
            "description": "A JSON string representing claims of the principal that triggered the event."
          }
        }
      },
      "compositionTemplates": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/template"
        },
        "description": "Array of templates defining a composition"
      },
      "consumption": {
        "type": "object",
        "required": [
          "startTime",
          "endTime",
          "exportDurationMsecs",
          "objectCount",
          "senseSheetCount",
          "tcsUploadTimeMsecs"
        ],
        "properties": {
          "level": {
            "$ref": "#/components/schemas/levelStat"
          },
          "endTime": {
            "type": "string",
            "format": "date-time",
            "example": "2018-10-30T07:06:22Z",
            "description": "timestamp of when the response is ready."
          },
          "cellCount": {
            "type": "integer",
            "description": "Total number of data cells exported."
          },
          "startTime": {
            "type": "string",
            "format": "date-time",
            "example": "2018-10-30T07:06:22Z",
            "description": "timestamp of when the request arrives."
          },
          "objectCount": {
            "type": "integer",
            "description": "exported object count"
          },
          "maxCellCount": {
            "type": "integer",
            "description": "cell count of biggest data export"
          },
          "minCellCount": {
            "type": "integer",
            "description": "cell count of the smallest data export"
          },
          "variableCount": {
            "type": "integer",
            "description": "Number of variables applied to the report."
          },
          "taskRetryCount": {
            "type": "integer",
            "description": "Number of times tasks of the report were retried after a failure."
          },
          "senseSheetCount": {
            "type": "integer",
            "description": "Number of sheets in the request"
          },
          "dataDurationStat": {
            "$ref": "#/components/schemas/durationStat"
          },
          "queuingDelayStat": {
            "$ref": "#/components/schemas/durationStat"
          },
          "taskDurationStat": {
            "$ref": "#/components/schemas/taskDurationStat"
          },
          "chartDurationStat": {
            "$ref": "#/components/schemas/chartDurationStat"
          },
          "tcsUploadTimeMsecs": {
            "type": "integer",
            "description": "Total time in milliseconds spent uploading the generated report to the storage service."
          },
          "exportDurationMsecs": {
            "type": "integer",
            "description": "Total elapsed time in milliseconds from the arrival of the request to the completion of the report generation, including queuing time."
          },
          "openAppDurationStat": {
            "$ref": "#/components/schemas/durationStat"
          },
          "renderedDurationStat": {
            "$ref": "#/components/schemas/durationStat"
          },
          "applyFilterDurationStat": {
            "$ref": "#/components/schemas/durationStat"
          },
          "compositionDurationMsecs": {
            "type": "integer",
            "description": "Time in milliseconds spent composing the final output from the generated parts, for composition and template-based reports."
          },
          "applyVariablesDurationStat": {
            "$ref": "#/components/schemas/durationStat"
          }
        },
        "description": "Resource consumption of the report generation. All durations are expressed in milliseconds."
      },
      "dataExport": {
        "type": "object",
        "properties": {
          "vizType": {
            "type": "string",
            "description": "visualization type"
          },
          "cellCount": {
            "type": "integer",
            "description": "cell data count"
          },
          "rowNumber": {
            "type": "integer",
            "description": "number of data rows"
          },
          "columnNumber": {
            "type": "integer",
            "description": "number of data columns"
          }
        },
        "description": "Excel export info"
      },
      "dataPayload": {
        "type": "object",
        "examples": [
          {
            "reports": {
              "results": [
                {
                  "success": true,
                  "outputId": "Chart_image",
                  "timeMsecs": 150,
                  "serverError": false
                }
              ],
              "loadType": "batch",
              "templates": {
                "template": {
                  "appId": "ba2af9e6-0489-49a9-ae4d-8bf4a187f3c5",
                  "objectId": "uarJk",
                  "templateType": "sense-image-1.0"
                }
              },
              "templateType": "sense-image-1.0"
            },
            "traceId": "0af7651916cd43dd8448eb211c80319c",
            "version": "1.5.0",
            "reportId": "47604fcb-a07d-4549-92a4-38fe11e5eff8:0",
            "requestId": "47604fcb-a07d-4549-92a4-38fe11e5eff8",
            "consumption": {
              "endTime": "2018-10-30T07:06:22Z",
              "startTime": "2018-10-30T07:06:22Z",
              "objectCount": 1,
              "senseSheetCount": 1,
              "tcsUploadTimeMsecs": 20,
              "exportDurationMsecs": 500
            },
            "globalResult": "success",
            "browserLikeOrigin": true
          }
        ],
        "required": [
          "version",
          "requestId",
          "reportId",
          "browserLikeOrigin",
          "reports",
          "traceId",
          "globalResult",
          "consumption"
        ],
        "properties": {
          "act": {
            "$ref": "#/components/schemas/act"
          },
          "tags": {
            "$ref": "#/components/schemas/tags"
          },
          "issuer": {
            "type": "string",
            "example": "example-issuer",
            "description": "The issuer of the request from the jwt"
          },
          "reports": {
            "$ref": "#/components/schemas/reports"
          },
          "subject": {
            "type": "string",
            "example": "0d5fff2b-8429-4184-b4e6-1bc08cd1c840",
            "description": "The subject of the request from the jwt"
          },
          "subtype": {
            "type": "string",
            "example": "service",
            "description": "The subtype of the request from the jwt"
          },
          "traceId": {
            "type": "string",
            "description": "telemetry trace ID"
          },
          "version": {
            "type": "string",
            "example": "1.5.0",
            "description": "Version of the EventType, it uses semantic versioning."
          },
          "clientId": {
            "type": "string",
            "example": "47604fcb-a07d-4549-92a4-38fe11e5eff8",
            "description": "The unique ID identifying the client"
          },
          "reportId": {
            "type": "string",
            "example": "47604fcb-a07d-4549-92a4-38fe11e5eff8:0",
            "description": "Unique identifier of the report. It is an opaque string, consumers must not parse it or rely on its format."
          },
          "requestId": {
            "type": "string",
            "example": "47604fcb-a07d-4549-92a4-38fe11e5eff8",
            "description": "The unique ID identifying the request"
          },
          "consumption": {
            "$ref": "#/components/schemas/consumption"
          },
          "originalURL": {
            "type": "string",
            "example": "https://www.example.app/endpoint",
            "description": "The Original URL of the caller."
          },
          "globalResult": {
            "enum": [
              "success",
              "partial",
              "failed"
            ],
            "type": "string",
            "description": "All reports succeeded is \"success\", all reports failed is \"failed\", else is \"partial\"."
          },
          "browserLikeOrigin": {
            "type": "boolean",
            "example": true,
            "description": "The flag indicating the request is likely coming from a client."
          }
        },
        "description": "The data payload for a report processing event."
      },
      "durationStat": {
        "type": "object",
        "properties": {
          "failedCount": {
            "type": "integer",
            "description": "The number of failed exports"
          },
          "sampleCount": {
            "type": "integer",
            "description": "Total sample count"
          },
          "maxDurationMsecs": {
            "type": "integer",
            "description": "Max duration in milliseconds"
          },
          "minDurationMsecs": {
            "type": "integer",
            "description": "Min duration in milliseconds"
          },
          "totDurationMsecs": {
            "type": "integer",
            "description": "Total duration in milliseconds"
          }
        },
        "description": "Statistics of a set of timed operations. All durations are in milliseconds."
      },
      "error": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "example": "REP-400000",
            "description": "The unique code for the error."
          },
          "chartId": {
            "type": "string",
            "description": "Chart id."
          },
          "chartType": {
            "type": "string",
            "description": "Chart type."
          }
        },
        "description": "Error occurred during report generation."
      },
      "errors": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/error"
        },
        "description": "Array of errors that occurred during report generation."
      },
      "metaReport": {
        "type": "object",
        "properties": {
          "outputTtlSecs": {
            "type": "integer",
            "description": "Seconds to live of the final result artifacts"
          },
          "exportDeadlineSecs": {
            "type": "integer",
            "description": "The maximum interval in seconds, starting from the time the API request is received, within which a report must be produced"
          }
        },
        "description": "Report meta info"
      },
      "reports": {
        "type": "object",
        "required": [
          "loadType",
          "results",
          "templateType",
          "templates"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/metaReport"
          },
          "results": {
            "$ref": "#/components/schemas/results"
          },
          "loadType": {
            "type": "string",
            "example": "batch",
            "description": "Identifies the request load type that determines the engine workload. \"interactive\" is used for interactive downloads from the Sense UI. \"batch\" is used for scheduled reports. \"anonymous-batch\" is used for reports requested by anonymous users."
          },
          "templates": {
            "$ref": "#/components/schemas/templates"
          },
          "templateType": {
            "type": "string",
            "example": "sense-image-1.0",
            "description": "Template type and version using semantic versioning [composition-1.0 sense-image-1.0 sense-data-1.0 ... etc], Refer to API docs for the full list"
          }
        },
        "description": "The summary information on the triggered request"
      },
      "result": {
        "type": "object",
        "required": [
          "outputId",
          "success",
          "serverError",
          "timeMsecs"
        ],
        "properties": {
          "errors": {
            "$ref": "#/components/schemas/errors"
          },
          "format": {
            "type": "string",
            "description": "The output format"
          },
          "success": {
            "type": "boolean",
            "example": true,
            "description": "The flag indicating a successful report generation [true, false]"
          },
          "outputId": {
            "type": "string",
            "example": "Chart_image",
            "description": "The outputId [Chart_image, Chart_pdf, chart_excel, Sheet_pdf, Multisheet_PDF]."
          },
          "sizeBytes": {
            "type": "integer",
            "description": "output size in bytes"
          },
          "timeMsecs": {
            "type": "integer",
            "example": 150,
            "description": "The time elapsed in milliseconds"
          },
          "dataExport": {
            "$ref": "#/components/schemas/dataExport"
          },
          "serverError": {
            "type": "boolean",
            "description": "The flag indicating if there is a server/backend error"
          }
        },
        "description": "The object with information on report generation result."
      },
      "results": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/result"
        },
        "description": "Array of results that occurred during report generation."
      },
      "tag": {
        "type": "string",
        "example": "sense-dialog.download",
        "description": "A tag optionally set by the client that requested the report, to identify the feature that originated the request. It is a string with the format \"feature.subfeature\". The list of values currently in use is not exhaustive and may be extended.\nValues currently in use, by client:\n- Sense: `sense.sheet-thumbnail-generation` (thumbnails generation).\n- Sense dashboard: `sense-dialog.download` (image, pdf, data, sheet and story download), `sense-html-editor.download`, `sense-pixelperfect-editor.download`.\n- QlikView dashboard: `qlikview-client.download` (data export).\n- Office add-ins: `excel-addin.download`, `excel-addin.authoring`, `powerpoint-addin.download`, `powerpoint-addin.authoring`, `word-addin.download`, `word-addin.authoring`.\n- Sense on demand: `sense-ondemand.download`.\n- Insight advisor: `insight.snapshot`.\n- Subscriptions: `subscription.execution`.\n- Monitoring: `monitoring-chart.execution` (chart monitor).\n- Sharing and reporting tasks: `share.execution` (image share), `reporttask.execution` (template reports).\n- Notes: `notes.snapshot`.\n- Automations: `automation.execution`.\n- Qlik CLI: `qlik.simulation`.\n- Public API: `api.public`.\n- Sense capabilities API: `api.capabilities`.\n- Qlik MCP server: `qlik.mcp`.\n- App workflow orchestration: `app-preview.execution` (generate app preview)."
      },
      "tags": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/tag"
        },
        "description": "Array of tags sent by requester client."
      },
      "template": {
        "type": "object",
        "required": [
          "templateType",
          "appId",
          "objectId"
        ],
        "properties": {
          "appId": {
            "type": "string",
            "example": "ba2af9e6-0489-49a9-ae4d-8bf4a187f3c5",
            "description": "The unique identifier of the app the request is related to."
          },
          "objectId": {
            "type": "string",
            "example": "uarJk",
            "description": "The unique identifier of the app's object the report is related to."
          },
          "templateType": {
            "type": "string",
            "example": "sense-image-1.0",
            "description": "Template type and version using semantic versioning [composition-1.0 sense-image-1.0 sense-data-1.0 ... etc], Refer to API docs for the full list"
          }
        },
        "description": "The object with information for templateType"
      },
      "templates": {
        "type": "object",
        "properties": {
          "template": {
            "$ref": "#/components/schemas/template"
          },
          "compositionTemplates": {
            "$ref": "#/components/schemas/compositionTemplates"
          }
        },
        "description": "The template of the request: template holds a single template, compositionTemplates holds the ordered list of templates when the request is a composition."
      }
    }
  }
}