{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/deepsfetch-com/json-schema/deepsfetch-com-interact-request-schema.json",
  "title": "InteractRequest",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/deepsfetch-com-api-openapi.json#/components/schemas/InteractRequest",
  "allOf": [
    {
      "$ref": "#/$defs/CommonOptions"
    },
    {
      "type": "object",
      "required": [
        "url",
        "actions"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "actions": {
          "type": "array",
          "minItems": 1,
          "maxItems": 20,
          "items": {
            "$ref": "#/$defs/BrowserAction"
          },
          "description": "Effective browser runtime limit is 20 actions."
        },
        "formats": {
          "type": "array",
          "minItems": 1,
          "maxItems": 4,
          "items": {
            "enum": [
              "html",
              "markdown",
              "links",
              "screenshot"
            ]
          }
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 1000,
          "maximum": 60000,
          "default": 30000
        },
        "waitUntil": {
          "enum": [
            "domcontentloaded",
            "load",
            "networkidle0",
            "networkidle2"
          ],
          "default": "domcontentloaded"
        },
        "fullPage": {
          "type": "boolean",
          "default": true
        },
        "redactSelectors": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        }
      }
    }
  ],
  "$defs": {
    "BrowserAction": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "type",
            "selector"
          ],
          "properties": {
            "type": {
              "const": "click"
            },
            "selector": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "selector",
            "text"
          ],
          "properties": {
            "type": {
              "const": "type"
            },
            "selector": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "text": {
              "type": "string",
              "maxLength": 10000
            },
            "clear": {
              "type": "boolean",
              "default": false
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "anyOf": [
            {
              "required": [
                "milliseconds"
              ]
            },
            {
              "required": [
                "selector"
              ]
            }
          ],
          "properties": {
            "type": {
              "const": "wait"
            },
            "selector": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "milliseconds": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "y"
          ],
          "properties": {
            "type": {
              "const": "scroll"
            },
            "selector": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "x": {
              "type": "integer",
              "minimum": -100000,
              "maximum": 100000,
              "default": 0
            },
            "y": {
              "type": "integer",
              "minimum": -100000,
              "maximum": 100000
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type",
            "key"
          ],
          "properties": {
            "type": {
              "const": "press"
            },
            "selector": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "key": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          }
        },
        {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "const": "screenshot"
            },
            "fullPage": {
              "type": "boolean",
              "default": false
            },
            "redactSelectors": {
              "type": "array",
              "maxItems": 20,
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              }
            }
          }
        }
      ]
    },
    "CommonOptions": {
      "type": "object",
      "properties": {
        "async": {
          "type": "boolean",
          "default": false
        },
        "webhook": {
          "$ref": "#/$defs/Webhook"
        },
        "geo": {
          "type": "object",
          "properties": {
            "country": {
              "type": "string"
            },
            "region": {
              "type": "string"
            },
            "city": {
              "type": "string"
            },
            "language": {
              "type": "string"
            }
          },
          "deprecated": true,
          "description": "Legacy common option. Not forwarded by the HTML adapter or recognized by the current browser runtime. Do not rely on it to customize execution."
        },
        "session": {
          "type": "object",
          "required": [
            "id"
          ],
          "properties": {
            "id": {
              "type": "string"
            },
            "ttlSeconds": {
              "type": "integer",
              "minimum": 60,
              "maximum": 86400
            }
          },
          "deprecated": true,
          "description": "Legacy common option. Not forwarded by the HTML adapter or recognized by the current browser runtime. Do not rely on it to customize execution."
        },
        "device": {
          "enum": [
            "desktop",
            "mobile",
            "tablet"
          ],
          "deprecated": true,
          "description": "Legacy common option. Not forwarded by the HTML adapter or recognized by the current browser runtime. Do not rely on it to customize execution."
        },
        "render": {
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": "object",
              "properties": {
                "waitMs": {
                  "type": "integer"
                },
                "waitFor": {
                  "type": "string"
                },
                "timeoutMs": {
                  "type": "integer"
                }
              }
            }
          ],
          "description": "For scrape, true or an object selects browser runtime. Nested wait/timeout settings are not runtime settings: use top-level timeoutMs and waitUntil. Browser runtime does not support credit caps."
        },
        "costControl": {
          "type": "object",
          "properties": {
            "maxCredits": {
              "type": "integer",
              "minimum": 0,
              "description": "Additional task credit cap. External AI provider costs are excluded.",
              "maximum": 1000000000
            },
            "cacheMode": {
              "enum": [
                "fresh",
                "prefer"
              ]
            },
            "maxAgeSeconds": {
              "type": "integer",
              "minimum": 0,
              "maximum": 86400
            },
            "allowFallback": {
              "type": "boolean",
              "description": "Set false to restrict fallback. General estimation includes fallback unless false; quickstart forces false."
            },
            "taskId": {
              "type": "string",
              "description": "Shared task budget identifier within the workspace. Use a new ID per logical run; distinct from idempotency.",
              "minLength": 1,
              "maxLength": 160,
              "pattern": "^[a-zA-Z0-9:_-]+$"
            }
          },
          "description": "Supported on compatible scrape/map/crawl/extract, independent collection engine and current search paths. Legacy browser runtime/interact and V2 watch creation reject credit caps. External AI costs excluded."
        }
      }
    },
    "Webhook": {
      "type": "object",
      "required": [
        "url",
        "secret"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "secret": {
          "type": "string",
          "minLength": 16
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Accepted configuration metadata is not included in the current delivered event payload."
        }
      },
      "description": "See https://deepsfetch.com/docs/webhooks for HMAC verification and delivery limitations. No automatic webhook retry in the current delivery chain."
    }
  }
}