{
  "openapi": "3.0.1",
  "info": {
    "title": "Apify Dataset Quality Gate & Validation Integration",
    "description": "Use this Actor to analyze apify dataset quality gate and validation integration and return decision-ready structured signals. Validate any Apify dataset before downstream use with required-field, duplicate, null-rate and minimum-size checks, producing a structured pass/fail quality score for Actor-t",
    "version": "0.0",
    "x-build-id": "peZN8pxAaLEBp4VcS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/quanmatrix~dataset-quality-gate-integration/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-quanmatrix-dataset-quality-gate-integration",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/quanmatrix~dataset-quality-gate-integration/runs": {
      "post": {
        "operationId": "runs-sync-quanmatrix-dataset-quality-gate-integration",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/quanmatrix~dataset-quality-gate-integration/run-sync": {
      "post": {
        "operationId": "run-sync-quanmatrix-dataset-quality-gate-integration",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "datasetId": {
            "title": "Dataset ID (advanced/manual)",
            "type": "string",
            "description": "Optional Apify dataset ID. Leave empty when the Actor is triggered as an integration; it will use payload.resource.defaultDatasetId automatically."
          },
          "items": {
            "title": "Inline items (test/manual)",
            "type": "array",
            "description": "Optional inline JSON objects for testing or small manual checks. If supplied, these are evaluated instead of a remote dataset.",
            "items": {
              "type": "object"
            }
          },
          "requiredFields": {
            "title": "Required fields",
            "type": "array",
            "description": "Field names that must be present and non-null in every evaluated item. Dot-path nesting is not interpreted; use top-level fields.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "uniqueField": {
            "title": "Unique field",
            "type": "string",
            "description": "Optional top-level field whose duplicate rate should be measured, such as id, url, email, or product_id."
          },
          "maxDuplicateRatePct": {
            "title": "Maximum duplicate rate (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Fail the quality gate when the duplicate rate for uniqueField exceeds this percentage.",
            "default": 1
          },
          "maxNullRatePct": {
            "title": "Maximum required-field null rate (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Fail when the combined missing/null rate across required fields exceeds this percentage.",
            "default": 5
          },
          "minItems": {
            "title": "Minimum items",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Minimum number of evaluated items required for the dataset to pass.",
            "default": 1
          },
          "minimumQualityScore": {
            "title": "Minimum quality score",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Minimum final 0–100 quality score required to pass.",
            "default": 80
          },
          "maxItems": {
            "title": "Maximum items to evaluate",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Safety cap for this run. Remote datasets are processed in batches up to this many items.",
            "default": 10000
          },
          "batchSize": {
            "title": "Batch size",
            "minimum": 50,
            "maximum": 5000,
            "type": "integer",
            "description": "Number of remote dataset items read per batch.",
            "default": 500
          },
          "uniqueFields": {
            "title": "Unique fields",
            "type": "array",
            "description": "Top-level fields that should be unique across evaluated records, such as id, url, sku, or email.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "expectedSchema": {
            "title": "Expected top-level field types",
            "type": "object",
            "description": "Optional JSON object mapping field names to expected JSON types: string, number, integer, boolean, object, array, or null.",
            "default": {}
          },
          "formatRules": {
            "title": "Format rules",
            "type": "object",
            "description": "Optional JSON object mapping fields to format checks: url, email, date, or datetime.",
            "default": {}
          },
          "maxFormatErrorRatePct": {
            "title": "Maximum format error rate (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Fail if configured format-rule errors exceed this percentage of checked values.",
            "default": 0
          },
          "previousSchemaFingerprint": {
            "title": "Previous schema fingerprint",
            "type": "string",
            "description": "Optional fingerprint from a previous successful run. When supplied, the Actor reports whether the observed top-level schema drifted."
          },
          "failOnSchemaDrift": {
            "title": "Fail on schema drift",
            "type": "boolean",
            "description": "Treat a changed schema fingerprint as a quality-gate failure when previousSchemaFingerprint is supplied.",
            "default": false
          },
          "failRunOnError": {
            "title": "Fail Actor run when gate fails",
            "type": "boolean",
            "description": "After writing the quality report, fail the Actor run if the quality gate did not pass. Useful for CI/CD and downstream integration stopping.",
            "default": false
          },
          "itemOrder": {
            "title": "Dataset item order",
            "enum": [
              "first",
              "last"
            ],
            "type": "string",
            "description": "Evaluate earliest or latest stored records first.",
            "default": "first"
          },
          "itemOffset": {
            "title": "Item offset",
            "minimum": 0,
            "maximum": 100000000,
            "type": "integer",
            "description": "Skip this many records before evaluation.",
            "default": 0
          },
          "validateAllItems": {
            "title": "Paginate through dataset",
            "type": "boolean",
            "description": "When enabled, keep reading batches until the dataset ends or maxItems is reached. When disabled, evaluate one batch only.",
            "default": true
          },
          "valuePerImpactUnitUsd": {
            "title": "Value per impact unit (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Optional user-supplied USD value per detected impact unit. Used only for transparent economic impact estimates."
          },
          "monthlyRuns": {
            "title": "Monthly runs for impact estimate",
            "minimum": 1,
            "type": "integer",
            "description": "Optional number of comparable monthly runs used with value per impact unit for the economic estimate.",
            "default": 1
          },
          "previousAnalysis": {
            "title": "Previous Gen2 analysis",
            "type": "object",
            "description": "Optional previous Gen2 output used to compare decision metrics and detect regression between analyses.",
            "default": {}
          },
          "mcpConnectors": {
            "title": "MCP output connectors",
            "type": "array",
            "description": "Optional MCP connectors authorized in your Apify account. Use them to send or write this Actor result to tools such as Slack, Notion, GitHub, Sentry, Supabase, or another compatible MCP service."
          },
          "mcpToolName": {
            "title": "MCP tool name",
            "type": "string",
            "description": "Optional exact MCP tool name. Leave blank to let the selected MCP action preset discover a compatible tool automatically.",
            "default": ""
          },
          "mcpToolArguments": {
            "title": "MCP tool arguments",
            "type": "object",
            "description": "JSON object passed to the selected MCP tool. String values may use {{actor_title}}, {{result_summary}}, or {{result_json}} placeholders.",
            "default": {}
          },
          "mcpFailOnError": {
            "title": "Fail run if MCP delivery fails",
            "type": "boolean",
            "description": "When enabled, an MCP delivery error fails the Actor run. Disabled by default so data extraction and intelligence results remain available even if the external destination is unavailable.",
            "default": false
          },
          "mcpActionPreset": {
            "title": "MCP action preset",
            "enum": [
              "AUTO_SAFE_WRITE",
              "SLACK_MESSAGE",
              "GITHUB_ISSUE",
              "NOTION_PAGE",
              "DATABASE_WRITE",
              "CUSTOM"
            ],
            "type": "string",
            "description": "Choose a safe action pattern. AUTO_SAFE_WRITE discovers a compatible non-destructive write tool automatically; use a specific preset for Slack, GitHub, Notion, or database delivery.",
            "default": "AUTO_SAFE_WRITE"
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}