{
  "openapi": "3.0.1",
  "info": {
    "title": "Actor Input Tester — Validate Actor Input JSON Before Running",
    "description": "Actor Input Tester. Available on the Apify Store with pay-per-event pricing.",
    "version": "1.1",
    "x-build-id": "EzFwohPYm4WtwgyQM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~actor-input-tester/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-actor-input-tester",
        "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-input-tester/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-actor-input-tester",
        "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-input-tester/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-actor-input-tester",
        "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": "Actor ID or username/actor-name to validate input for"
          },
          "testInput": {
            "title": "Test Input (JSON)",
            "type": "object",
            "description": "Single input JSON to validate against the actor's input schema. Use this OR Batch Test Inputs, not both.",
            "default": {}
          },
          "testInputs": {
            "title": "Batch Test Inputs",
            "maxItems": 500,
            "type": "array",
            "description": "Array of labeled inputs to validate in one run. Each item has an optional 'label' and a required 'input' object. Overrides Test Input when provided. Each input is charged separately at $0.15.",
            "default": []
          },
          "strictness": {
            "title": "Strictness",
            "enum": [
              "lenient",
              "standard",
              "strict"
            ],
            "type": "string",
            "description": "Controls how decision/readiness react to warnings. lenient = warnings never downgrade a pass; standard (default) = warnings downgrade to monitor; strict = unknown fields and 3+ default-reliance warnings elevate to act_now (block-like)."
          },
          "includeSchemaQualityAudit": {
            "title": "Include Schema Quality Audit",
            "type": "boolean",
            "description": "Run a documentation / completeness / agent-readiness audit on the target actor's input schema and attach the findings to every report. Adds zero API calls — purely structural.",
            "default": true
          },
          "includeAutoFixSuggestions": {
            "title": "Include Autofix Suggestions",
            "type": "boolean",
            "description": "Emit a recommendedFixes[] array with deterministic remediation for type/enum/unknown-field errors. Safe fixes are coerced automatically into patchedInputPreview; unsafe ones are flagged for review.",
            "default": true
          },
          "includePatchedInputPreview": {
            "title": "Include Patched Input Preview",
            "type": "boolean",
            "description": "Attach a patchedInputPreview object showing the test input with high-confidence autofixes applied. Does not mutate the stored input — you decide whether to use it.",
            "default": true
          },
          "outputProfile": {
            "title": "Output Profile",
            "enum": [
              "minimal",
              "standard",
              "full",
              "llm"
            ],
            "type": "string",
            "description": "Controls how many fields each record carries. standard (default) = the full record; minimal = decision essentials only (decision, readiness, reason codes, compatibility, score); llm = a plain-language subset for prompting (decision, reason, summary, recommendations, evidence); full = same as standard. Trims the record without forcing a JSONata expression.",
            "default": "standard"
          },
          "policyPreset": {
            "title": "Policy Preset",
            "enum": [
              "custom",
              "dev",
              "ci",
              "production",
              "agent",
              "scheduled-task"
            ],
            "type": "string",
            "description": "Environment-shaped gate that bundles strictness + drift/warning gating. dev = only hard schema errors block; ci = unknown fields + breaking drift block; production = defaults/drift/unknowns require review or block; agent = only ignore is auto-runnable; scheduled-task = breaking drift blocks, non-breaking warns; custom = use the raw controls below. Explicit strictness / failOnCompatibilityImpact / maxWarningsBeforeBlock always override the preset.",
            "default": "custom"
          },
          "maxWarningsBeforeBlock": {
            "title": "Max Warnings Before Block",
            "type": "integer",
            "description": "When set, a valid input with more than this many warnings is elevated to act_now (block). Leave empty to never block on warning count alone."
          },
          "failOnCompatibilityImpact": {
            "title": "Block On Drift Impact",
            "type": "array",
            "description": "Schema-drift impact levels that should elevate a valid input to act_now (block). Allowed values: breaking, non-breaking. Leave unset to inherit the Policy Preset; empty = drift never blocks on its own.",
            "items": {
              "type": "string"
            }
          },
          "compareAgainstSchemaHash": {
            "title": "Pin Schema Hash",
            "type": "string",
            "description": "Pin a known-good schemaHash. If the target actor's current schema hash differs from this value, the input is blocked (act_now) with a pinned-hash mismatch reason — ideal for a CI gate that fails when an upstream actor's input contract changes."
          },
          "baselineScope": {
            "title": "Baseline Scope",
            "enum": [
              "targetActor",
              "caller",
              "custom"
            ],
            "type": "string",
            "description": "Which baseline the drift diff compares against. targetActor (default) = one shared baseline per target actor; caller = isolated per Apify account; custom = isolated per Baseline Key.",
            "default": "targetActor"
          },
          "baselineKey": {
            "title": "Baseline Key",
            "type": "string",
            "description": "Custom isolation key for the drift baseline (used when Baseline Scope is 'custom'). Lets one account keep separate per-environment baselines for the same target actor."
          },
          "includeDriftTimeline": {
            "title": "Include Drift Timeline",
            "type": "boolean",
            "description": "Attach a driftTimeline array of the target schema's hash transitions over previous validated runs (longitudinal drift, not just one-baseline comparison). Reads the shared history store — no extra API calls.",
            "default": false
          },
          "includeReliabilityProfile": {
            "title": "Include Reliability Profile",
            "type": "boolean",
            "description": "Attach actorReliabilityProfile (validationRuns, driftEvents, breakingDrifts, schemaStability, averageScore, lastBreakingDrift) and changeVelocity (schemaChangesLast30Days, breakingChangesLast90Days, stabilityTrend) — contract observability accumulated across runs. Reads the shared history store; null until a prior run exists.",
            "default": false
          },
          "includeReplayPackage": {
            "title": "Include Replay Package",
            "type": "boolean",
            "description": "Attach a self-contained replayPackage (actorId, schemaHash, input, validatedAt, replayCurl/Python/Javascript) — a committable record of this exact validated invocation you can re-run months later for debugging or audit.",
            "default": true
          },
          "proposedSchema": {
            "title": "Proposed Schema (what-if)",
            "type": "object",
            "description": "Optional hypothetical input schema ({ properties, required }). When provided, the actor re-validates your test inputs against this proposed schema and returns impactSimulation { wouldBreak, affectedInputs, brokenFields[], perInput[], confidence } — answers 'if the target changed its schema to this, would my inputs still validate?'. Scoped to your test inputs only, not downstream pipelines.",
            "default": {}
          },
          "saveGoldenSuite": {
            "title": "Save Golden Suite",
            "type": "boolean",
            "description": "Store this run's test inputs + their verdicts as the golden regression suite for this baseline. Run later with Run Golden Suite to catch payloads that the target's schema changes would break.",
            "default": false
          },
          "runGoldenSuite": {
            "title": "Run Golden Suite",
            "type": "boolean",
            "description": "Re-validate the stored golden suite against the target actor's CURRENT schema and emit a golden-suite record: { newFailures, fixedInputs, breakingInputs[] } + consumerImpact { wouldBreakExistingPayloads, affectedStoredInputs, severity }. Answers 'will this actor update break my existing payloads?'.",
            "default": false
          },
          "inferSchemaWhenMissing": {
            "title": "Infer Schema When Missing",
            "type": "boolean",
            "description": "When the target actor has no declared input schema, deterministically infer a starter input_schema.json from the supplied test input and attach it as schemaBootstrap (with a confidence note). Turns a no-charge dead end into an upgrade path for actor developers.",
            "default": true
          },
          "emitArtifacts": {
            "title": "Emit CI Artifacts",
            "type": "boolean",
            "description": "Write CI-native report artifacts to the key-value store (REPORT.md, REPORT.json, JUNIT.xml, SARIF.json, GITHUB_STEP_SUMMARY.md) so a pipeline can publish the validation result. Off by default — adds KV writes.",
            "default": false
          },
          "artifactFormats": {
            "title": "Artifact Formats",
            "type": "array",
            "description": "Which artifact formats to write when Emit CI Artifacts is on. Allowed: markdown, json, junit, sarif, github. Empty = markdown, json, junit, github.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "webhookUrl": {
            "title": "Decision Webhook URL",
            "type": "string",
            "description": "Optional URL to POST a compact run-level decision alert to (Slack/Make/Zapier/custom). Fires only when the Webhook Mode condition is met."
          },
          "webhookMode": {
            "title": "Webhook Mode",
            "enum": [
              "none",
              "breaking-drift",
              "act-now",
              "non-ignore"
            ],
            "type": "string",
            "description": "When to fire the decision webhook. none = never; breaking-drift = only on breaking schema drift; act-now = only when the run's worst decision is act_now; non-ignore = whenever the run's worst decision is monitor or act_now.",
            "default": "none"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}