{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/strix-ai/json-schema/strix-ai-create-scan-request-schema.json",
  "title": "CreateScanRequest",
  "description": "At least one target (domain_ids, repository_ids, upload_ids, or internal_targets) should be provided.",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/strix-ai-openapi.json#/components/schemas/CreateScanRequest",
  "type": "object",
  "properties": {
    "cloud_connection_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Cloud connections this run may read. If you omit this field, the run uses the connections that apply to its targets. A connection with empty `applies_to_domain_ids` and `applies_to_repository_ids` applies to every run. A connection with values in those lists applies only to a run that targets one of the listed domains or repositories. Send an empty array for no cloud connections."
    },
    "concerns": {
      "description": "Free-text security concerns to prioritize, for example `IDOR on the invoices API`.",
      "type": "string"
    },
    "connector_id": {
      "description": "ID of a network connector that gives the agent access to a private network. Use `listConnectors` to find it.",
      "type": "string"
    },
    "context": {
      "description": "Free-text background about the target that helps the agent, for example architecture notes or recent changes.",
      "type": "string"
    },
    "credentials": {
      "description": "Test accounts the agent logs in with during the scan. Stored encrypted and never returned. Prefer saved test users where available.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "mfa_method": {
            "type": "string",
            "enum": [
              "none",
              "totp",
              "email_otp",
              "magic_link"
            ],
            "description": "Multi-factor method for authenticated scans."
          },
          "totp_secret": {
            "type": "string",
            "description": "Base32 TOTP secret, used when mfa_method is `totp`."
          },
          "mfa_email": {
            "type": "string",
            "format": "email",
            "description": "Inbox to read one-time codes / magic links from, used when mfa_method is `email_otp` or `magic_link`."
          },
          "login_url": {
            "type": "string",
            "format": "uri",
            "description": "Login page URL for this credential set."
          }
        },
        "required": [
          "username",
          "password"
        ]
      }
    },
    "domain_ids": {
      "description": "UUIDs of verified domains to test. Use `listDomains` to find them.",
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "domain_paths": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "description": "Map of domain ID to specific paths to scan."
    },
    "engagement_type": {
      "type": "string",
      "enum": [
        "code_review",
        "live_test",
        "internal_infra",
        "desktop_app"
      ],
      "description": "Which engagement type this run is. When omitted, source-only scopes infer `code_review`, domain scopes infer `live_test`, and internal targets infer `internal_infra`. Strix never infers `desktop_app`. A `desktop_app` scan requires one completed upload of category application in `upload_ids` and a Pro or Enterprise plan. On a credit plan it costs 150 credits, plus 30 for each domain, repository, and additional upload. Domains are optional and add the backend of the app to the scope."
    },
    "focus": {
      "description": "Free-text areas of the target to test first, for example `the checkout flow`.",
      "type": "string"
    },
    "headers": {
      "description": "Custom HTTP headers the agent sends on every request, for example an API key header. Stored encrypted and never returned.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "value"
        ]
      }
    },
    "internal_targets": {
      "description": "Hosts or URLs inside a private network to test through the connector, for example `http://10.0.0.5:8080`.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "knowledge_resource_pins": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "$ref": "#/$defs/RunKnowledgeResourcePin"
      },
      "description": "Provider resources selected for this run in addition to organization-wide pins."
    },
    "max_budget_usd": {
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 1000000,
      "description": "Self-hosted only: stop the pentest gracefully once total LLM spend reaches this amount (USD). Omit for no limit. Spend is counted from the model config's Pricing when it is set. Otherwise it uses the cost the provider reports, or the LiteLLM price table."
    },
    "budget_policy": {
      "type": "string",
      "enum": [
        "stop",
        "pause"
      ],
      "description": "Self-hosted only: what happens when `max_budget_usd` is reached. `pause` parks every agent before its next model call until an operator resumes the scan with a higher limit or stops it (see `POST /scans/{scanId}/budget`); a paused scan waits with no deadline. `stop` ends the run at the limit. Defaults to `pause`. Ignored without `max_budget_usd`."
    },
    "model_config_id": {
      "type": "string",
      "format": "uuid",
      "description": "Self-hosted installs and hosted organizations on their own LLM keys: run the scan with a named model config from Settings → LLM Models instead of the default assignment."
    },
    "notification_emails": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "email"
      },
      "description": "Extra addresses to CC on the completion email. Validated only when notify_on_completion is true."
    },
    "notify_on_completion": {
      "type": "boolean",
      "description": "Email the scan creator when the pentest finishes."
    },
    "org_knowledge_enabled": {
      "description": "When true, the agent uses the organization knowledge base during the scan.",
      "type": "boolean"
    },
    "repository_branches": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Map of repository ID to branch name."
    },
    "repository_ids": {
      "description": "UUIDs of connected repositories to test. Use `listRepositories` to find them.",
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "test_user_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "description": "Saved test users attach to domain targets they cover or to internal_infra scans on the same network."
    },
    "title": {
      "type": "string",
      "maxLength": 120,
      "description": "Custom scan title. When you set a title, the server does not generate one. The server trims the value."
    },
    "upload_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Completed upload IDs to attach. A repository upload can be the sole target of a code review or provide white-box context for a domain pentest."
    }
  },
  "$defs": {
    "RunKnowledgeResourcePin": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "connection_id": {
          "type": "string",
          "minLength": 1,
          "description": "Organization cloud connection that owns the resource."
        },
        "page_id": {
          "type": "string",
          "minLength": 1,
          "description": "Provider-specific opaque resource identifier."
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "guidance": {
          "type": "string",
          "maxLength": 500,
          "description": "Optional context: what the resource holds and when Strix should read it."
        }
      },
      "required": [
        "connection_id",
        "page_id",
        "label",
        "url"
      ]
    }
  }
}