{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ranomics-com/json-schema/ranomics-com-create-experiment-request-schema.json",
  "title": "CreateExperimentRequest",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ranomics-com-openapi.json#/components/schemas/CreateExperimentRequest",
  "properties": {
    "experiment_spec": {
      "$ref": "#/$defs/ExperimentSpec"
    },
    "name": {
      "maxLength": 200,
      "type": "string"
    },
    "webhook_url": {
      "description": "Optional. POST is signed with X-Ranomics-Signature: t=<ts>,v1=<hex hmac-sha256>. The HMAC key is the **per-tenant** webhook signing secret shown once at /account/api-keys (whsec_…). Payload shape: see the WebhookEvent schema.",
      "format": "uri",
      "type": "string"
    }
  },
  "required": [
    "experiment_spec"
  ],
  "type": "object",
  "$defs": {
    "ExperimentSpec": {
      "properties": {
        "experiment_type": {
          "enum": [
            "yeast_display",
            "mammalian_display",
            "dms"
          ],
          "type": "string"
        },
        "library_design": {
          "$ref": "#/$defs/LibraryDesign"
        },
        "sequences": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Map of `{user_key: AMINO_STRING}`. Each value is uppercase one-letter amino-acid codes; use `:` to separate chains for multi-chain submissions (Adaptyv-compatible).",
          "type": "object"
        },
        "target": {
          "$ref": "#/$defs/Target"
        }
      },
      "required": [
        "experiment_type",
        "target",
        "sequences"
      ],
      "type": "object"
    },
    "LibraryDesign": {
      "additionalProperties": true,
      "properties": {
        "diversity_estimate": {
          "minimum": 1,
          "type": "integer"
        },
        "mode": {
          "enum": [
            "designed_panel",
            "combinatorial",
            "site_saturation",
            "error_prone",
            "nnk"
          ],
          "type": "string"
        },
        "notes": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "Target": {
      "description": "Supply EITHER `target_id` (catalogue path) or `custom` (one-off antigen). Mutually exclusive.",
      "properties": {
        "custom": {
          "description": "One-off antigen. Routes through human scoping; cost-estimate returns a placeholder range.",
          "properties": {
            "antigen_sequence": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "notes": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "type": "object"
        },
        "target_id": {
          "description": "Catalogue target id from `GET /api/v1/targets`. The experiment is constructed against the catalogue entry and skips human scoping.",
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}