# Create a shell case

Creates a shell case - an analysis case without uploaded files.
Shell cases can be used to:
- Pre-register cases before files are available
- Set up case metadata in advance
- Later link files using the /v1/shell_case/link endpoint
- Implicitly link case files to samples based on file naming conventions (requires configuration by Franklin services)

**Note:** If `assigned_to` is provided with an email that does not belong to a user in the organization, the value is silently ignored and the case is created without an assignee. Use the V2 endpoint for strict validation.

Endpoint: POST /v1/shell_case/create
Version: 96
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer JWT

## Request fields (application/json):

  - `case_name` (string, required)
    Name for the shell case
    Example: Patient_001_Shell

  - `case_type` (string, required)
    Type of case
    Enum: "single", "family"

  - `samples_data` (array, required)
    Sample information

  - `samples_data.sample_name` (string, required)
    Sample name
    Example: Sample_001

  - `samples_data.patient_details` (object)
    Patient/subject details

  - `samples_data.patient_details.name` (string)
    Patient name
    Example: John Doe

  - `samples_data.patient_details.dob` (string)
    Date of birth (formats are dd-MM-yyyy, yyyy-MM-dd, dd/MM/yyyy)
    Example: 1990-05-15

  - `samples_data.patient_details.ethnicity` (string)
    Primary ethnicity (deprecated - use ethnicities)
    Example: European

  - `samples_data.patient_details.sex` (string)
    Biological sex
    Enum: "male", "female", "unknown"

  - `samples_data.patient_details.phenotypes` (array)
    HPO terms or phenotype descriptions
    Example: ["HP:0001250","Seizures"]

  - `samples_data.patient_details.major_phenotypes` (array)
    Subset of phenotypes considered major/primary. Must be a subset of phenotypes.
    Example: ["HP:0001250"]

  - `samples_data.patient_details.patient_id` (string)
    External patient identifier (e.g., MRN)
    Example: PAT-001

  - `samples_data.patient_details.ethnicities` (array)
    List of ethnic backgrounds
    Example: ["European","Ashkenazi Jewish"]

  - `samples_data.patient_details.description` (string)
    Clinical description
    Example: History of epilepsy

  - `samples_data.patient_details.cancer_type` (string)
    Cancer type (for oncology)
    Example: Breast Cancer

  - `samples_data.family_relation` (string)
    Family relation (for family cases)
    Example: proband

  - `samples_data.description` (string)
    Sample description
    Example: Primary sample

  - `samples_data.hard_panels` (array)
    Hard panel names
    Example: []

  - `samples_data.hard_panel_single_genes` (array)
    Individual genes for hard filter
    Example: []

  - `samples_data.sample_files_location` (object)
    Location configuration for sample files. Specifies where to fetch sample files from.
**Location Types:**
- `AWS` or `S3`: Files are fetched from AWS S3. Requires organization to have `caseFilesRootFolder` configured.
The final S3 path is constructed as: `{caseFilesRootFolder}/{folder_name}/`
where `folder_name` is either `s3_sample_files_folder_name_override` (if provided) or the sample name.
- `BASESPACE`: Files are fetched from Illumina BaseSpace. Requires `basespace_project` and `basespace_sample`.
If `basespace_rna_sample` is also provided, creates a tumor sample with RNA data.

  - `samples_data.sample_files_location.location` (string, required)
    The storage location type. Case insensitive.
- `AWS` or `S3`: Amazon S3 storage
- `BASESPACE`: Illumina BaseSpace
    Enum: "AWS", "S3", "BASESPACE"

  - `samples_data.sample_files_location.basespace_project` (string)
    BaseSpace project ID. Required when location is `BASESPACE`.
    Example: project-123

  - `samples_data.sample_files_location.basespace_sample` (string)
    BaseSpace biosample ID. Required when location is `BASESPACE`.
    Example: sample-456

  - `samples_data.sample_files_location.basespace_rna_sample` (string)
    BaseSpace RNA biosample ID. Optional for `BASESPACE` location.
When provided, creates a tumor sample with associated RNA data.
    Example: rna-sample-789

  - `samples_data.sample_files_location.s3_sample_files_folder_name_override` (string)
    Override the folder name used in the S3 path. Only applicable when location is `AWS` or `S3` and implicit linking is configured.
If not provided, the sample name is used as the folder name, following the root case files folder configured by Franklin PS.
Special characters are URL-encoded. Trailing slashes are stripped.
    Example: custom_folder_name

  - `samples_data.create_analysis` (boolean)
    Whether to create analysis record

  - `samples_data.affected` (boolean)
    Whether affected (for family)
    Example: true

  - `samples_data.sample_name_in_multi_sample_vcf` (string)
    Name in multi-sample VCF
    Example: SAMPLE001

  - `samples_data.consanguinity` (boolean)
    Whether there is known consanguinity in the family
    Example: false

  - `samples_data.include_secondary_findings` (boolean)
    Whether to include secondary findings for this sample.
Priority hierarchy (highest to lowest):
1. This sample-level setting
2. Case-level `include_secondary_findings` in the request
3. Organization's default setting
For family cases, the family analysis uses: case-level setting,
then proband's sample-level setting, then org default.
    Example: true

  - `assay_id` (string)
    Assay UUID
    Example: assay-uuid-123

  - `batch_name` (string)
    Batch name
    Example: Batch_2024_01

  - `virtual_panels` (array)
    Virtual panel names
    Example: ["Epilepsy Panel"]

  - `labels` (array)
    Labels to apply
    Example: ["pending_files"]

  - `extra_case_details` (object)
    Custom fields
    Example: {"referring_physician":"Dr. Smith"}

  - `assigned_to` (string)
    Email of user to assign to. V1 silently ignores invalid emails; V2 fails with an error if the user does not exist in the organization.
    Example: analyst@example.com

  - `case_order_name` (string)
    Case group name
    Example: Order_2024_001

  - `case_group_name` (string)
    Case group name
    Example: Group_2024_001

  - `protocols` (array)
    Analysis protocols
    Example: []

  - `include_secondary_findings` (boolean)
    Whether to include secondary findings for this case.
This is the case-level default that can be overridden per-sample.
If not specified, falls back to the organization's default setting.
    Example: true

## Response 200:

  - `200` (unknown)
    Shell case created successfully

## Response 200 fields (application/json):

  - `analysis_id` (integer, required)
    ID of created analysis
    Example: 12345

  - `analysis_name` (string, required)
    Name of created analysis
    Example: Patient_001_Analysis

## Response 400:

  - `400` (unknown)
    Bad request - invalid request parameters

## Response 400 fields (application/json):

  - `error` (string, required)
    Error type
    Example: Not Found

  - `message` (string, required)
    Human-readable error description
    Example: Analysis with ID 12345 was not found

## Response 401:

  - `401` (unknown)
    Authentication failed - invalid or missing token

## Response 401 fields (application/json):

  - `error` (string, required)
    Error type
    Example: Not Found

  - `message` (string, required)
    Human-readable error description
    Example: Analysis with ID 12345 was not found

## Response 429:

  - `429` (unknown)
    Rate limit exceeded

## Response 429 fields (application/json):

  - `error` (string, required)
    Error type
    Example: Not Found

  - `message` (string, required)
    Human-readable error description
    Example: Analysis with ID 12345 was not found

## Response 429 headers (application/json):

  - `Retry-After` (integer)
    Number of seconds to wait before retrying

