{
  "info": {
    "title": "data-governance/data-qualities",
    "version": ""
  },
  "paths": {
    "/api/data-governance/data-qualities/computations": {
      "post": {
        "tags": [
          "computation"
        ],
        "summary": "Trigger data quality computation",
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComputationResponse"
                }
              }
            },
            "headers": {
              "location": {
                "schema": {
                  "type": "string"
                },
                "description": "URL to retrieve the computation status."
              }
            },
            "description": "Computation triggered. The response body contains the `computationId` for tracking progress."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is in incorrect format."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "User does not have valid authentication credentials."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "User does not have access to the resource."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Requested service is not available."
          }
        },
        "description": "Triggers a full data quality computation for a dataset, running profile calculation followed by data quality\nassessment. Returns a `computationId` that can be used to track progress via the computation status endpoint\n(`GET /data-governance/data-qualities/computations/{computationId}`). The computation runs asynchronously.\nPoll the status endpoint until `status` is `SUCCEEDED` or `FAILED`.\n",
        "operationId": "requestDataQualityComputation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataQualityComputationRequest"
              }
            }
          },
          "required": true
        },
        "x-qlik-stability": "stable",
        "x-qlik-visibility": "public",
        "x-qlik-deprecated": false,
        "x-qlik-replaces": [
          {
            "namespace": "",
            "uniqueIdentifier": "POST:/v1/data-qualities/computations"
          }
        ],
        "x-qlik-tier": {
          "tier": "2",
          "limit": 100
        }
      }
    },
    "/api/data-governance/data-qualities/computations/{computationId}": {
      "get": {
        "tags": [
          "computation"
        ],
        "summary": "Get data quality computation status",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComputationStatusResponse"
                }
              }
            },
            "description": "Current execution status of the computation."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is in incorrect format."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "User does not have valid authentication credentials."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "User does not have access to the resource."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No computation found with the specified `computationId`."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Requested service is not available."
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "computationId",
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9-]{1,36}$"
            },
            "example": "4db06daa-3117-412e-8fb4-b29c937f9a0e",
            "required": true,
            "description": "The unique identifier of the computation, as returned by `POST /data-governance/data-qualities/computations`."
          }
        ],
        "description": "Retrieves the current execution status of a data quality computation. Poll this endpoint after triggering a\ncomputation to determine when results are available. The `status` field returns one of `REQUESTED`,\n`SUBMITTED`, `PROFILE_REQUESTED`, `SUCCEEDED`, `FAILED`, or `PROFILE_FAILED`.\n",
        "operationId": "getDataQualityComputation",
        "x-qlik-stability": "stable",
        "x-qlik-visibility": "public",
        "x-qlik-deprecated": false,
        "x-qlik-replaces": [
          {
            "namespace": "",
            "uniqueIdentifier": "GET:/v1/data-qualities/computations/{computationId}"
          }
        ],
        "x-qlik-tier": {
          "tier": "1",
          "limit": 1000
        }
      }
    },
    "/api/data-governance/data-qualities/global-results": {
      "get": {
        "tags": [
          "data-quality"
        ],
        "summary": "Get global data quality",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetQualityGlobalResultsResponse"
                }
              }
            },
            "description": "Global quality results for the dataset, including counts of valid, invalid, empty, and total sample cells per connection."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "The request is in incorrect format."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "User does not have valid authentication credentials."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "User does not have access to the resource."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "No quality results found for the specified dataset."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Requested service is not available."
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/DatasetIdInQuery"
          },
          {
            "$ref": "#/components/parameters/OptionalConnectionIdInQuery"
          }
        ],
        "description": "Retrieves the global quality results for a dataset, showing counts of valid, invalid, empty, and total\nsample cells.\n",
        "operationId": "getDataQualityGlobalResults",
        "x-qlik-stability": "stable",
        "x-qlik-visibility": "public",
        "x-qlik-deprecated": false,
        "x-qlik-replaces": [
          {
            "namespace": "",
            "uniqueIdentifier": "GET:/v1/data-qualities/global-results"
          }
        ],
        "x-qlik-tier": {
          "tier": "1",
          "limit": 1000
        }
      }
    }
  },
  "openapi": "3.0.0",
  "components": {
    "parameters": {
      "DatasetIdInQuery": {
        "in": "query",
        "name": "datasetId",
        "schema": {
          "$ref": "#/components/schemas/DatasetIdType"
        },
        "required": true,
        "description": "The unique identifier of the dataset."
      },
      "OptionalConnectionIdInQuery": {
        "in": "query",
        "name": "connectionId",
        "schema": {
          "$ref": "#/components/schemas/ConnectionIdType"
        },
        "required": false,
        "description": "The unique identifier of the connection."
      }
    },
    "schemas": {
      "ComputationResponse": {
        "type": "object",
        "required": [
          "computationId"
        ],
        "properties": {
          "computationId": {
            "type": "string",
            "description": "The unique identifier of the triggered computation. Use this value to poll for status."
          }
        },
        "description": "Response returned when a data quality computation is successfully triggered."
      },
      "ComputationStatusResponse": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "$ref": "#/components/schemas/ExecutionStatus"
          }
        }
      },
      "ConnectionIdType": {
        "type": "string",
        "example": "2b855c3d-426c-4aac-90cf-0edf9fc294d3",
        "pattern": "^[0-9a-zA-Z-]{1,36}$",
        "description": "The ID of the connection"
      },
      "DataQualityComputationRequest": {
        "type": "object",
        "allOf": [
          {
            "type": "object",
            "properties": {
              "datasetId": {
                "$ref": "#/components/schemas/DatasetIdType"
              },
              "connectionId": {
                "$ref": "#/components/schemas/ConnectionIdType"
              }
            }
          },
          {
            "$ref": "#/components/schemas/SamplingConfiguration"
          }
        ],
        "example": {
          "datasetId": "669144f5aa2d642638ef1dd0",
          "sampleMode": "ABSOLUTE",
          "sampleSize": 10000,
          "connectionId": "2b855c3d-426c-4aac-90cf-0edf9fc294d3",
          "executionMode": "PULLUP"
        },
        "required": [
          "datasetId"
        ],
        "description": "Request payload for triggering a data quality computation. The `connectionId` is optional for file-based datasets.\nIf none of the sampling parameters are provided, the following defaults apply:\n- `executionMode: PULLUP`\n- `sampleMode: ABSOLUTE`\n- `sampleSize: 1000`\n"
      },
      "DatasetIdType": {
        "type": "string",
        "example": "669144f5aa2d642638ef1dd0",
        "pattern": "^[0-9a-zA-Z-]{1,36}$",
        "description": "The ID of the dataset"
      },
      "DatasetQualityGlobalResultsResponse": {
        "type": "object",
        "required": [
          "datasetId",
          "qualities"
        ],
        "properties": {
          "datasetId": {
            "type": "string",
            "description": "The unique identifier of the dataset."
          },
          "qualities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QualitiesGlobalResultsResponse"
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Error"
            }
          },
          "traceId": {
            "type": "string"
          }
        }
      },
      "ExecutionStatus": {
        "enum": [
          "PROFILE_REQUESTED",
          "PROFILE_FAILED",
          "REQUESTED",
          "SUBMITTED",
          "SUCCEEDED",
          "FAILED"
        ],
        "type": "string",
        "example": "SUCCEEDED"
      },
      "QualitiesGlobalResultsResponse": {
        "type": "object",
        "required": [
          "connectionId",
          "quality"
        ],
        "properties": {
          "quality": {
            "$ref": "#/components/schemas/QualityGlobalResultsResponse"
          },
          "connectionId": {
            "type": "string",
            "description": "The unique identifier of the connection."
          }
        }
      },
      "QualityGlobalResultsResponse": {
        "type": "object",
        "required": [
          "valid",
          "invalid",
          "empty",
          "total",
          "updatedAt"
        ],
        "properties": {
          "empty": {
            "type": "integer",
            "format": "int64",
            "description": "Number of empty sample cells."
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Total number of cells in the sample."
          },
          "valid": {
            "type": "integer",
            "format": "int64",
            "description": "Number of valid sample cells."
          },
          "invalid": {
            "type": "integer",
            "format": "int64",
            "description": "Number of invalid sample cells."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "example": "2023-10-01T12:00:00Z",
            "description": "Timestamp of the most recent data quality computation for this dataset and connection."
          }
        }
      },
      "SamplingConfiguration": {
        "type": "object",
        "properties": {
          "sampleMode": {
            "enum": [
              "ABSOLUTE",
              "RELATIVE"
            ],
            "type": "string",
            "example": "ABSOLUTE",
            "description": "Specifies how the dataset is sampled. `ABSOLUTE` represents a fixed number of rows, while `RELATIVE` refers to a percentage of the total dataset rows."
          },
          "sampleSize": {
            "type": "integer",
            "format": "int64",
            "example": 10000,
            "maximum": 100000,
            "minimum": 1,
            "description": "The actual value of the selected sampling method size (either a fixed number for `ABSOLUTE` mode or a percentage for `RELATIVE` mode). Maximum allowed value for `ABSOLUTE` mode is `100000`."
          },
          "executionMode": {
            "enum": [
              "PUSHDOWN",
              "PULLUP"
            ],
            "type": "string",
            "example": "PULLUP",
            "description": "Specifies where the data quality computation takes place. In `PUSHDOWN` mode, it runs within the Cloud Data Warehouse (e.g., Snowflake, Databricks), whereas in `PULLUP` mode, it runs in Qlik Cloud."
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://{tenant}.{region}.qlikcloud.com",
      "variables": {
        "region": {
          "default": "us",
          "description": "The region the tenant is hosted in"
        },
        "tenant": {
          "default": "your-tenant",
          "description": "Name of the tenant that will be called"
        }
      }
    }
  ]
}