{
  "openapi": "3.0.3",
  "info": {
    "title": "The Genome API",
    "version": "2.0.0",
    "description": "AI-native genomic infrastructure for sequencing, hosted genomes, interpretations, and bounded biological context generation."
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {}
  },
  "paths": {
    "/v2/genome_connections": {
      "get": {
        "summary": "List genome connections.",
        "tags": [
          "Genome connections"
        ],
        "description": "Returns this organization's connections for the API key environment, newest first. User identity is never returned.",
        "parameters": [
          {
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "in": "query",
            "name": "limit",
            "required": false,
            "description": "Maximum number of connections to return."
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            },
            "in": "query",
            "name": "cursor",
            "required": false,
            "description": "Opaque cursor returned by the previous page."
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "in": "query",
            "name": "client_user_reference",
            "required": false,
            "description": "Exact opaque client user reference to match."
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "genome_connection_id": {
                            "type": "string"
                          },
                          "client_user_reference": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "awaiting_customer",
                              "connected",
                              "expired"
                            ]
                          },
                          "access_status": {
                            "nullable": true,
                            "type": "string",
                            "enum": [
                              "pending_genome",
                              "active",
                              "revoked"
                            ]
                          },
                          "journey": {
                            "nullable": true,
                            "type": "string",
                            "enum": [
                              "existing_genome",
                              "new_order"
                            ]
                          },
                          "client_genome_id": {
                            "nullable": true,
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "description": "ISO 8601 timestamp."
                          },
                          "connected_at": {
                            "nullable": true,
                            "type": "string",
                            "description": "ISO 8601 timestamp."
                          },
                          "permissions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "permission": {
                                  "type": "string",
                                  "enum": [
                                    "genome_bundle_downloads",
                                    "genome_connection",
                                    "insight_panels"
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "granted",
                                    "declined",
                                    "expired",
                                    "revoked"
                                  ]
                                }
                              },
                              "required": [
                                "permission",
                                "status"
                              ]
                            },
                            "description": "The typed permissions in the latest customer decision. Missing permissions are not granted."
                          }
                        },
                        "required": [
                          "genome_connection_id",
                          "client_user_reference",
                          "status",
                          "access_status",
                          "journey",
                          "client_genome_id",
                          "created_at",
                          "connected_at",
                          "permissions"
                        ]
                      }
                    },
                    "next_cursor": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          },
          "403": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          }
        },
        "x-required-scopes": "genome_connections:read"
      },
      "post": {
        "summary": "Create a hosted genome connection.",
        "tags": [
          "Genome connections"
        ],
        "description": "Creates a short-lived Genome Computer URL from the client's authenticated backend.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_user_reference": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255,
                    "description": "Your opaque reference for the signed-in user. Do not send an email address, name, or other direct identifier."
                  },
                  "return_url": {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri",
                    "description": "An HTTPS URL whose origin has been approved for your organization."
                  }
                },
                "required": [
                  "client_user_reference",
                  "return_url"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 255
            },
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "description": "A unique key for this create attempt. Reuse it only when retrying the same request."
          }
        ],
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "genome_connection": {
                      "type": "object",
                      "properties": {
                        "genome_connection_id": {
                          "type": "string"
                        },
                        "client_user_reference": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "awaiting_customer",
                            "connected",
                            "expired"
                          ]
                        },
                        "access_status": {
                          "nullable": true,
                          "type": "string",
                          "enum": [
                            "pending_genome",
                            "active",
                            "revoked"
                          ]
                        },
                        "journey": {
                          "nullable": true,
                          "type": "string",
                          "enum": [
                            "existing_genome",
                            "new_order"
                          ]
                        },
                        "client_genome_id": {
                          "nullable": true,
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string",
                          "description": "ISO 8601 timestamp."
                        },
                        "connected_at": {
                          "nullable": true,
                          "type": "string",
                          "description": "ISO 8601 timestamp."
                        },
                        "permissions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "permission": {
                                "type": "string",
                                "enum": [
                                  "genome_bundle_downloads",
                                  "genome_connection",
                                  "insight_panels"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "granted",
                                  "declined",
                                  "expired",
                                  "revoked"
                                ]
                              }
                            },
                            "required": [
                              "permission",
                              "status"
                            ]
                          },
                          "description": "The typed permissions in the latest customer decision. Missing permissions are not granted."
                        }
                      },
                      "required": [
                        "genome_connection_id",
                        "client_user_reference",
                        "status",
                        "access_status",
                        "journey",
                        "client_genome_id",
                        "created_at",
                        "connected_at",
                        "permissions"
                      ]
                    },
                    "customer_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "customer_url_expires_at": {
                      "type": "string",
                      "description": "ISO 8601 timestamp."
                    }
                  },
                  "required": [
                    "genome_connection",
                    "customer_url",
                    "customer_url_expires_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          },
          "403": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          },
          "409": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          },
          "503": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          }
        },
        "x-required-scopes": "genome_connections:write"
      }
    },
    "/v2/genome_connections/{genome_connection_id}/permission_requests": {
      "post": {
        "summary": "Request customer permission again.",
        "tags": [
          "Genome connections"
        ],
        "description": "Creates a fresh short-lived customer URL for the same durable connection after its previous permission request was declined or expired.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^gconn_[0-9a-z]{12,64}$"
            },
            "in": "path",
            "name": "genome_connection_id",
            "required": true,
            "description": "The durable genome connection identifier."
          },
          {
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 255
            },
            "in": "header",
            "name": "idempotency-key",
            "required": true,
            "description": "A unique key for this create attempt. Reuse it only when retrying the same request."
          }
        ],
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "genome_connection": {
                      "type": "object",
                      "properties": {
                        "genome_connection_id": {
                          "type": "string"
                        },
                        "client_user_reference": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "awaiting_customer",
                            "connected",
                            "expired"
                          ]
                        },
                        "access_status": {
                          "nullable": true,
                          "type": "string",
                          "enum": [
                            "pending_genome",
                            "active",
                            "revoked"
                          ]
                        },
                        "journey": {
                          "nullable": true,
                          "type": "string",
                          "enum": [
                            "existing_genome",
                            "new_order"
                          ]
                        },
                        "client_genome_id": {
                          "nullable": true,
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string",
                          "description": "ISO 8601 timestamp."
                        },
                        "connected_at": {
                          "nullable": true,
                          "type": "string",
                          "description": "ISO 8601 timestamp."
                        },
                        "permissions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "permission": {
                                "type": "string",
                                "enum": [
                                  "genome_bundle_downloads",
                                  "genome_connection",
                                  "insight_panels"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "granted",
                                  "declined",
                                  "expired",
                                  "revoked"
                                ]
                              }
                            },
                            "required": [
                              "permission",
                              "status"
                            ]
                          },
                          "description": "The typed permissions in the latest customer decision. Missing permissions are not granted."
                        }
                      },
                      "required": [
                        "genome_connection_id",
                        "client_user_reference",
                        "status",
                        "access_status",
                        "journey",
                        "client_genome_id",
                        "created_at",
                        "connected_at",
                        "permissions"
                      ]
                    },
                    "customer_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "customer_url_expires_at": {
                      "type": "string",
                      "description": "ISO 8601 timestamp."
                    }
                  },
                  "required": [
                    "genome_connection",
                    "customer_url",
                    "customer_url_expires_at"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          },
          "404": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          },
          "409": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          },
          "503": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          }
        },
        "x-required-scopes": "genome_connections:write"
      }
    },
    "/v2/genome_connections/{genome_connection_id}": {
      "get": {
        "summary": "Get a genome connection.",
        "tags": [
          "Genome connections"
        ],
        "description": "Returns the durable client-scoped connection and its current access state. User identity is never returned.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^gconn_[0-9a-z]{12,64}$"
            },
            "in": "path",
            "name": "genome_connection_id",
            "required": true,
            "description": "The durable genome connection identifier."
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "genome_connection_id": {
                      "type": "string"
                    },
                    "client_user_reference": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "awaiting_customer",
                        "connected",
                        "expired"
                      ]
                    },
                    "access_status": {
                      "nullable": true,
                      "type": "string",
                      "enum": [
                        "pending_genome",
                        "active",
                        "revoked"
                      ]
                    },
                    "journey": {
                      "nullable": true,
                      "type": "string",
                      "enum": [
                        "existing_genome",
                        "new_order"
                      ]
                    },
                    "client_genome_id": {
                      "nullable": true,
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "description": "ISO 8601 timestamp."
                    },
                    "connected_at": {
                      "nullable": true,
                      "type": "string",
                      "description": "ISO 8601 timestamp."
                    },
                    "permissions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "permission": {
                            "type": "string",
                            "enum": [
                              "genome_bundle_downloads",
                              "genome_connection",
                              "insight_panels"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "granted",
                              "declined",
                              "expired",
                              "revoked"
                            ]
                          }
                        },
                        "required": [
                          "permission",
                          "status"
                        ]
                      },
                      "description": "The typed permissions in the latest customer decision. Missing permissions are not granted."
                    }
                  },
                  "required": [
                    "genome_connection_id",
                    "client_user_reference",
                    "status",
                    "access_status",
                    "journey",
                    "client_genome_id",
                    "created_at",
                    "connected_at",
                    "permissions"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          },
          "404": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          }
        },
        "x-required-scopes": "genome_connections:read"
      }
    },
    "/v2/genome_connections/{genome_connection_id}/progress": {
      "get": {
        "summary": "Get normalized genome progress.",
        "tags": [
          "Progress"
        ],
        "description": "Returns the latest coarse progress stage for either a shared existing genome or a new Genome Computer order.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^gconn_[0-9a-z]{12,64}$"
            },
            "in": "path",
            "name": "genome_connection_id",
            "required": true,
            "description": "The durable genome connection identifier."
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "genome_connection_id": {
                      "type": "string"
                    },
                    "client_genome_id": {
                      "nullable": true,
                      "type": "string"
                    },
                    "stage": {
                      "type": "string",
                      "enum": [
                        "awaiting_customer",
                        "order_confirmed",
                        "outbound_to_customer",
                        "with_customer",
                        "inbound_to_lab",
                        "at_lab",
                        "processing",
                        "ready"
                      ]
                    },
                    "updated_at": {
                      "type": "string",
                      "description": "ISO 8601 timestamp."
                    }
                  },
                  "required": [
                    "genome_connection_id",
                    "client_genome_id",
                    "stage",
                    "updated_at"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          },
          "404": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          }
        },
        "x-required-scopes": "genome_connections:read"
      }
    },
    "/v2/genome_connections/{genome_connection_id}/bundle": {
      "get": {
        "summary": "Create a signed .genome bundle download link.",
        "tags": [
          "Genome connections"
        ],
        "description": "Returns a short-lived signed link only when bundle downloads are enabled for the organization and the connection still has an active genome grant.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^gconn_[0-9a-z]{12,64}$"
            },
            "in": "path",
            "name": "genome_connection_id",
            "required": true,
            "description": "The durable genome connection identifier."
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "genome_connection_id": {
                      "type": "string"
                    },
                    "client_genome_id": {
                      "type": "string"
                    },
                    "bundle_version": {
                      "nullable": true,
                      "type": "string"
                    },
                    "download_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expires_in_seconds": {
                      "type": "integer",
                      "minimum": 0,
                      "exclusiveMinimum": true,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "genome_connection_id",
                    "client_genome_id",
                    "bundle_version",
                    "download_url",
                    "expires_in_seconds"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          },
          "404": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          }
        },
        "x-required-scopes": "genome_connections:read"
      }
    },
    "/v2/genome_connections/{genome_connection_id}/insight_panels": {
      "get": {
        "summary": "List insight panels for a connection.",
        "tags": [
          "Insight panels"
        ],
        "description": "Returns the panels enabled for the organization and their current status.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^gconn_[0-9a-z]{12,64}$"
            },
            "in": "path",
            "name": "genome_connection_id",
            "required": true,
            "description": "The durable genome connection identifier."
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "genome_connection_id": {
                      "type": "string"
                    },
                    "client_genome_id": {
                      "nullable": true,
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "insight_panel_id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "waiting_for_genome",
                              "subscription_required",
                              "processing",
                              "ready"
                            ]
                          },
                          "interpretation_version": {
                            "nullable": true,
                            "type": "string"
                          },
                          "generated_at": {
                            "nullable": true,
                            "type": "string",
                            "description": "ISO 8601 timestamp."
                          }
                        },
                        "required": [
                          "insight_panel_id",
                          "title",
                          "status",
                          "interpretation_version",
                          "generated_at"
                        ]
                      }
                    }
                  },
                  "required": [
                    "genome_connection_id",
                    "client_genome_id",
                    "data"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          },
          "404": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          }
        },
        "x-required-scopes": "insight_panels:read"
      }
    },
    "/v2/genome_connections/{genome_connection_id}/insight_panels/{insight_panel_id}": {
      "get": {
        "summary": "Get an insight panel.",
        "tags": [
          "Insight panels"
        ],
        "description": "Returns the current panel state and, when ready, its derived findings. Raw genome files and user identity are not returned.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^gconn_[0-9a-z]{12,64}$"
            },
            "in": "path",
            "name": "genome_connection_id",
            "required": true,
            "description": "The durable genome connection identifier."
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "in": "path",
            "name": "insight_panel_id",
            "required": true,
            "description": "A stable insight panel identifier configured for the organization."
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "insight_panel_id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "waiting_for_genome",
                        "subscription_required",
                        "processing",
                        "ready"
                      ]
                    },
                    "interpretation_version": {
                      "nullable": true,
                      "type": "string"
                    },
                    "generated_at": {
                      "nullable": true,
                      "type": "string",
                      "description": "ISO 8601 timestamp."
                    },
                    "genome_connection_id": {
                      "type": "string"
                    },
                    "client_genome_id": {
                      "nullable": true,
                      "type": "string"
                    },
                    "summary": {
                      "nullable": true,
                      "type": "string"
                    },
                    "sections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "section_id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "evidence_level": {
                            "type": "string",
                            "enum": [
                              "high",
                              "moderate",
                              "emerging"
                            ]
                          },
                          "findings": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "finding_id": {
                                  "type": "string"
                                },
                                "title": {
                                  "type": "string"
                                },
                                "gene": {
                                  "nullable": true,
                                  "type": "string"
                                },
                                "result_label": {
                                  "type": "string"
                                },
                                "meaning": {
                                  "type": "string"
                                },
                                "evidence_level": {
                                  "type": "string",
                                  "enum": [
                                    "high",
                                    "moderate",
                                    "emerging"
                                  ]
                                },
                                "evidence": {
                                  "type": "object",
                                  "properties": {
                                    "basis": {
                                      "type": "string"
                                    },
                                    "clinical_review": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "basis",
                                    "clinical_review"
                                  ]
                                }
                              },
                              "required": [
                                "finding_id",
                                "title",
                                "gene",
                                "result_label",
                                "meaning",
                                "evidence_level",
                                "evidence"
                              ]
                            }
                          }
                        },
                        "required": [
                          "section_id",
                          "title",
                          "evidence_level",
                          "findings"
                        ]
                      }
                    },
                    "citations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "source": {
                            "type": "string"
                          },
                          "url": {
                            "nullable": true,
                            "type": "string",
                            "format": "uri"
                          }
                        },
                        "required": [
                          "source",
                          "url"
                        ]
                      }
                    },
                    "limitations": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "clinical_boundary": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "insight_panel_id",
                    "title",
                    "status",
                    "interpretation_version",
                    "generated_at",
                    "genome_connection_id",
                    "client_genome_id",
                    "summary",
                    "sections",
                    "citations",
                    "limitations",
                    "clinical_boundary"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          },
          "404": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          }
        },
        "x-required-scopes": "insight_panels:read"
      }
    },
    "/v2/webhooks": {
      "post": {
        "summary": "Register a lifecycle webhook endpoint.",
        "tags": [
          "Webhooks"
        ],
        "description": "Endpoints may not target private or local hosts; production endpoints must be HTTPS. Supported event types: genome_connection.connected, genome_connection.progress.updated, genome_connection.ready, genome_connection.access.revoked, insight_panel.status.updated.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "HTTPS endpoint that will receive events."
                  },
                  "description": {
                    "description": "Human-readable label.",
                    "type": "string",
                    "maxLength": 500
                  },
                  "event_types": {
                    "default": [
                      "genome_connection.connected",
                      "genome_connection.progress.updated",
                      "genome_connection.ready",
                      "genome_connection.access.revoked",
                      "insight_panel.status.updated"
                    ],
                    "description": "Event types to subscribe to. Defaults to all.",
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "description": {
                      "nullable": true,
                      "type": "string"
                    },
                    "event_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "signing_secret_preview": {
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "description": "ISO 8601 timestamp."
                    },
                    "signing_secret": {
                      "type": "string",
                      "description": "Returned only once, at creation time."
                    }
                  },
                  "required": [
                    "webhook_id",
                    "url",
                    "description",
                    "event_types",
                    "signing_secret_preview",
                    "status",
                    "created_at",
                    "signing_secret"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          }
        },
        "x-required-scopes": "webhooks:write"
      },
      "get": {
        "summary": "List registered webhook endpoints.",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "webhook_id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "description": {
                            "nullable": true,
                            "type": "string"
                          },
                          "event_types": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "signing_secret_preview": {
                            "nullable": true,
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "description": "ISO 8601 timestamp."
                          }
                        },
                        "required": [
                          "webhook_id",
                          "url",
                          "description",
                          "event_types",
                          "signing_secret_preview",
                          "status",
                          "created_at"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        },
        "x-required-scopes": "webhooks:read"
      }
    },
    "/v2/webhooks/{webhookId}": {
      "delete": {
        "summary": "Disable a webhook endpoint.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "webhookId",
            "required": true,
            "description": "Public webhook id (wh_...)."
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook_id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "description": {
                      "nullable": true,
                      "type": "string"
                    },
                    "event_types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "signing_secret_preview": {
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "description": "ISO 8601 timestamp."
                    }
                  },
                  "required": [
                    "webhook_id",
                    "url",
                    "description",
                    "event_types",
                    "signing_secret_preview",
                    "status",
                    "created_at"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Standard error envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "Machine-readable error code."
                        },
                        "message": {
                          "type": "string"
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Request identifier for support."
                        },
                        "retryable": {
                          "type": "boolean"
                        },
                        "details": {}
                      },
                      "required": [
                        "code",
                        "message",
                        "request_id"
                      ]
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "description": "Standard error envelope."
                }
              }
            }
          }
        },
        "x-required-scopes": "webhooks:write"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.genome.computer",
      "description": "Production"
    },
    {
      "url": "https://staging.api.genome.computer",
      "description": "Staging"
    },
    {
      "url": "http://localhost:4000",
      "description": "Local"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ]
}