{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/unbrowse-ai/json-schema/unbrowse-ai-run-request-schema.json",
  "title": "RunRequest",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/unbrowse-ai-openapi.json#/components/schemas/RunRequest",
  "type": "object",
  "required": [
    "idempotencyKey"
  ],
  "properties": {
    "task": {
      "type": "string",
      "description": "What to do, in plain words. Unbrowse picks the capability."
    },
    "capability": {
      "type": "string",
      "description": "A capability id to run instead of routing the task (from /api/v1/capabilities/search)."
    },
    "targetUrl": {
      "type": "string",
      "format": "uri",
      "description": "The site to do it on, when the task does not name one."
    },
    "input": {
      "type": "object",
      "additionalProperties": true,
      "description": "The capability's inputs."
    },
    "accountRefs": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Which kept logins to use."
    },
    "interactionMode": {
      "type": "string",
      "enum": [
        "interactive",
        "unattended",
        "external_handler"
      ],
      "description": "unattended: a check nobody can clear fails instead of waiting."
    },
    "idempotencyKey": {
      "type": "string",
      "description": "Repeat a request with the same key to get the same run."
    },
    "deadlineMs": {
      "type": "integer",
      "minimum": 5000,
      "maximum": 300000,
      "default": 60000,
      "description": "Answer within this many ms; past it 504 run_timeout with a runId to poll (the run keeps going). The x-unbrowse-deadline-ms header wins."
    },
    "egress": {
      "type": "string",
      "enum": [
        "server",
        "client"
      ],
      "default": "server",
      "description": "client: you send the site requests from your own IP (see /api/v1/egress/{egressId})."
    },
    "select": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Keep only these parts of the result. Dots walk keys, [] maps over a list, [n] takes one item, a final {a,b} keeps several keys. Applied to the answer after the run is verified; billing is the same. Paths that matched nothing come back in `selectMissing`; a malformed path is a 400 invalid_input naming it. Results over 40,000 characters are shortened (`truncated`), so select what you need."
    }
  }
}