{
  "openapi": "3.0.1",
  "info": {
    "title": "Actor Schema Validator — Verify Output Matches Declared Schema",
    "description": "Actor Schema Validator. Available on the Apify Store with pay-per-event pricing.",
    "version": "1.0",
    "x-build-id": "CaffXOa6ae27AdYAk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~actor-schema-validator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-actor-schema-validator",
        "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/ryanclinton~actor-schema-validator/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-actor-schema-validator",
        "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/ryanclinton~actor-schema-validator/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-actor-schema-validator",
        "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",
        "required": [
          "targetActorId"
        ],
        "properties": {
          "targetActorId": {
            "title": "Target Actor ID",
            "type": "string",
            "description": "The actor ID or username/actor-name to check"
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "validate",
              "monitor",
              "diff"
            ],
            "type": "string",
            "description": "validate = one-off quality check. monitor = validate + drift tracking + alerts. diff = compare schemas of two actors.",
            "default": "validate"
          },
          "testInput": {
            "title": "Test Input (JSON)",
            "type": "object",
            "description": "Input to run the target actor with. Keep minimal to save compute. Ignored when canaries are defined."
          },
          "canaries": {
            "title": "Canary Scenarios",
            "maxItems": 10,
            "type": "array",
            "description": "Multiple test scenarios with different inputs. Each canary runs independently and gets its own pass/fail verdict. Set weight to prioritise important scenarios (default 1)."
          },
          "fieldRules": {
            "title": "Field Rules",
            "type": "object",
            "description": "Custom rules per field. Example: { \"price\": { \"severity\": \"critical\", \"maxNullRate\": 0.1, \"expectedType\": \"number\" }, \"title\": { \"required\": true } }. Severity: critical / important / optional."
          },
          "globalRules": {
            "title": "Global Rules",
            "type": "object",
            "description": "Actor-level rules. Example: { \"minItems\": 20, \"maxItems\": 5000 }"
          },
          "compareActorId": {
            "title": "Compare Actor ID (diff mode only)",
            "type": "string",
            "description": "Second actor to compare schemas against."
          },
          "enableDriftTracking": {
            "title": "Enable drift tracking",
            "type": "boolean",
            "description": "Track field baseline across runs and detect changes. Automatically enabled in monitor mode.",
            "default": false
          },
          "baselineStrategy": {
            "title": "Baseline strategy",
            "enum": [
              "previousRun",
              "lastGood",
              "approved"
            ],
            "type": "string",
            "description": "Which baseline to compare against. previousRun = last run. lastGood = last run that passed. approved = manually approved baseline.",
            "default": "previousRun"
          },
          "approveBaseline": {
            "title": "Approve current run as baseline",
            "type": "boolean",
            "description": "Save this run's output as the approved baseline for future comparisons.",
            "default": false
          },
          "resetBaseline": {
            "title": "Reset baseline",
            "type": "boolean",
            "description": "Clear all stored baselines and start fresh.",
            "default": false
          },
          "alertWebhookUrl": {
            "title": "Alert Webhook URL",
            "type": "string",
            "description": "Send alerts when output quality degrades. Supports Slack webhooks."
          },
          "nullRateThreshold": {
            "title": "Null rate alert threshold",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Alert when any field's null rate exceeds this (0.0-1.0). Default 0.2 = 20%.",
            "default": 0.2
          },
          "minConsecutiveFailuresForAlert": {
            "title": "Min consecutive failures before alert",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Only alert after this many consecutive failing runs. Reduces noise from intermittent issues. Default 1 (alert immediately).",
            "default": 1
          },
          "cooldownMinutes": {
            "title": "Alert cooldown (minutes)",
            "minimum": 0,
            "maximum": 1440,
            "type": "integer",
            "description": "Minimum minutes between alerts for the same issue. Prevents alert spam. Default 0 (no cooldown).",
            "default": 0
          },
          "timeout": {
            "title": "Timeout (seconds)",
            "minimum": 10,
            "maximum": 3600,
            "type": "integer",
            "description": "Max time for the target actor run",
            "default": 300
          },
          "memory": {
            "title": "Memory (MB)",
            "minimum": 128,
            "maximum": 32768,
            "type": "integer",
            "description": "Memory for the target actor run",
            "default": 512
          },
          "maxSampleItems": {
            "title": "Max items to analyse",
            "minimum": 10,
            "maximum": 10000,
            "type": "integer",
            "description": "Number of output items to validate. Default 1,000.",
            "default": 1000
          },
          "datasetId": {
            "title": "Dataset ID (backfill mode)",
            "type": "string",
            "description": "Validate an existing dataset without running the target actor. Provide a dataset ID from a previous run. Useful for debugging historical output or re-validating after rule changes."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}