{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/userintuition-ai/json-schema/userintuition-ai-public-study-schema.json",
  "title": "PublicStudy",
  "description": "Full study shape returned by get-by-id (includes the heavy fields).",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/userintuition-ai-openapi.json#/components/schemas/PublicStudy",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Name"
    },
    "study_type": {
      "type": "string",
      "enum": [
        "in-depth-interview",
        "concept-test",
        "prototype-test"
      ],
      "title": "Study Type",
      "description": "Current study-type template slug"
    },
    "use_case": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Use Case",
      "description": "Historical study-type label when it is outside the current catalog"
    },
    "recruiting_method": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "panel",
            "byop",
            "synthetic_respondents"
          ]
        },
        {
          "type": "null"
        }
      ],
      "enum": [
        "panel",
        "byop",
        "synthetic_respondents"
      ],
      "title": "Recruiting Method",
      "description": "panel, byop, or synthetic_respondents"
    },
    "interview_format": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "chat",
            "video",
            "voice"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Interview Format",
      "description": "chat, video, or voice"
    },
    "voice": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "male",
            "female"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Voice",
      "description": "male or female"
    },
    "language": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Language",
      "description": "Interview language code, e.g. 'en'"
    },
    "expected_duration_seconds": {
      "type": "integer",
      "minimum": 300.0,
      "title": "Expected Duration Seconds",
      "description": "Maximum planned interview duration in seconds, including transitions and likely follow-up probes. This is an estimate, not a guaranteed length.",
      "default": 900
    },
    "byop_config": {
      "$ref": "#/$defs/PublicByopConfigOut"
    },
    "study_link": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Study Link",
      "description": "Live participant interview link; null until the interviewer is provisioned. This is not a researcher preview URL."
    },
    "dashboard_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Dashboard Url",
      "description": "Researcher management link for the study"
    },
    "provisioning_status": {
      "type": "string",
      "enum": [
        "draft",
        "ready",
        "provisioned"
      ],
      "title": "Provisioning Status",
      "description": "draft when required interviewer settings are missing, ready when the study can be provisioned, and provisioned when interviews can run"
    },
    "fielding_status": {
      "type": "string",
      "enum": [
        "not_started",
        "starting",
        "collecting",
        "fielding",
        "paused",
        "complete",
        "partial",
        "failed",
        "stopped",
        "unavailable",
        "not_applicable",
        "unknown"
      ],
      "title": "Fielding Status",
      "description": "Recruitment state, separate from interviewer provisioning. Panel studies report their persisted lifecycle. BYOP studies are collecting once the interviewer is provisioned, and can be paused or stopped; invitation delivery is tracked per participant. Synthetic respondents are not_applicable."
    },
    "missing_requirements": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Missing Requirements",
      "description": "Fields still required before the study can be provisioned"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created At"
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Updated At"
    },
    "interview_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Interview Count",
      "description": "Completed visible non-test interviews satisfying quality criteria, matching list_interviews(status=completed)."
    },
    "report_status": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "available",
            "not_generated"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Report Status"
    },
    "study_plan": {
      "anyOf": [
        {
          "$ref": "#/$defs/PublicStudyPlanOut"
        },
        {
          "type": "null"
        }
      ]
    },
    "screener_questions": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/PublicScreenerQuestion"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Screener Questions"
    },
    "targeting_attributes": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/PublicTargetingAttribute"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Targeting Attributes"
    },
    "resolved_targeting": {
      "items": {
        "$ref": "#/$defs/PublicResolvedTargeting"
      },
      "type": "array",
      "title": "Resolved Targeting",
      "description": "Human-readable interpretation of the configured panel targeting"
    },
    "concept_links": {
      "items": {
        "$ref": "#/$defs/PublicConceptLink"
      },
      "type": "array",
      "title": "Concept Links"
    },
    "concept_images": {
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/PublicConceptVideo"
          },
          {
            "$ref": "#/$defs/PublicConceptImage"
          }
        ]
      },
      "type": "array",
      "title": "Concept Images"
    },
    "invitation_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Invitation Count",
      "description": "Invitation records for this study. A panel launch may use one invitation for many participants."
    },
    "interview_attempt_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Interview Attempt Count",
      "description": "Interview attempts, including attempts that did not yield a quality interview."
    },
    "quality_interview_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Quality Interview Count",
      "description": "Interviews that passed the study quality criteria."
    }
  },
  "type": "object",
  "required": [
    "id",
    "study_type",
    "provisioning_status",
    "fielding_status"
  ],
  "$defs": {
    "NumericRange": {
      "properties": {
        "min": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Min",
          "description": "Inclusive lower bound"
        },
        "max": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Max",
          "description": "Inclusive upper bound"
        }
      },
      "type": "object",
      "title": "NumericRange",
      "description": "Optional inclusive bounds constraining a numeric `text_input` answer."
    },
    "PublicByopConfigOut": {
      "properties": {
        "incentive_amount": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Incentive Amount"
        },
        "is_incentives_enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Is Incentives Enabled"
        },
        "auto_send_incentives": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Auto Send Incentives"
        }
      },
      "type": "object",
      "title": "PublicByopConfigOut"
    },
    "PublicConceptImage": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "url": {
          "type": "string",
          "title": "Url"
        },
        "label": {
          "type": "string",
          "title": "Label"
        }
      },
      "type": "object",
      "required": [
        "id",
        "url",
        "label"
      ],
      "title": "PublicConceptImage",
      "description": "Participant-facing image stimulus. Storage metadata remains internal."
    },
    "PublicConceptLink": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "url": {
          "type": "string",
          "title": "Url"
        },
        "label": {
          "type": "string",
          "title": "Label"
        },
        "embeddable": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Embeddable"
        }
      },
      "type": "object",
      "required": [
        "id",
        "url",
        "label"
      ],
      "title": "PublicConceptLink",
      "description": "Participant-facing external stimulus. Recorder and credential metadata\nremain internal."
    },
    "PublicConceptVideo": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "url": {
          "type": "string",
          "title": "Url"
        },
        "label": {
          "type": "string",
          "title": "Label"
        },
        "media_type": {
          "type": "string",
          "const": "video",
          "title": "Media Type"
        }
      },
      "type": "object",
      "required": [
        "id",
        "url",
        "label",
        "media_type"
      ],
      "title": "PublicConceptVideo",
      "description": "Participant-facing uploaded video stimulus."
    },
    "PublicLearningGoal": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "question": {
          "type": "string",
          "title": "Question"
        },
        "evidence_needed": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Evidence Needed",
          "description": "Evidence requirements; null for legacy plans that did not record them."
        }
      },
      "type": "object",
      "required": [
        "id",
        "question"
      ],
      "title": "PublicLearningGoal"
    },
    "PublicResolvedTargeting": {
      "properties": {
        "qualification_id": {
          "type": "integer",
          "title": "Qualification Id"
        },
        "attribute": {
          "type": "string",
          "title": "Attribute"
        },
        "include": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Include"
        },
        "exclude": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Exclude"
        },
        "applies_to": {
          "type": "string",
          "const": "panel",
          "title": "Applies To",
          "default": "panel"
        },
        "active": {
          "type": "boolean",
          "title": "Active",
          "description": "False when the study is currently using invitation-based recruitment"
        },
        "approximation_note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Approximation Note"
        }
      },
      "type": "object",
      "required": [
        "qualification_id",
        "attribute",
        "active"
      ],
      "title": "PublicResolvedTargeting"
    },
    "PublicScreenerOption": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "text": {
          "type": "string",
          "title": "Text"
        },
        "disqualify": {
          "type": "boolean",
          "title": "Disqualify"
        },
        "selection_rule": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "must_select",
                "may_select",
                "reject"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Selection Rule",
          "description": "multi_select only. must_select requires the participant to select this option; may_select makes it optional; reject disqualifies the participant when selected."
        }
      },
      "type": "object",
      "required": [
        "id",
        "text",
        "disqualify"
      ],
      "title": "PublicScreenerOption"
    },
    "PublicScreenerQuestion": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "text": {
          "type": "string",
          "title": "Text"
        },
        "type": {
          "type": "string",
          "enum": [
            "single_select",
            "multi_select",
            "text_input"
          ],
          "title": "Type"
        },
        "order": {
          "type": "integer",
          "title": "Order"
        },
        "options": {
          "items": {
            "$ref": "#/$defs/PublicScreenerOption"
          },
          "type": "array",
          "title": "Options"
        },
        "input_mode": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "integers_only",
                "unrestricted"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Input Mode",
          "description": "text_input only. Which characters the field accepts."
        },
        "numeric_ranges": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/NumericRange"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Numeric Ranges",
          "description": "text_input + integers_only only. Optional minimum and/or maximum shown to the participant; empty/absent accepts any integer."
        }
      },
      "type": "object",
      "required": [
        "id",
        "text",
        "type",
        "order"
      ],
      "title": "PublicScreenerQuestion"
    },
    "PublicStudyPlanOut": {
      "properties": {
        "objectives": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Objectives"
        },
        "conversation_flow": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Conversation Flow"
        },
        "background": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Background"
        },
        "learning_goals": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Learning Goals"
        },
        "learning_goals_structured": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/PublicLearningGoal"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Learning Goals Structured",
          "description": "Stable goals whose IDs match report learning_goal_id values. Older plans also return goal IDs; evidence_needed is null if no requirements were recorded."
        },
        "study_specific_rules": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Study Specific Rules"
        },
        "study_improvements": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Study Improvements"
        }
      },
      "type": "object",
      "title": "PublicStudyPlanOut",
      "description": "Response variant — all sections optional (a study's stored prompt may not\ncontain every section)."
    },
    "PublicTargetingAttribute": {
      "properties": {
        "qualification_id": {
          "type": "integer",
          "title": "Qualification Id",
          "description": "Qualification id (from GET /targeting-attributes)"
        },
        "allowed_options": {
          "items": {
            "type": "integer"
          },
          "type": "array",
          "title": "Allowed Options",
          "description": "option_ids to allow"
        },
        "disallowed_options": {
          "items": {
            "type": "integer"
          },
          "type": "array",
          "title": "Disallowed Options",
          "description": "option_ids to disqualify"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "qualification_id"
      ],
      "title": "PublicTargetingAttribute",
      "description": "Target the panel by a qualification's answer options. Option-id rules:\n- both lists empty → allow all options;\n- only allowed → disqualify any option not listed;\n- only disallowed → allow any option not listed (can't disallow them all);\n- both → allowed are kept, disallowed are disqualified, and together they\n  must cover every option_id of the qualification.\nLook up qualification_id / option_id via GET /targeting-attributes."
    }
  }
}