{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/misata-studio/json-schema/misata-studio-load-request-schema.json",
  "title": "LoadRequest",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/misata-studio-openapi.json#/components/schemas/LoadRequest",
  "properties": {
    "target": {
      "type": "string",
      "enum": [
        "postgres",
        "clickhouse",
        "hubspot",
        "salesforce"
      ],
      "title": "Target"
    },
    "url": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000,
          "minLength": 8
        },
        {
          "type": "null"
        }
      ],
      "title": "Url",
      "description": "Postgres and ClickHouse: postgres://user:pass@host:5432/db?sslmode=require, or https://user:pass@host:8443/?database=db. Used once, never stored"
    },
    "token": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 4000,
          "minLength": 8
        },
        {
          "type": "null"
        }
      ],
      "title": "Token",
      "description": "HubSpot: a private app's access token (scopes crm.objects.*.write, crm.schemas.*.write). Salesforce: an access token for the org. Used once, never stored"
    },
    "instance_url": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 300
        },
        {
          "type": "null"
        }
      ],
      "title": "Instance Url",
      "description": "Salesforce: the org's https://<domain>.my.salesforce.com, as the sign-in returns it"
    },
    "create_fields": {
      "type": "boolean",
      "title": "Create Fields",
      "description": "HubSpot and Salesforce: create the properties or fields the records need first (the plan lists them)",
      "default": true
    },
    "schema": {
      "type": "string",
      "maxLength": 63,
      "title": "Schema",
      "description": "Postgres: the schema the tables go in",
      "default": "misata"
    },
    "apply": {
      "type": "boolean",
      "title": "Apply",
      "description": "false: say what would be loaded and check the host; true: load it",
      "default": false
    },
    "replace": {
      "type": "boolean",
      "title": "Replace",
      "description": "Replace this dataset's tables if they are already there (only those tables)",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "target"
  ]
}