openapi: 3.0.1
info:
  title: Sixfold API
  version: 2024-05
  x-logo:
    url: assets/sixfold-logo.png
    altText: Sixfold
  description: >-
    URL: [https://sixfold.ai](https://sixfold.ai)


    # Release Notes


    ## Version: 2024-05


    - Enhances the case creation endpoint to accept documents to attach to the
    new case


    - Add a new endpoint to attach one or more documents to an existing case


    - Defines a new schema for cases and related entities


    - Add Life API support for creating cases



    ## Version: 2023-12


    For more detailed documentation of this version, refer to our [legacy API
    docs
    site](https://sixfoldai.notion.site/16cd8f2ff2e4401ab5341b7cd1618cb4?pvs=25#72d8ead57a1c49b9a3322cf002ffb32f).


    # Introduction


    Greetings from [Sixfold](http://sixfold.ai/)! We're excited to provide you
    with documentation for our API that allows you to seamlessly interact with
    our generative AI solution for insurance underwriters.


    ## Key Features


    - **Analyze a risk** by [creating a case with or without
    documents](#operation/createCase)


    - **Check in on the progress of a case** by [fetching
    it](#operation/getCase)


    - **Receive real-time updates** on the progress of a case [via a
    webhook](#tag/2024-05-Webhooks)


    - **Add one or more documents** [to an existing
    case](#operation/addDocumentsToCase)


    # Getting Started


    To get started with the Sixfold API, use the guides, code examples, and
    reference documentation on this page.


    We will coordinate with you to complete the following set-up steps:


    - **Base URL**: Receive a base URL specific to your environment

    - **API Key**: Receive a an API key

    - **Webhook URL**: Share a URL where we can send important events about a
    case (optional)


    Read more about these steps below.


    ## Base URL


    We will provide a base URL for your dedicated environment. This URL will be
    unique to your tenancy.


    ## API Key


    We will generate and share an API key for your environment via secure send.



    For more details on how to use your API key, refer to the
    [_Authorization_](#section/Authorization) section below.


    ## Webhooks


    If you provide us with a
    [webhook](https://hookdeck.com/webhooks/guides/what-are-webhooks-how-they-work)
    URL, we can send you events about your cases in real time. This is an
    optional step, but it can be helpful if you need to know quickly when a case
    changes state.



    For more details on how to use webhooks, refer to the [_Webhooks_
    section](#tag/2024-05-Webhooks) below.


    ## Integrations


    To configure an integration with a third-party (such as an external file
    management service such as FileNet), please refer to [this
    section](#tag/Integrations-Overview) for additional information.


    We currently support integrations with the following services:


    - **FileNet**: [IBM's document management
    system](https://www.ibm.com/products/filenet-content-manager)
      - see [this section](#tag/IBM-FileNet-Content-Manager) for more information on this integration



    # Security


    ## Transport Layer Security


    We require all API calls to be made over secure connections using HTTPS. We
    require a minimum of TLS 1.2.


    ## Authorization


    You MUST include the Sixfold API key you were issued in a custom header for
    each API request.



    **Example:** `SIXFOLD-API-KEY: <your key>`



    # Field Types


    | Type | Description | Example |

    | --- | --- | --- |

    | IDS | Object identifiers are unique opaque strings. Clients should not
    attach any specific semantic meaning to the format of our IDs. For example,
    our object IDs are
    [UUIDs](https://en.wikipedia.org/wiki/Universally_unique_identifier) today,
    but clients should not count on that behavior, because we may stop using
    UUIDs at any time.  | `c4fb4c10-5b2e-4220-90d2-96d94337e8e6` |

    | STRINGS | Strings are encoded using UTF-8. They do not have character
    limits. | `Diamond West Construction` |

    | DATES | All dates are represented in ISO 8601 format `YYYY-MM-DD`. |
    `2024-01-10` |

    | TIMESTAMPS | All object responses will include a `createdAt` and
    `updatedAt` in timestamp format. All timestamps are UTC and represented in
    ISO 8601 format `YYYY-MM-DDThh:mm:ssZ`. | `2024-01-10T16:00:30Z` |

    | BOOLEANS | Boolean values are represented as as `true` or `false`. |
    `true` |

    | NULL | All optional fields are set to `null` unless a default value is
    set. | `null` |


    # Status Codes & Errors


    ## Status Codes


    | Code | Description |

    | --- | ----------- |

    | 200 | OK. Indicates the request was successful. |

    | 201 | Created. Indicates that the request was successful and has led to
    the creation of a resource. |


    ## Error Codes


    | Code | Description |

    | --- | --- |

    | 400 | Bad Request. Occurs when your request is malformed in some way that
    does not match a more specific 4xx code. |

    | 401 | Unauthorized. Occurs when your request omitted an API key or
    specified an invalid key. |

    | 404 | Not Found. Occurs when you requested a resource which doesn’t exist.
    This could signify an incorrect API endpoint URL or an incorrect object ID.
    |

    | 413 | Content Too Large. Occurs when the size of the request entity
    exceeds the limit defined in the request limits section below. |

    | 429 | Too Many Requests. Occurs when exceeding the request rate limit
    defined in the request limits section below.  |

    | 500 | Internal Server Error. Occurs when Sixfold encounters an error
    serving the request. This is a usually a temporary occurrence, so your best
    bet is to retry again after a short time. |

    | 503 | Service Unavailable. Typically occurs when the API is down for
    maintenance. |


    ## Document Errors


    When creating a case or attaching documents to a case, each document must be
    uploaded as a separate file.


    ### Partial Success


    When uploading multiple documents, the API supports **partial success**:
    some documents may be accepted while others are rejected in the same
    request.


    | Scenario | HTTP Status | Response |

    | --- | --- | --- |

    | All documents valid | 201 | `data` array with all uploaded documents |

    | Some documents valid, some invalid | 201 | `data` array with valid
    documents, `errors` array with rejected documents |

    | All documents invalid | 422 | `errors` array only |


    **Important:** Clients should always check for the presence of an `errors`
    array even when receiving a `2xx` response. A successful status code
    indicates at least one document was processed, but some documents may have
    been rejected.


    ### Example: Partial Success Response


    ```json

    {
      "data": [
        {
          "id": "c4fb4c10-5b2e-4220-90d2-96d94337e8e6",
          "type": "commercialDocuments",
          "attributes": {
            "filename": "policy.pdf",
            "contentType": "application/pdf",
            "byteSize": 102400,
            "createdAt": "2024-05-01T12:00:00Z",
            "updatedAt": "2024-05-01T12:00:00Z"
          }
        }
      ],
      "errors": [
        {
          "title": "Invalid document",
          "detail": "data.csv failed: Content type is not supported. Check the list of supported content types",
          "code": "invalid-document",
          "source": {
            "document": "data.csv"
          },
          "status": 422
        }
      ]
    }

    ```


    ### Common Rejection Reasons


    Documents may be rejected for the following reasons:


    - **Unsupported content type**: The file type is not in the list of accepted
    content types (see [Document Types](#section/Limits/Document-Types) below).
    For example, CSV files (`text/csv`) are not supported.

    - **Encrypted files**: Password-protected or encrypted Microsoft Office
    files cannot be processed.


    # Versioning


    Our API uses URI date-based versioning.



    **Example**: `POST /api/2023-12/cases`



    We will always issue a new version of our API if we need to make changes
    that would break existing clients. Some examples of breaking changes
    include:


    - Removing functionality


    - Renaming parameters


    - Changing endpoint requirements



    We may include backward-compatible changes in the current version of our
    API. These changes are designed to improve the API without breaking existing
    clients. Examples include:



    - Adding new API endpoints


    - Adding new optional request parameters to existing API methods


    - Adding new fields to existing API responses


    # Limits


    This section describes how limits are applied in the Sixfold API.


    ## Document Types


    There is restrictions on what types of documents can be uploaded. 


    ### Commercial

    The following content types are accepted for commercial cases:


    | Content Type | Extension   |

    | --- |-------------|

    |  application/pdf   | .pdf        |

    |  application/json   | .json       |

    |  image/jpeg   | .jpeg, .jpg |

    |  image/tiff   | .tiff, .tif |

    |  image/png   | .png        |

    |  text/plain   | .txt        |

    |  text/html   | .html       |

    |  application/msword   | .doc        |

    |  application/vnd.openxmlformats-officedocument.wordprocessingml.document  
    | .docx       |

    |  application/vnd.ms-powerpoint   | .ppt        |

    | 
    application/vnd.openxmlformats-officedocument.presentationml.presentation  
    | .pptx       |

    |  application/vnd.ms-excel   | .xls        |

    |  application/vnd.openxmlformats-officedocument.spreadsheetml.sheet   |
    .xlsx       |

    |  application/rtf   | .rtf        |

    |  image/bmp   | .bmp        |

    |  image/gif   | .gif        |


    ### Life


    The following content types are accepted for life cases:


    | Content Type | Extension   |

    | --- |-------------|

    |  application/pdf | .pdf        |

    |  application/json | .json       |

    |  image/jpeg  | .jpeg, .jpg |

    |  image/tiff  | .tiff, .tif |

    |  image/png   | .png        |

    |  text/plain  | .txt        |

    |  text/html   | .html       |

    |  application/xhtml+xml | .xml        |


    ## Request Rate


    You may not send more than 300 requests per minute. If you exceed this
    limit, the server will respond with `429 - Too Many Requests` and block
    further requests for a short time.


    ## Request Size


    No request body may be larger than **50 megabytes**. If you exceed this
    limit, the server will respond with `413 - Content Too Large`.
servers:
  - url: https://{tenant}.sixfold.{tld}/api
    description: The tenant-specific subdomain.
    variables:
      tenant:
        default: api
        description: The tenant-specific subdomain.
      tld:
        default: app
        description: >-
          The tld (top-level domain) of a customer's Sixfold tenant. In most
          cases the tld will be `app`.
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: SIXFOLD-API-KEY
      description: Your API key should be included as a custom authorization header
  schemas:
    InsuranceLine:
      type: object
      properties:
        id:
          type: string
          example: 1cfd8bdf-5a20-4dfb-aca0-729df7795e14
          description: Unique identifier for the insurance line (provided by Sixfold)
        name:
          type: string
          example: General Liability
          description: The name of the insurance line
    BusinessClassification:
      type: object
      properties:
        system:
          type: string
          enum:
            - naics
            - sic
          example: naics
          description: Indication of the type of business classification codes used.
        code:
          type: string
          example: '236118'
          description: Specific code matched against the insured.
        title:
          type: string
          example: Commercial and Institutional Building Construction
          description: The name or title of the business classification code.
        explanation:
          type: string
          example: >-
            236118 - Residential Remodelers The business summary indicates that
            this is a general building contractor that offers home remodeling
            and design-build services. This aligns directly with the NAICS code
            236118, which is designated for businesses primarily responsible for
            remodeling construction of houses and other residential buildings.
            The services offered by the business, such as home remodeling and
            design-build, are specifically mentioned in the NAICS context as
            activities included in this industry. The business is likely to
            serve customers who own residential properties, including
            single-family and multifamily homes, who are looking to remodel or
            renovate their properties. This is why the NAICS code 236118 -
            Residential Remodelers is assigned with high confidence.
          description: Description of why the code was matched against the insured.
        confidence:
          type: number
          format: float
          minimum: 0
          maximum: 1
          example: 0.79
          description: >-
            Numerical value with a precision of 2 decimal places, ranging from
            0.00-1.00, to indicate the confidence interval of this code matching
            against the insured. 0.00 means confidence is low; 1.00 means
            confidence is high.
    Address:
      type: object
      description: Object containing the address details for the insured.
      properties:
        street:
          type: string
          example: 6676 Van Buren Boulevard
          description: >-
            Street address of the insured, including street name and number
            along with apartment, unit, suite, etc.
        city:
          type: string
          example: Riverside
          description: City of the insured.
        state:
          type: string
          example: CA
          description: >-
            State of the insured, defined as the ISO-3166-2 subdivision code.
            Required for insured entities with a United States address where the
            country is set to US
        postalCode:
          type: string
          example: 92503
          description: >-
            Postal code in accordance with the formatting standards of the
            country specified in the country field.
        country:
          type: string
          example: US
          description: Country of the insured, represented as an ISO-3166 alpha-2 code.
    InsuredCompany:
      type: object
      properties:
        name:
          type: string
          example: Diamond West Construction
          description: The name of the insured company.
        businessActivity:
          type: string
          example: Construction
          description: The primary business activity of the insured company.
        summary:
          type: string
          example: >-
            Diamond West Development is a general building contractor based in
            Riverside, CA, with over 30 years of experience in the home
            improvement industry. They offer a wide range of services, including
            home remodeling, kitchen and bathroom remodeling, plumbing,
            electrical, flooring, and framing.
          description: A summary of the insured company.
        webPresence:
          type: object
          description: A object containing the web presence of the insured company.
          properties:
            urls:
              type: array
              items:
                type: string
                format: uri
                example: http://diamondwest.com
        businessClassification:
          type: array
          items:
            $ref: '#/components/schemas/BusinessClassification'
        address:
          $ref: '#/components/schemas/Address'
    RiskEvaluation:
      type: object
      properties:
        score:
          type: integer
          minimum: 0
          maximum: 5
          example: 4
          description: >-
            Numerical value, ranging from 0-5, indicating an evaluation of risk.
            0 means a high level of risk; 5 means a low level of risk.
        summary:
          type: string
          example: >-
            We have determined a risk score of 4 given the lack of negative risk
            signals detected.
          description: A summary of the case and the reasoning behind the score.
    KeywordSignal:
      type: object
      properties:
        type:
          type: string
          example: KeywordSignal
          description: |
            KeywordSignal
        keyword:
          type: string
          example: Family owned business
          description: |
            The keyword that was detected.
        explanation:
          type: string
          example: >
            The business is involved in construction activities as evidenced by
            the various permits for building, plumbing, mechanical, and grading.
            These permits indicate that the business is engaged in constructing
            new structures, remodeling existing ones, and installing various
            systems, which are all activities related to construction.
          description: |
            The explanation of the signal that was detected.    
        impact:
          type: string
          enum:
            - positive
            - negative
            - neutral
            - disqualifying
          example: positive
          description: |
            The impact of the signal that was detected.
        weight:
          type: number
          example: 1
          description: |
            The weight of the signal that was detected
    NaicsSignal:
      type: object
      properties:
        type:
          type: string
          example: naicsSignal
          description: |
            The type of signal that was detected (naicsSignal).
        code:
          type: string
          example: 1001
          description: |
            The specific NAICS code matched against the insured. 
        title:
          type: string
          example: Construction
          description: |
            The name/title of the NAICS code.
        explanation:
          type: string
          example: >
            The business is involved in construction activities as evidenced by
            the various permits for building, plumbing, mechanical, and grading.
            These permits indicate that the business is engaged in constructing
            new structures, remodeling existing ones, and installing various
            systems, which are all activities related to construction.
          description: |
            The explanation of the signal that was detected.    
        impact:
          type: string
          enum:
            - positive
            - negative
            - neutral
            - disqualifying
          example: positive
          description: |
            The impact of the signal that was detected.
        weight:
          type: number
          example: 1
          description: |
            The weight of the signal that was detected
    SicSignal:
      type: object
      properties:
        type:
          type: string
          example: sicSignal
          description: |
            The type of signal that was detected (sicSignal).
        code:
          type: string
          example: 1001
          description: |
            The specific SIC code matched against the insured. 
        title:
          type: string
          example: Construction
          description: |
            The name/title of the SIC code
        explanation:
          type: string
          example: >
            The business is involved in construction activities as evidenced by
            the various permits for building, plumbing, mechanical, and grading.
            These permits indicate that the business is engaged in constructing
            new structures, remodeling existing ones, and installing various
            systems, which are all activities related to construction.
          description: |
            The explanation of the signal that was detected.    
        impact:
          type: string
          enum:
            - positive
            - negative
            - neutral
            - disqualifying
          example: positive
          description: |
            The impact of the signal that was detected.
        weight:
          type: number
          example: 1
          description: |
            The weight of the signal that was detected
    Q&ASignal:
      type: object
      properties:
        type:
          type: string
          example: Q&ASignal
          description: |
            Q&ASignal
        title:
          type: string
          example: The business is family owned
          description: |
            The answer criteria that was detected.
        explanation:
          type: string
          example: >
            The business is involved in construction activities as evidenced by
            the various permits for building, plumbing, mechanical, and grading.
            These permits indicate that the business is engaged in constructing
            new structures, remodeling existing ones, and installing various
            systems, which are all activities related to construction.
          description: |
            The explanation of the signal that was detected.    
        impact:
          type: string
          enum:
            - positive
            - negative
            - neutral
            - disqualifying
          example: positive
          description: |
            The impact of the signal that was detected.
        weight:
          type: number
          example: 1
          description: |
            The weight of the signal that was detected
    WebpageSource:
      type: object
      properties:
        type:
          type: string
          example: webpage
          description: |
            Type of source (webpage)
        url:
          type: string
          example: https://www.yelp.com/biz/abc-roofing-company
          description: |
            The url to a webpage containing the source information.
    DocumentSource:
      type: object
      properties:
        type:
          type: string
          example: document
          description: |
            Type of source (document)
        filename:
          type: string
          example: filename.pdf
          description: |
            The filename of the document used as the source of information.
    QuestionAnswer:
      type: object
      properties:
        type:
          type: string
          example: questionAnswer
          description: |
            Type of facts (questionAnswer)
        question:
          type: string
          description: |
            Configured question to be answered.
          example: >-
            Does PCI Compliance applicable to this company? If so, is the
            company PCI Compliant?
        answer:
          type: string
          description: The generated answer to the question
          example: >
            Is PCI Compliance Applicable to Mondelez International
            Inc.?\nMondelez International Inc. is a multinational confectionery,
            food, and beverage company that manufactures and markets food
            products and beverages. The company operates in approximately 160
            countries and has an annual revenue of about $26.5 billion.\n\nThe
            Payment Card Industry Data Security Standard (PCI DSS) is a set of
            security standards that ensure companies that accept, process,
            store, or transmit credit card information maintain a secure
            environment. PCI DSS is administered and managed by the PCI Security
            Standards Council (PCI SSC), an independent body created by major
            payment card brands such as Visa, MasterCard, and American Express.
            \n\nPCI DSS applies to any organization, regardless of size or the
            number of transactions, that accepts, transmits, or stores
            cardholder data. This includes companies that process credit card
            information and merchants that accept payment cards as payment for
            goods and services. \n\nGiven that Mondelez International Inc.
            operates on a global scale and deals with financial transactions, it
            would need to comply with PCI DSS. \n\n## Is Mondelez International
            Inc. PCI Compliant?\nMondelez International Inc. has a global Ethics
            & Compliance program that guides its employees to adhere to
            applicable laws and regulations while conducting business worldwide.
            The company also has a dedicated Compliance team that works with
            senior management to implement the program and ensures employees
            understand what is expected of them. \n\nHowever, it is unclear from
            the available information whether Mondelez International Inc. is PCI
            compliant regarding the specific requirements of PCI DSS. This would
            require further investigation and analysis of the company's data
            security measures and practices.
        sources:
          type: array
          description: >
            An array containing the individual sources used to formulate the
            answer to the question.
          items:
            oneOf:
              - $ref: '#/components/schemas/WebpageSource'
              - $ref: '#/components/schemas/DocumentSource'
        impact:
          type: string
          enum:
            - positive
            - negative
            - neutral
            - disqualifying
          example: positive
          description: |
            The impact of the signal if there was a risk signal detected
    QuestionSection:
      type: object
      properties:
        section_id:
          type: string
          description: |
            Unique UUID identifier for the section.
          example: a1b2c3d4-e5f6-7g8h-9i0j-k1l2m3n4o5p6
        section:
          type: string
          description: |
            Question section defined in settings.
          example: Health
        section_summary:
          type: string
          description: >-
            Summary for the section based on the answer for each questions in
            the section.
          example: >
            The patient has a history of hypertension and diabetes. The patient
            is currently taking medication for hypertension and diabetes.
        questions:
          type: array
          description: |
            An array of questions in the section.
          items:
            $ref: '#/components/schemas/QuestionAnswer'
    KeywordMatch:
      type: object
      properties:
        type:
          type: string
          example: keywordMatch
          description: |
            Type of facts (keywordMatch)
        explanation:
          type: string
          example: |
            The company's Yelp page says they do roofing.
          description: >
            Explanation of why the configured keyword matched against the
            insured.
        keyword:
          type: string
          example: roofing
          description: |
            The keyword that was detected in the case.
        impact:
          type: string
          enum:
            - positive
            - negative
            - neutral
            - disqualifying
          example: positive
          description: |
            The impact of the signal if there was a risk signal detected
    Facts:
      type: array
      description: |
        An array of facts that are relevant to the case.
      items:
        oneOf:
          - $ref: '#/components/schemas/QuestionSection'
          - $ref: '#/components/schemas/KeywordMatch'
    NarrativeSection:
      type: object
      properties:
        section_name:
          type: string
          description: Name of the section.
          example: Description of Operations
        text:
          type: string
          description: Text content of the section.
          example: The company engages in commercial construction initiatives.
    Narrative:
      type: array
      description: >
        An array containing each section of the underwriting narrative for the
        case.
      items:
        $ref: '#/components/schemas/NarrativeSection'
    LossRunClaim:
      type: object
      properties:
        claimDateWhenAccidentHappens:
          type: string
          format: date
          description: The date when the accident occurred (ISO 8601 format, YYYY-MM-DD)
          example: '2024-01-15'
        lossDescription:
          type: string
          description: Description of the loss
          example: Water damage to property
        totalIncurred:
          type: number
          format: float
          description: Total amount incurred for the claim
          example: 25000.5
        status:
          type: string
          description: Current status of the claim
          example: Open
        openLosses:
          type: number
          format: float
          description: Amount of open losses
          example: 15000
        paidLosses:
          type: number
          format: float
          description: Amount of paid losses
          example: 10000
        lineOfBusiness:
          type: string
          description: Line of business for the claim
          example: Property
        lineOfBusinessId:
          type: string
          format: uuid
          description: Unique identifier for the line of business of the claim
        policyStartDate:
          type: string
          format: date
          description: Start date of the policy (ISO 8601 format, YYYY-MM-DD)
          example: '2024-01-01'
        policyExpiryDate:
          type: string
          format: date
          description: Expiration date of the policy (ISO 8601 format, YYYY-MM-DD)
          example: '2025-01-01'
        insurer:
          type: string
          description: Name of the insurer
          example: ABC Insurance Company
    LossPerLine:
      type: object
      properties:
        lineOfBusiness:
          type: string
          example: Auto
          description: |
            Name of the line of business
        lineOfBusinessId:
          type: string
          format: uuid
          description: |
            Unique identifier for the line of business
        summary:
          type: string
          description: |
            Summary of the loss run data for the line of business
        claims:
          type: array
          description: Extracted claims
          items:
            $ref: '#/components/schemas/LossRunClaim'
    Loss:
      type: array
      description: |
        An array of loss run data for each line of business.
      items:
        $ref: '#/components/schemas/LossPerLine'
    Analysis:
      type: object
      description: Object containing the results of the analysis for the case.
      properties:
        status:
          type: string
          enum:
            - pending
            - done
            - error
          example: error
          description: Status of the case analysis.
        errors:
          type: array
          description: >-
            List of errors encountered during the analysis only if the status is
            `error`.
          items:
            type: object
            properties:
              code:
                type: number
                description: Error code
                example: 401
              detail:
                type: string
                description: Error message
                example: Invalid API key
          example:
            - code: 401
              detail: Invalid API key
        riskEvaluation:
          $ref: '#/components/schemas/RiskEvaluation'
        riskSignalDetections:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/KeywordSignal'
              - $ref: '#/components/schemas/NaicsSignal'
              - $ref: '#/components/schemas/SicSignal'
              - $ref: '#/components/schemas/Q&ASignal'
        facts:
          $ref: '#/components/schemas/Facts'
        narrative:
          $ref: '#/components/schemas/Narrative'
        loss:
          $ref: '#/components/schemas/Loss'
    CaseDocument:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the document
          example: 0544e627-5c81-49da-99bc-a2822ead6b99
        filename:
          type: string
          example: file 1.pdf
          description: The name of the file
        contentType:
          type: string
          example: application/pdf
          description: The type of the file
        byteSize:
          type: integer
          example: 123456
          description: The size of the file in bytes
    Quote:
      type: boolean
      description: Boolean value representing whether a case has been quoted
      example: true
    Case:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the case
          example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
        type:
          type: string
          description: Value will always be `commercialCases`
          example: commercialCases
        attributes:
          type: object
          description: The attributes of the case.
          properties:
            externalId:
              type: string
              description: Unique custom identifier for the case (optional)
              example: bda31907-49ad-4cf2-b76f-7738f359ae5e
            name:
              type: string
              description: The name/title of the specific case
              example: Diamond West Construction Case
            insuranceLine:
              $ref: '#/components/schemas/InsuranceLine'
            insuredCompany:
              $ref: '#/components/schemas/InsuredCompany'
            analysis:
              $ref: '#/components/schemas/Analysis'
            documents:
              type: array
              items:
                $ref: '#/components/schemas/CaseDocument'
            quoted:
              $ref: '#/components/schemas/Quote'
              default: null
            alternateUrl:
              type: string
              description: Link in the Sixfold UI to the case details page
              example: >-
                https://{tenant}.sixfold.app/commercial/cases/c4fb4c10-5b2e-4220-90d2-96d94337e8e6
            createdAt:
              type: string
              format: date-time
              example: '2024-01-10T16:00:30Z'
              description: Date and time that the case was created
            updatedAt:
              type: string
              format: date-time
              example: '2024-01-10T16:05:30Z'
              description: Date and time that the case was last updated
    Cases:
      type: array
      items:
        $ref: '#/components/schemas/Case'
    PaginationMeta:
      type: object
      description: Standard pagination metadata
      properties:
        page:
          type: integer
          description: Current page number
          example: 1
        pageSize:
          type: integer
          description: Number of items per page
          example: 100
        totalItems:
          type: integer
          description: Total number of records available
          example: 250
        totalPages:
          type: integer
          description: Total number of pages
          example: 3
      required:
        - page
        - pageSize
        - totalItems
        - totalPages
    PaginationLinks:
      type: object
      description: Standard pagination links following JSON:API conventions
      properties:
        self:
          type: string
          description: URL for the current page
          example: /api/2024-05/commercial/cases?page=2&page_size=100
        first:
          type: string
          description: URL for the first page
          example: /api/2024-05/commercial/cases?page=1&page_size=100
        last:
          type: string
          description: URL for the last page
          example: /api/2024-05/commercial/cases?page=3&page_size=100
        prev:
          type: string
          nullable: true
          description: URL for the previous page, null if on first page
          example: /api/2024-05/commercial/cases?page=1&page_size=100
        next:
          type: string
          nullable: true
          description: URL for the next page, null if on last page
          example: /api/2024-05/commercial/cases?page=3&page_size=100
      required:
        - self
        - first
        - last
    Error_400:
      type: object
      properties:
        errors:
          type: array
          description: Array of errors
          items:
            type: object
            properties:
              title:
                type: string
                description: Error's title
                example: Bad Request
              detail:
                type: string
                description: Detailed error message
                example: Missing parameters
              source:
                type: object
                properties:
                  parameter:
                    type: string
                    description: Parameter that caused the error
                    example: case
              status:
                type: integer
                description: HTTP status code
                example: 400
    Error_401:
      type: object
      properties:
        errors:
          type: array
          description: Array of errors
          items:
            type: object
            properties:
              title:
                type: string
                description: Error's title
                example: Unauthorized
              status:
                type: integer
                description: HTTP status code
                example: 401
              source:
                type: object
                properties:
                  parameter:
                    type: string
                    description: Parameter that caused the error
                    example: Invalid Sixfold API key
              code:
                type: string
                description: Error code
                example: authorization error
    Error_404:
      type: object
      properties:
        errors:
          type: array
          description: Array of errors
          items:
            type: object
            properties:
              title:
                type: string
                description: Error's title
                example: Not Found
              detail:
                type: string
                description: Detailed error message
                example: Case not found
              source:
                type: object
                properties:
                  parameter:
                    type: string
                    description: Parameter that caused the error
                    example: case
              code:
                type: string
                description: Error code
                example: Case not found
              status:
                type: integer
                description: HTTP status code
                example: 404
    CreateCaseRequest:
      type: object
      required:
        - case
      properties:
        case:
          type: object
          required:
            - insuranceLineId
          properties:
            name:
              type: string
              description: The name/title of the specific case
              example: Diamond West Construction Case
            insuranceLineId:
              type: string
              description: Unique identifier for the insurance line (provided by Sixfold)
              example: 1cfd8bdf-5a20-4dfb-aca0-729df7795e14
            externalId:
              type: string
              description: Unique custom identifier for the case (optional)
              example: bda31907-49ad-4cf2-b76f-7738f359ae5e
            insured:
              type: object
              properties:
                name:
                  type: string
                  description: The name of the insured individual or entity
                  example: Diamond West Construction
                address:
                  $ref: '#/components/schemas/Address'
    CreateCaseRequestWithDocument:
      type: object
      required:
        - case
        - documents[]
      properties:
        case:
          type: string
          format: JSON
          description: |
            JSON string representing the case object
          example: >-
            {"name": "Diamond West Construction Case", "insuranceLineId":
            "1cfd8bdf-5a20-4dfb-aca0-729df7795e14", "externalId":
            "bda31907-49ad-4cf2-b76f-7738f359ae5e", "insured": {"name": "Diamond
            West Construction", "address": {"street": "6676 Van Buren
            Boulevard", "city": "Riverside", "state": "CA", "country": "US",
            "postalCode": "92503"}}}
        documents[]:
          type: array
          items:
            type: string
            format: binary
    InsuredCompany-2:
      type: object
      properties:
        name:
          type: string
          example: Diamond West Construction
          description: The name of the insured company.
        businessActivity:
          type: string
          example: null
          description: The primary business activity of the insured company.
        summary:
          type: string
          example: null
          description: A summary of the insured company.
        webPresence:
          type: object
          description: A object containing the web presence of the insured company.
          properties:
            urls:
              type: array
              example: []
              items:
                type: string
                format: uri
        businessClassification:
          type: array
          example: []
          items:
            $ref: '#/components/schemas/BusinessClassification'
        address:
          $ref: '#/components/schemas/Address'
    Analysis-2:
      type: object
      description: Object containing the results of the analysis for the case.
      properties:
        status:
          type: string
          enum:
            - pending
            - done
            - error
          example: pending
          description: Status of the case analysis.
        riskEvaluation:
          allOf:
            - $ref: '#/components/schemas/RiskEvaluation'
            - properties:
                score:
                  example: null
                summary:
                  example: No risk overview available
        riskSignalDetections:
          type: array
        facts:
          type: array
          description: |
            An array of facts that are relevant to the case.
          items:
            oneOf:
              - $ref: '#/components/schemas/QuestionSection'
              - $ref: '#/components/schemas/KeywordMatch'
          example: []
        narrative:
          $ref: '#/components/schemas/Narrative'
    CommercialDocument:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the document
          example: 0544e627-5c81-49da-99bc-a2822ead6b99
        filename:
          type: string
          example: file 1.pdf
          description: The name of the file
        contentType:
          type: string
          example: application/pdf
          description: The type of the file
        byteSize:
          type: integer
          example: 123456
          description: The size of the file in bytes
        classification:
          type: string
          description: classification of the document
          example: Loss Run
    CreatedCase:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the case
          example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
        type:
          type: string
          description: Value will always be `commercialCases`
          example: commercialCases
        attributes:
          type: object
          description: The attributes of the case.
          properties:
            externalId:
              type: string
              description: Unique custom identifier for the case (optional)
              example: bda31907-49ad-4cf2-b76f-7738f359ae5e
            name:
              type: string
              description: The name/title of the specific case
              example: Diamond West Construction Case
            insuranceLine:
              $ref: '#/components/schemas/InsuranceLine'
            insuredCompany:
              $ref: '#/components/schemas/InsuredCompany-2'
            analysis:
              $ref: '#/components/schemas/Analysis-2'
            documents:
              type: array
              items:
                $ref: '#/components/schemas/CommercialDocument'
            quoted:
              type: boolean
              description: Boolean value representing whether a case has been quoted
              example: null
            alternateUrl:
              type: string
              description: Link in the Sixfold UI to the case details page
              example: >-
                https://{tenant}.sixfold.app/commercial/cases/c4fb4c10-5b2e-4220-90d2-96d94337e8e6
            createdAt:
              type: string
              format: date-time
              example: '2024-01-10T16:00:30Z'
              description: Date and time that the case was created
            updatedAt:
              type: string
              format: date-time
              example: '2024-01-10T16:05:30Z'
              description: Date and time that the case was last updated
    Error_409:
      type: object
      properties:
        errors:
          type: array
          description: Array of errors
          items:
            type: object
            properties:
              title:
                type: string
                description: Error's title
                example: External id is invalid
              detail:
                type: string
                description: Detailed error message
                example: has already been taken
              source:
                type: object
                properties:
                  parameter:
                    type: string
                    description: Parameter that caused the error
                    example: case
              code:
                type: string
                description: Error code
                example: external-id-taken-invalid
              status:
                type: integer
                description: HTTP status code
                example: 409
    Error_422:
      type: object
      properties:
        errors:
          type: array
          description: Array of errors
          items:
            type: object
            properties:
              title:
                type: string
                description: Error's title
                example: Content type is invalid
              detail:
                type: string
                description: Detailed error message
                example: >-
                  Content type image/gif is invalid. https://sixfold.doc/ for
                  valid types
              code:
                type: string
                description: Error code
                example: content-type-inclusion-invalid
              source:
                type: object
                properties:
                  document:
                    type: string
                    description: Document that caused the error
                    example: file.gif
              status:
                type: integer
                description: HTTP status code
                example: 422
    Error_500:
      type: object
      properties:
        errors:
          type: array
          description: Array of errors
          items:
            type: object
            properties:
              title:
                type: string
                description: Error's title
                example: Internal Server Error
              detail:
                type: string
                description: Detailed error message
                example: >-
                  We experienced an internal server error. The request may be
                  successful if you try again.
              status:
                type: integer
                description: HTTP status code
                example: 500
              source:
                type: object
                properties:
                  parameter:
                    type: string
                    description: Parameter that caused the error
                    example: Internal Error
              code:
                type: string
                description: Error code
                example: Internal error
    CommercialCase:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the case
          example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
        type:
          type: string
          description: Value will always be `commercialCases`
          example: commercialCases
        attributes:
          type: object
          description: The attributes of the case.
          properties:
            externalId:
              type: string
              description: Unique custom identifier for the case (optional)
              example: bda31907-49ad-4cf2-b76f-7738f359ae5e
            name:
              type: string
              description: The name/title of the specific case
              example: Diamond West Construction Case
            insuranceLine:
              $ref: '#/components/schemas/InsuranceLine'
            insuredCompany:
              $ref: '#/components/schemas/InsuredCompany'
            analysis:
              $ref: '#/components/schemas/Analysis'
            documents:
              type: array
              items:
                $ref: '#/components/schemas/CommercialDocument'
            quoted:
              $ref: '#/components/schemas/Quote'
              default: null
            alternateUrl:
              type: string
              description: Link in the Sixfold UI to the case details page
              example: >-
                https://{tenant}.sixfold.app/commercial/cases/c4fb4c10-5b2e-4220-90d2-96d94337e8e6
            createdAt:
              type: string
              format: date-time
              example: '2024-01-10T16:00:30Z'
              description: Date and time that the case was created
            updatedAt:
              type: string
              format: date-time
              example: '2024-01-10T16:05:30Z'
              description: Date and time that the case was last updated
    Document:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the document
          example: 0544e627-5c81-49da-99bc-a2822ead6b99
        type:
          type: string
          example: commercialDocument
          description: The type of the case
        attributes:
          type: object
          description: The attributes of the document
          properties:
            filename:
              type: string
              example: file 1.pdf
              description: The name of the file
            contentType:
              type: string
              example: application/pdf
              description: The type of the file
            byteSize:
              type: integer
              example: 123456
              description: The size of the file in bytes
            createdAt:
              type: string
              format: date-time
              example: '2024-01-10T16:00:30Z'
              description: The date and time the document was created
            updatedAt:
              type: string
              format: date-time
              example: '2024-01-10T16:05:30Z'
              description: The date and time the document was last updated
    AddOrUpdateQuoteRequest:
      type: object
      required:
        - case_quote
      properties:
        case_quote:
          type: object
          description: >
            Quote status payload. Provide **status** (recommended) or the
            deprecated **quoted** boolean.

            Send `status: null` to clear. At least one of status or quoted must
            be provided unless clearing with null.
          properties:
            status:
              type: string
              nullable: true
              enum:
                - quoted
                - not_quoted
                - bound
                - not_taken_up
                - declined
              description: >
                The quote/case status. Use **quoted** when a quote was provided,
                **not_quoted** when no quote yet,

                **bound** when the policy was bound, **not_taken_up** when the
                quote was not taken up, or **declined** when declined.

                Send `null` to clear the status.
              example: bound
            quoted:
              type: boolean
              description: >
                **Deprecated.** Use **status** instead. `true` maps to status
                `quoted`, `false` to `not_quoted`.

                Requests using this parameter will succeed but return
                deprecation headers (Deprecation, X-Deprecation-Warning).
              example: true
              deprecated: true
    InsuredPerson:
      type: object
      properties:
        name:
          type: string
          example: Jane Doe
          description: The name of the insured person.
        bornOn:
          type: string
          format: ISO 8601 date
          example: '1949-12-31'
          description: The date of birth of the insured person
        occupation:
          type: string
          example: Software Engineer
          description: The occupation of the insured person
        sex:
          type: string
          example: female
          description: The sex assigned at birth of the insured person
          enum:
            - intersex
            - female
            - male
    DocumentCategory:
      type: string
      description: >-
        The top-level category of the document. (See [Document
        Classification](#tag/Document-Classification) for more information.)
      enum:
        - Medical Record
        - Application
        - Part II
        - Lab
        - EKG
        - RX/DX Report
        - Background Report
        - Financial
        - Diagnostic Report
    FileNetIntegrationFileSpecs:
      type: array
      items:
        type: object
        description: File specs for the integration
        example:
          id: sixfold-internal-unique-identifier
          fileNetId: filenet-unique-identifier
          category: Medical Record
        properties:
          id:
            type: string
            description: Unique identifier of the file
            example: sixfold-internal-unique-identifier
          fileNetId:
            type: string
            description: Unique FileNet identifier
            example: filenet-unique-identifier
          category:
            $ref: '#/components/schemas/DocumentCategory'
            example: Medical Record
    FileNetIntegration:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the integration
          example: integration-id-unique-identifier
        caseId:
          type: string
          description: Unique identifier of the case
          example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
        files:
          $ref: '#/components/schemas/FileNetIntegrationFileSpecs'
    GenericIntegration:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the integration
          example: 78ea09d0-55f7-407a-9fc9-d625cfd84085
        case_id:
          type: string
          description: Unique identifier of the case
          example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
        dummyKey:
          type: string
    Integrations:
      type: array
      items:
        anyOf:
          - $ref: '#/components/schemas/FileNetIntegration'
          - $ref: '#/components/schemas/GenericIntegration'
      description: |
        Array of integrations for the case
    Sources:
      type: object
      properties:
        filename:
          type: string
          description: The filename of the source
          example: Medical_report.pdf
        pages:
          type: array
          items:
            type: integer
          example:
            - 1
            - 2
            - 3
          description: |
            The pages of the source that were used in the analysis.
    KeywordSignal-2:
      type: object
      properties:
        type:
          type: string
          enum:
            - KeywordSignal
          description: The type of signal
          example: KeywordSignal
        keyword:
          type: string
          example: Cancer
          description: |
            The keyword that was detected
        explanation:
          type: string
          example: >-
            The fact 'Concerning for malignancy' matches the keyword signal
            'Cancer' with a negative impact based on the risk appetite provided.
          description: |
            The explanation of the signal that was detected.
        impact:
          type: string
          enum:
            - positive
            - negative
            - disqualifying
          example: positive
          description: |
            The impact of the signal that was detected.
        sources:
          type: array
          items:
            - $ref: '#/components/schemas/Sources'
          description: |
            The sources of the signal that was detected.
    LifeAnalysis:
      type: object
      description: Object containing the results of the analysis for the life case.
      properties:
        status:
          type: string
          enum:
            - pending
            - done
            - error
          example: error
          description: Status of the life case analysis.
        errors:
          type: array
          description: >-
            List of errors encountered during the analysis only if the status is
            `error`.
          items:
            type: object
            properties:
              code:
                type: number
                description: Error code
                example: 401
              detail:
                type: string
                description: Error message
                example: Invalid API key
          example:
            - code: 401
              detail: Invalid API key
        riskSignalDetections:
          type: array
          items:
            - $ref: '#/components/schemas/KeywordSignal-2'
        factsCount:
          type: integer
          description: The number of facts detected in the case
          example: 123
        riskOverview:
          type: string
          description: A short summary of the person's life risk
          example: >
            Jane Doe, a 74-year-old female who smokes, has a history of several
            significant medical conditions and treatments. She has been
            diagnosed with strep pharyngitis, appendicitis, migraines with aura,
            atypical chest pain concerning for angina, community-acquired
            pneumonia,
        fullHealthSummary:
          type: string
          description: A detailed summary of the person's health
          example: >
            Jane Doe's medical history is extensive, beginning with diagnoses of
            strep pharyngitis in 1980 treated with clindamycin due to penicillin
            allergy, and appendicitis in 1987, both of which were treated
            accordingly. In 1993, she was diagnosed with migraines with aura and
            began treatment with metoclopramide and sumatriptan. By 2000, she
            experienced atypical chest pain, which raised concerns for angina,
            leading to a cardiology referral and the initiation of ASA. In 2006,
            she was diagnosed with community-acquired pneumonia and subsequently
            with chronic myeloid leukemia (CML) in 2013, which is currently in
            remission with ongoing imatinib treatment. Her history also includes
            a COPD exacerbation in 2016 treated with albuterol and Advair, and
            orthostatic hypotension diagnosed in 2018, with a treatment plan
            including fludrocortisone. Throughout her medical journey, Jennifer
            has been prescribed various medications, including ASA for atypical
            chest pain and post-myocardial infarction, atenolol and atorvastatin
            for coronary artery disease post-myocardial infarction, and imatinib
            specifically targeting her CML. The presence of atenolol and
            atorvastatin suggests a focus on heart health and cholesterol, while
            imatinib specifically targets her CML. Notably, there is an absence
            of direct treatment for high blood pressure, despite the presence of
            medications that could indirectly affect it, and no mention of
            medications for mental health conditions or sleep apnea, which are
            not listed among her diagnosed conditions.
    LifeCase:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the life case
          example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
        type:
          type: string
          description: Value will always be `lifeCases`
          example: lifeCases
        attributes:
          type: object
          description: The attributes of the life case.
          properties:
            externalId:
              type: string
              description: Unique custom identifier for the life case (optional)
              example: client-custom-identifier
            name:
              type: string
              description: The name/title of the specific life case
              example: Jane Doe
            insuranceLine:
              allOf:
                - $ref: '#/components/schemas/InsuranceLine'
                - example:
                    name: Life
            insuredPerson:
              $ref: '#/components/schemas/InsuredPerson'
            integrations:
              $ref: '#/components/schemas/Integrations'
            analysis:
              $ref: '#/components/schemas/LifeAnalysis'
            documentsCount:
              type: integer
              description: The number of documents associated with the life case
              example: 123
            alternateUrl:
              type: string
              description: Link in the Sixfold UI to the case details page
              example: >-
                https://{tenant}.sixfold.app/life/cases/c4fb4c10-5b2e-4220-90d2-96d94337e8e6
            createdAt:
              type: string
              format: date-time
              example: '2024-01-10T16:00:30Z'
              description: Date and time that the case was created
            updatedAt:
              type: string
              format: date-time
              example: '2024-01-10T16:05:30Z'
              description: Date and time that the case was last updated
    LifeCases:
      type: array
      items:
        $ref: '#/components/schemas/LifeCase'
    CreateFileNetIntegrationMetadataRequest:
      type: object
      description: Object containing the id of the file on FileNet to be retrieved
      required:
        - id
      properties:
        id:
          type: string
          description: Unique FileNet identifier for the file
        category:
          $ref: '#/components/schemas/DocumentCategory'
    FileNetIntegrationMetadataWithCaseCreation:
      type: object
      required:
        - id
        - files
      properties:
        id:
          type: string
          description: Unique identifier for the integration (provided by Sixfold)
        files:
          type: array
          items:
            $ref: '#/components/schemas/CreateFileNetIntegrationMetadataRequest'
    GenericIntegrationMetadataWithCaseCreation:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          description: Unique identifier for the integration (provided by Sixfold)
    CreateLifeCaseRequest:
      type: object
      required:
        - case
      properties:
        case:
          type: object
          required:
            - insuranceLineId
            - insured
          properties:
            insuranceLineId:
              type: string
              description: Unique identifier for the insurance line (provided by Sixfold)
            externalId:
              type: string
              description: Unique custom identifier for the case (optional)
            insured:
              type: object
              required:
                - name
                - bornOn
                - sex
              properties:
                name:
                  type: string
                  description: The name of the insured individual or applicant identifier
                bornOn:
                  type: string
                  description: The insured person's date of birth
                  format: ISO 8601 date
                occupation:
                  type: string
                  description: The insured person's occupation
                sex:
                  type: string
                  description: The insured person's sex assigned at birth
                  enum:
                    - intersex
                    - female
                    - male
            integrations:
              type: array
              items:
                anyOf:
                  - $ref: >-
                      #/components/schemas/FileNetIntegrationMetadataWithCaseCreation
                  - $ref: >-
                      #/components/schemas/GenericIntegrationMetadataWithCaseCreation
              description: |
                Array of integrations to be added to the case.
    DocumentUpload:
      type: object
      required:
        - file
      properties:
        file:
          type: string
          format: binary
          description: The file to upload
        category:
          $ref: '#/components/schemas/DocumentCategory'
    CreateLifeCaseRequestWithDocument:
      type: object
      required:
        - case
      properties:
        case:
          type: string
          format: JSON
          description: JSON string representing the case object
          example: >-
            {"insuranceLineId":"89fd67dd-a959-4f8f-8b55-5ead03ac0406","externalId":"263b4bc6-b7b6-4f79-934c-445261b64cce","insured":{"name":"Jane
            Doe","bornOn":"1990-01-01","sex":"female","occupation":"Software
            Engineer"}}
        documents:
          type: array
          description: >
            Array of documents to be uploaded. When submitting via
            multipart/form-data, use indexed notation (documents[0][file],
            documents[0][category], etc.).
          items:
            $ref: '#/components/schemas/DocumentUpload'
        documents[]:
          type: array
          deprecated: true
          items:
            type: string
            format: binary
    LifeAnalysis-2:
      type: object
      description: Object containing the results of the analysis for the life case.
      properties:
        status:
          type: string
          enum:
            - pending
            - done
            - error
          example: pending
          description: Status of the life case analysis.
        riskSignalDetections:
          type: array
          items:
            - $ref: '#/components/schemas/KeywordSignal-2'
        factsCount:
          type: integer
          description: The number of facts detected in the case
          example: 1
        riskOverview:
          type: string
          description: A short summary of the person's life risk
          example: null
        fullHealthSummary:
          type: string
          description: A detailed summary of the person's health
          example: null
    CreatedLifeCase:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the life case
          example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
        type:
          type: string
          description: Value will always be `lifeCases`
          example: lifeCases
        attributes:
          type: object
          description: The attributes of the life case.
          properties:
            externalId:
              type: string
              description: Unique custom identifier for the life case (optional)
              example: client-custom-identifier
            name:
              type: string
              description: The name/title of the specific life case
              example: Jane Doe
            insuranceLine:
              allOf:
                - $ref: '#/components/schemas/InsuranceLine'
                - example:
                    name: Life
            integrations:
              $ref: '#/components/schemas/Integrations'
            insuredPerson:
              $ref: '#/components/schemas/InsuredPerson'
            analysis:
              $ref: '#/components/schemas/LifeAnalysis-2'
            documentsCount:
              type: integer
              description: The number of documents associated with the life case
              example: 0
            alternateUrl:
              type: string
              description: Link in the Sixfold UI to the case details page
              example: >-
                https://{tenant}.sixfold.app/life/cases/c4fb4c10-5b2e-4220-90d2-96d94337e8e6
            createdAt:
              type: string
              format: date-time
              example: '2024-01-10T16:00:30Z'
              description: Date and time that the case was created
            updatedAt:
              type: string
              format: date-time
              example: '2024-01-10T16:05:30Z'
              description: Date and time that the case was last updated
    Document-2:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the document
          example: 0544e627-5c81-49da-99bc-a2822ead6b99
        type:
          type: string
          example: lifeDocument
          description: The type of the case
        attributes:
          type: object
          description: The attributes of the document
          properties:
            filename:
              type: string
              example: file 1.pdf
              description: The name of the file
            contentType:
              type: string
              example: application/pdf
              description: The type of the file
            byteSize:
              type: integer
              example: 123456
              description: The size of the file in bytes
            createdAt:
              type: string
              format: date-time
              example: '2024-01-10T16:00:30Z'
              description: The date and time the document was created
            updatedAt:
              type: string
              format: date-time
              example: '2024-01-10T16:05:30Z'
              description: The date and time the document was last updated
            category:
              $ref: '#/components/schemas/DocumentCategory'
    PaginatedResponse:
      type: object
      description: Standard wrapper for paginated responses
      properties:
        data:
          type: array
          description: Array of response items
          items:
            type: object
        links:
          $ref: '#/components/schemas/PaginationLinks'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - data
        - meta
    CaseFactSource:
      type: object
      properties:
        filename:
          type: string
          description: |
            The filename of the document used as the source of information.
        page:
          type: integer
          nullable: true
          description: >
            The page number in the source document where this information was
            found.
        category:
          type: string
          enum:
            - Application
            - Part II
            - Lab
            - RX/DX Report
            - Medical Record
            - Background Report
          nullable: true
          description: |
            The category of the document used as the source of information.
      example:
        filename: filename.pdf
        page: 1
        category: Medical Record
    CaseFact:
      type: object
      description: Base schema for a case fact in JSON:API format
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the fact
        type:
          type: string
          description: Resource type identifier
          enum:
            - lifeCaseFacts
        attributes:
          type: object
          properties:
            factType:
              type: string
              description: Type of fact (discriminator for polymorphic handling)
            name:
              type: string
              description: Name/title of the fact
            shortSummary:
              type: string
              description: Brief one-line summary of the fact
              nullable: true
            longSummary:
              type: string
              description: Detailed multi-paragraph summary with clinical context
              nullable: true
            occurredAt:
              type: string
              format: date-time
              description: Date and time when the fact occurred
              nullable: true
            createdAt:
              type: string
              format: date-time
              description: Date and time when the fact was created in the system
            updatedAt:
              type: string
              format: date-time
              description: Date and time when the fact was last updated
            sources:
              type: array
              description: >
                An array containing the individual sources that the fact was
                extracted from.
              items:
                $ref: '#/components/schemas/CaseFactSource'
            relatedConditions:
              type: array
              description: Conditions that this fact supports or relates to
              items:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: The unique identifier of the related condition
                  name:
                    type: string
                    description: The name of the related condition
                required:
                  - id
                  - name
          required:
            - factType
            - name
            - sources
            - createdAt
            - updatedAt
      required:
        - id
        - type
        - attributes
    Medication:
      allOf:
        - $ref: '#/components/schemas/CaseFact'
        - type: object
          description: A medication fact object representing a medication in a case
          properties:
            attributes:
              type: object
              properties:
                factType:
                  type: string
                  description: The type of fact
                  enum:
                    - Medication
      example:
        id: f47ac10b-58cc-4372-a567-0e02b2c3d479
        type: lifeCaseFacts
        attributes:
          factType: Medication
          name: Metformin
          shortSummary: Metformin 500mg twice daily
          longSummary: >-
            The applicant is taking Metformin 500mg twice daily for Type 2
            Diabetes Mellitus.
          occurredAt: '2024-01-10T00:00:00Z'
          createdAt: '2024-01-10T12:00:00Z'
          updatedAt: '2024-01-10T12:00:00Z'
          relatedConditions:
            - id: c7d8e9f0-1a2b-3c4d-5e6f-7a8b9c0d1e2f
              name: Type 2 Diabetes Mellitus
          sources:
            - filename: medical_records_2024.pdf
              page: 2
              category: Medical Record
    Procedure:
      allOf:
        - $ref: '#/components/schemas/CaseFact'
        - type: object
          description: A procedure fact object representing a medical procedure in a case
          properties:
            attributes:
              type: object
              properties:
                factType:
                  type: string
                  description: The type of fact
                  enum:
                    - Procedure
      example:
        id: e8f9a0b1-2c3d-4e5f-6a7b-8c9d0e1f2a3b
        type: lifeCaseFacts
        attributes:
          factType: Procedure
          name: Laparoscopic Appendectomy
          shortSummary: Appendectomy procedure
          longSummary: >-
            The applicant underwent a laparoscopic appendectomy to remove a
            ruptured appendix.
          occurredAt: '2023-06-15T00:00:00Z'
          createdAt: '2024-01-10T12:00:00Z'
          updatedAt: '2024-01-10T12:00:00Z'
          relatedConditions:
            - id: a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d
              name: Appendicitis
          sources:
            - filename: medical_records_2024.pdf
              page: 5
              category: Medical Record
    FamilyHistory:
      allOf:
        - $ref: '#/components/schemas/CaseFact'
        - type: object
          description: >-
            A fact object representing family medical history (includes family
            heart disease and family cancer)
          properties:
            attributes:
              type: object
              properties:
                factType:
                  type: string
                  description: The type of fact
                  enum:
                    - FamilyHistory
      example:
        id: d4e5f6a7-8b9c-0d1e-2f3a-4b5c6d7e8f9a
        type: lifeCaseFacts
        attributes:
          factType: FamilyHistory
          name: Cancer
          shortSummary: Family history of cancer
          longSummary: >-
            The applicant's mother had breast cancer at age 45, and his father
            had lung cancer at age 65.
          occurredAt: null
          createdAt: '2024-01-10T12:00:00Z'
          updatedAt: '2024-01-10T12:00:00Z'
          relatedConditions: []
          sources:
            - filename: family_medical_history.pdf
              page: 3
              category: Medical Record
    ClinicalData:
      allOf:
        - $ref: '#/components/schemas/CaseFact'
        - type: object
          description: >-
            A clinical observation fact object representing clinical data
            measurements
          properties:
            attributes:
              type: object
              properties:
                factType:
                  type: string
                  description: The type of fact
                  enum:
                    - ClinicalData
                result:
                  type: string
                  description: The measured value or result of the clinical observation
                  nullable: true
                referenceRange:
                  type: string
                  description: The reference range for normal values
                  nullable: true
                normal:
                  type: boolean
                  description: Whether the result is within normal range
                  nullable: true
      example:
        id: b1c2d3e4-5f6a-7b8c-9d0e-1f2a3b4c5d6e
        type: lifeCaseFacts
        attributes:
          factType: ClinicalData
          name: Blood Pressure
          result: 145/92 mmHg
          referenceRange: < 120/80 mmHg
          normal: false
          occurredAt: '2024-01-10T00:00:00Z'
          createdAt: '2024-01-10T12:00:00Z'
          updatedAt: '2024-01-10T12:00:00Z'
          relatedConditions:
            - id: a3e5c8b9-2f4d-4c7a-8e1f-9d6b3c4a5b2e
              name: Hypertension Stage 2
          sources:
            - filename: lab_results_2024.pdf
              page: 1
              category: RX/DX Report
    Lifestyle:
      allOf:
        - $ref: '#/components/schemas/CaseFact'
        - type: object
          description: >-
            A fact object representing lifestyle information including substance
            use, hobbies, travel, criminal record, and other personal activities
          properties:
            attributes:
              type: object
              properties:
                factType:
                  type: string
                  description: The type of fact
                  enum:
                    - Lifestyle
      example:
        id: c5d6e7f8-9a0b-1c2d-3e4f-5a6b7c8d9e0f
        type: lifeCaseFacts
        attributes:
          factType: Lifestyle
          name: Substance Use
          shortSummary: History of tobacco and marijuana use
          longSummary: >-
            The applicant has a history of smoking cigarettes and occasional
            marijuana use.
          occurredAt: '2023-05-10T00:00:00Z'
          createdAt: '2024-01-10T12:00:00Z'
          updatedAt: '2024-01-10T12:00:00Z'
          relatedConditions:
            - id: a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d
              name: Chronic Obstructive Pulmonary Disease
          sources:
            - filename: smoking_history.pdf
              page: 2
              category: Medical Record
    CaseFacts:
      type: array
      description: List of facts detected in the case (excludes conditions)
      items:
        anyOf:
          - $ref: '#/components/schemas/Medication'
          - $ref: '#/components/schemas/Procedure'
          - $ref: '#/components/schemas/FamilyHistory'
          - $ref: '#/components/schemas/ClinicalData'
          - $ref: '#/components/schemas/Lifestyle'
    Condition:
      type: object
      description: >-
        A condition object representing a medical condition in a case (JSON:API
        format)
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the condition
        type:
          type: string
          description: Resource type identifier
          enum:
            - lifeCaseConditions
        attributes:
          type: object
          properties:
            factType:
              type: string
              description: The type of fact
              enum:
                - Condition
            name:
              type: string
              description: Name/title of the condition
            shortSummary:
              type: string
              description: Brief one-line summary of the condition
              nullable: true
            longSummary:
              type: string
              description: Detailed multi-paragraph summary with clinical context
              nullable: true
            occurredAt:
              type: string
              format: date-time
              description: Date and time when the condition occurred
              nullable: true
            createdAt:
              type: string
              format: date-time
              description: Date and time when the condition was created in the system
            updatedAt:
              type: string
              format: date-time
              description: Date and time when the condition was last updated
            sources:
              type: array
              description: >
                An array containing the individual sources that the condition
                was extracted from.
              items:
                $ref: '#/components/schemas/CaseFactSource'
            relatedFacts:
              type: array
              description: >-
                Facts that support or relate to this condition (medications,
                procedures, clinical data, etc.)
              items:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: The unique identifier of the related fact
                  name:
                    type: string
                    description: The name of the related fact
                  factType:
                    type: string
                    description: >-
                      The type of the related fact (e.g., Medication, Procedure,
                      ClinicalData)
                required:
                  - id
                  - name
                  - factType
          required:
            - factType
            - name
            - sources
            - createdAt
            - updatedAt
      required:
        - id
        - type
        - attributes
      example:
        id: b1c2d3e4-5f6a-7b8c-9d0e-1f2a3b4c5d6e
        type: lifeCaseConditions
        attributes:
          factType: Condition
          name: Hypertension Stage 2
          shortSummary: History of hypertension
          longSummary: >-
            Patient diagnosed with Stage 2 hypertension in January 2023.
            Condition is currently managed with medication and lifestyle
            modifications. Blood pressure readings have been consistently
            elevated above 140/90 mmHg.
          occurredAt: '2023-01-15T00:00:00Z'
          createdAt: '2024-01-10T12:00:00Z'
          updatedAt: '2024-01-10T12:00:00Z'
          relatedFacts:
            - id: f47ac10b-58cc-4372-a567-0e02b2c3d479
              name: Lisinopril
              factType: Medication
            - id: a3e5c8b9-2f4d-4c7a-8e1f-9d6b3c4a5b2e
              name: Blood Pressure
              factType: ClinicalData
          sources:
            - filename: medical_records_2024.pdf
              page: 1
              category: Medical Record
            - filename: application.pdf
              page: 2
              category: Application
    AddFileNetIntegrationFileRequest:
      type: object
      required:
        - op
        - path
        - value
      properties:
        op:
          type: string
          enum:
            - add
          description: >-
            The operation to be done for adding the FileNet file, the value must
            be "add"
        path:
          type: string
          enum:
            - /files/-
          description: The path for adding the FileNet file, the value must be "/files/-"
        value:
          $ref: '#/components/schemas/CreateFileNetIntegrationMetadataRequest'
    AddGenericIntegrationMetadataRequest:
      type: object
      required:
        - op
        - path
        - value
      properties:
        op:
          type: string
          enum:
            - add
          description: >-
            The operation to be done for adding the metadata, the value must be
            "add"
        path:
          type: string
        value:
          type: object
  parameters:
    CaseId:
      name: case_id
      in: path
      required: true
      schema:
        type: string
        example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
    PageNumber:
      name: page
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        default: 1
        description: The page number to fetch
    PageSize:
      name: page_size
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 20
        description: Number of items per page
    FactId:
      name: fact_id
      in: path
      required: true
      schema:
        type: string
        format: uuid
        example: f8e3c4a0-5b2e-4220-90d2-96d94337e8e6
      description: The unique identifier of the fact
    ConditionId:
      name: condition_id
      in: path
      required: true
      schema:
        type: string
        format: uuid
        example: a3b7d1e0-6c4f-4330-81e3-a8e05448f9f7
      description: The unique identifier of the condition
security:
  - ApiKeyAuth: []
x-tagGroups:
  - name: 2024-05 Commercial Endpoints
    tags:
      - 2024-05 Commercial - Cases
      - 2024-05 Commercial - Documents
      - 2024-05 Commercial - Quotes
  - name: 2024-05 Life & Health Endpoints
    tags:
      - 2024-05 Life - Cases
      - 2024-05 Life - Documents
      - 2024-05 Life - Facts
      - 2024-05 Life - Conditions
      - 2024-05 Life - Integrations
  - name: Webhooks
    tags:
      - 2024-05 Webhooks
  - name: Integrations
    tags:
      - Integrations Overview
      - IBM FileNet Content Manager
  - name: Documents
    tags:
      - Document Classification
tags:
  - name: 2024-05 Commercial - Cases
    x-displayName: Cases
    description: Create, retrieve, and manage commercial insurance cases
  - name: 2024-05 Commercial - Documents
    x-displayName: Documents
    description: Add documents to commercial insurance cases for analysis
  - name: 2024-05 Commercial - Quotes
    x-displayName: Quotes
    description: Retrieve AI-generated insurance quotes based on case analysis
  - name: 2024-05 Life - Cases
    x-displayName: Cases
    description: Create, retrieve, and manage life insurance cases
  - name: 2024-05 Life - Documents
    x-displayName: Documents
    description: Add documents to life insurance cases for analysis
  - name: 2024-05 Life - Facts
    x-displayName: Facts
    description: Retrieve facts extracted from case documents
  - name: 2024-05 Life - Conditions
    x-displayName: Conditions
    description: Retrieve medical conditions and their supporting evidence
  - name: 2024-05 Life - Integrations
    x-displayName: Integrations
    description: Manage integration metadata for external systems
  - name: 2024-05 Webhooks
    description: |2
        Webhooks allow us to send important events about a case to you in real-time.

        ## Requirements

        - Your webhook resource MUST accept requests with content type `application/json`

        - Your webhook resource MUST return a response with a `200` status to indicate that the request was processed successfully

        ## Custom Headers

        You can optionally specify custom headers for us to send in webhook requests. This is useful when, for example, your webhook resource requires us to provide an authentication token in a header. Custom headers are defined at the webhook level and are included in all requests sent to the webhook callback URL. Please reach out to your Sixfold representative to set up custom headers for your webhook.


        ## Webhook Topics

        A webhook's topic indicates the type of event that triggered the webhook. The topic is included in the request body sent to your webhook URL.

        Supported webhook topics include:

        | Topic | Description |

        | --- | --- |

        | `cases/created` | a case was successfully created |

        | `cases/updated` | a case was successfully updated |

        | `cases/finished` | a case has completed the analysis |

        | `cases/errored` | a case encountered an error during the analysis |

        | `integrations/finished` | an integration has finished its operation |

        | `integrations/errored` | an integration encountered an error during its operation |


        ## Examples

        ### Commercial Example Request


        Below is an example of a webhook request sent when a commercial case is updated:

        ```json
            {
              "id": "c4fb4c10-5b2e-4220-90d2-96d94337e8e6",
              "topic": "cases/updated"
              "body": {
                "data": {
                  "id": "c4fb4c10-5b2e-4220-90d2-96d94337e8e6",
                  "type": "commercialCases",
                  "attributes": {
                    "externalId": "bda31907-49ad-4cf2-b76f-7738f359ae5e",
                    "name": "Diamond West Construction Case",
                    "insuranceLine": {
                      "id": "1cfd8bdf-5a20-4dfb-aca0-729df7795e14",
                      "name": "General Liability"
                    },
                    "insuredCompany": {
                      "name": "Diamond West Construction",
                      "businessActivity": "Construction",
                      "summary": "A general building contractor that offers home remodeling and design-build services.",
                      "webPresence": {
                        "urls": [
                          "https://diamondwestdevelopment.com/about-us/",
                          "https://diamondwestdevelopment.com/",
                          "http://diamondwestconstruction.mobi/",
                          "https://diamondwestdevelopment.com/gallery/",
                          "https://diamondwestdevelopment.com/services/"
                        ]
                      },
                      "businessClassification": [
                          {
                            "system": "naics",
                            "code": "236118",
                            "title": "Commercial and Institutional Building Construction",
                            "explanation": "236118 - Residential Remodelers The business summary indicates that this is a general building contractor that offers home remodeling and design-build services. This aligns directly with the NAICS code 236118, which is designated for businesses primarily responsible for remodeling construction of houses and other residential buildings. The services offered by the business, such as home remodeling and design-build, are specifically mentioned in the NAICS context as activities included in this industry. The business is likely to serve customers who own residential properties, including single-family and multifamily homes, who are looking to remodel or renovate their properties. This is why the NAICS code 236118 - Residential Remodelers is assigned with high confidence.",
                            "confidence": 0.79
                          }
                        ],
                      "address": {
                        "street": "6676 Van Buren Boulevard",
                        "city": "Riverside",
                        "state": "CA",
                        "postalCode": "92503",
                        "country": "US"
                      }
                    },
                    "analysis": {
                      "status": "done",
                      "riskEvaluation": {
                        "score": 4,
                        "summary": "We have determined a risk score of 4 given the lack of negative risk signals detected."
                      },
                      "riskSignalDetections": [
                        {
                          "type": "KeywordSignal",
                          "keyword": "Construction",
                          "explanation": "The content mentions Diamond West Construction Services, which offers a range of construction services including residential, commercial, and communications projects. Additionally, Diamond West Development provides diversified construction services such as concrete work, block walls, pools, and outdoor kitchens. This indicates that the business likely engages in construction activities.",
                          "impact": "positive"
                        },
                        {
                          "type": "KeywordSignal",
                          "keyword": "Remodeling",
                          "explanation": "The content extensively discusses Diamond West Development's involvement in remodeling projects, including kitchen and bathroom remodeling. It highlights customer testimonials praising their work on remodeling projects and mentions their services in home remodeling, room additions, and custom homes. This indicates that the business likely engages in remodeling activities.",
                          "impact": "negative"
                        }
                      ],
                      "facts": [
                        {
                          "type": "questionAnswer",
                          "question": "Does PCI Compliance applicable to this company? If so, is the company PCI Compliant?",
                          "answer": "Is PCI Compliance Applicable to Mondelez International Inc.?\\nMondelez International Inc. is a multinational confectionery, food, and beverage company that manufactures and markets food products and beverages. The company operates in approximately 160 countries and has an annual revenue of about $26.5 billion.\\n\\nThe Payment Card Industry Data Security Standard (PCI DSS) is a set of security standards that ensure companies that accept, process, store, or transmit credit card information maintain a secure environment. PCI DSS is administered and managed by the PCI Security Standards Council (PCI SSC), an independent body created by major payment card brands such as Visa, MasterCard, and American Express. \\n\\nPCI DSS applies to any organization, regardless of size or the number of transactions, that accepts, transmits, or stores cardholder data. This includes companies that process credit card information and merchants that accept payment cards as payment for goods and services. \\n\\nGiven that Mondelez International Inc. operates on a global scale and deals with financial transactions, it would need to comply with PCI DSS. \\n\\n## Is Mondelez International Inc. PCI Compliant?\\nMondelez International Inc. has a global Ethics & Compliance program that guides its employees to adhere to applicable laws and regulations while conducting business worldwide. The company also has a dedicated Compliance team that works with senior management to implement the program and ensures employees understand what is expected of them. \\n\\nHowever, it is unclear from the available information whether Mondelez International Inc. is PCI compliant regarding the specific requirements of PCI DSS. This would require further investigation and analysis of the company's data security measures and practices.\n",
                          "sources": [
                            {
                              "type": null,
                              "url": null
                            }
                          ]
                        }
                      ]
                    },
                    "documents": [
                      {
                        "id": "0544e627-5c81-49da-99bc-a2822ead6b99",
                        "filename": "file 1.pdf",
                        "contentType": "application/pdf",
                        "byteSize": 123456
                      }
                    ],
                    "quoted": true,
                    "alternateUrl": "https://{tenant}.sixfold.app/commercial/cases/c4fb4c10-5b2e-4220-90d2-96d94337e8e6",
                    "createdAt": "2023-01-10T16:00:30+0:00",
                    "updatedAt": "2023-01-10T16:05:30+0:00"
                  }
                }
              }
            }
        ```

        ### Life & Disability Example Request

        Below is an example of a webhook request sent when a life & disability case is updated:

        ```json
            {
              "id": "c4fb4c10-5b2e-4220-90d2-96d94337e8e6",
              "topic": "cases/updated"
              "body": {
                "data": {
                  "id": "c4fb4c10-5b2e-4220-90d2-96d94337e8e6",
                  "type": "lifeCases",
                  "attributes": {
                    "name": "Jane Doe",
                    "insuranceLine": {
                      "id": "1cfd8bdf-5a20-4dfb-aca0-729df7795e14",
                      "name": "Life"
                    },
                    "documentsCount": 123,
                    "externalId": "client-custom-identifier",
                    "alternateUrl": "https://{tenant}.sixfold.app/life/cases/c4fb4c10-5b2e-4220-90d2-96d94337e8e6",
                    "insuredPerson": {
                      "name": "Jane Doe",
                      "bornOn": "1949-12-31",
                      "occupation": "Software Engineer",
                      "sex": "female"
                    },
                    "analysis": {
                      "status": "done",
                      "errors": [],
                      "riskSignalDetections": [
                        {
                          "type": "KeywordSignal",
                          "keyword": "Cancer",
                          "explanation": "The fact 'Concerning for malignancy' matches the keyword signal 'Cancer' with a negative impact based on the risk appetite provided.",
                          "impact": "negative",
                          "sources": [
                            {
                              "filename": "medial_report.pdf",
                              "pages": [1,2,3]
                            }
                          ]
                        }
                      ],
                      "riskOverview": "Jane Doe, a 74-year-old female who smokes, has a history of several significant medical conditions and treatments. She has been diagnosed with strep pharyngitis, appendicitis, migraines with aura, atypical chest pain concerning for angina, community-acquired pneumonia,\n",
                      "fullHealthSummary": "Jane Doe's medical history is extensive, beginning with diagnoses of strep pharyngitis in 1980 treated with clindamycin due to penicillin allergy, and appendicitis in 1987, both of which were treated accordingly. In 1993, she was diagnosed with migraines with aura and began treatment with metoclopramide and sumatriptan. By 2000, she experienced atypical chest pain, which raised concerns for angina, leading to a cardiology referral and the initiation of ASA. In 2006, she was diagnosed with community-acquired pneumonia and subsequently with chronic myeloid leukemia (CML) in 2013, which is currently in remission with ongoing imatinib treatment. Her history also includes a COPD exacerbation in 2016 treated with albuterol and Advair, and orthostatic hypotension diagnosed in 2018, with a treatment plan including fludrocortisone. Throughout her medical journey, Jennifer has been prescribed various medications, including ASA for atypical chest pain and post-myocardial infarction, atenolol and atorvastatin for coronary artery disease post-myocardial infarction, and imatinib specifically targeting her CML. The presence of atenolol and atorvastatin suggests a focus on heart health and cholesterol, while imatinib specifically targets her CML. Notably, there is an absence of direct treatment for high blood pressure, despite the presence of medications that could indirectly affect it, and no mention of medications for mental health conditions or sleep apnea, which are not listed among her diagnosed conditions.\n",
                      "factsCount": 321
                    },
                    "createdAt": "2024-01-10T16:00:30Z",
                    "updatedAt": "2024-01-10T16:00:30Z"
                  }
                }
              }
            }
        ```

        ### FileNet Integration Example Request

        Below is an example of a webhook request sent when a FileNet integration has successfully downloaded the files:

        ```json
            {
              "id": "94b4fd8d-3500-49a4-a3cb-0e7f59c9b1ac",
              "topic": "integrations/finished",
              "body": {
                "data": {
                  "caseId": "c4fb4c10-5b2e-4220-90d2-96d94337e8e6",
                  "integrationId": "78ea09d0-55f7-407a-9fc9-d625cfd84085",
                  "files": [
                    {
                      id: "filenet-unique-identifier",
                      category: "Medical Record"
                    },
                    {
                      id: "filenet-unique-identifier-2",
                    }
                  ]
                }
              },

            }
        ```

        Below is an example of a webhook request sent when a FileNet integration failed to download the file:

        ```json
            {
              "id": "94b4fd8d-3500-49a4-a3cb-0e7f59c9b1ac",
              "topic": "integrations/errored",
              "body": {
                "data": {
                  "caseId": "c4fb4c10-5b2e-4220-90d2-96d94337e8e6",
                  "integrationId": "78ea09d0-55f7-407a-9fc9-d625cfd84085",
                  "files": [
                    {
                      id: "filenet-unique-identifier",
                      category: "Medical Record"
                    },
                    {
                      id: "filenet-unique-identifier-2",
                    }
                  ],
                  "errors": [
                    {
                      "status": "500",
                      "title": "FileNet server error",
                      "detail": "File 'filenet-unique-identifier' failed due to a FileNet server error",
                      "meta": {
                        "fileId": "filenet-unique-identifier"
                      }
                    }
                  ]
                }
              },

            }
        ```

        ### Example Request with Custom Headers


        Below is an example of a webhook request that includes a custom `Auth-Token` header for authentication:


        ```http

        POST /webhooks HTTP/1.1

        Host: foo.example

        Accept: application/json

        Content-Type: application/json

        Auth-Token: secret-custom-header


        {
          "id": "c4fb4c10-5b2e-4220-90d2-96d94337e8e6",
          "topic": "cases/updated",
          "body": {
            "data": {
              ...
            }
          },
        }

        ```
  - name: Integrations Overview
    description: >-
      ## Introduction


      At Sixfold, we streamline customer workflows by supporting integrations
      that automate the process of pulling in documents from external sources
      and seamlessly adding them to a case’s knowledge base. This supplements
      the documents that customers can manually upload, allowing teams to focus
      on analysis and decision-making while ensuring that all relevant documents
      are accurately captured and organized within the system. Through our
      integration options, we enable efficient document management that adapts
      to your specific needs.


      [See here for representative example of an
      integration](#tag/IBM-FileNet-Content-Manager).


      ## Getting Started



      Before leveraging one of the existing integrations, you will need to work
      with Sixfold's operations team to configure the necessary settings for
      your tenant. Each integration requires specific configurations and
      credentials.


      For each integration, you will receive a:


      - **Integration ID**: A unique identifier for your integration, provided
      by Sixfold.

      - **Integration Metadata Schema**: An integration-specific data structure
      that will be used to manage the integration on a per-case basis


      ---


      ### Integration ID


      The **integrationId** is a unique identifier for your configured
      integration, provided to you by Sixfold, that you will use in API calls to
      manage the integration for a particular case.


      **Example Integration Id**


      - `integrationId`: "a908bbed-319d-46fa-925d-67298721fa5c"


      **Example Usage**


      See the [documentation for this API
      endpoint](#operation/createLifeCase!ct=application/json&path=case/integrations&t=request)
      for example usage.


      ---


      ### Integration Metadata Schema


      The **integration metadata schema** is a integration-specific data
      structure that you leverage when structuring the request bodies for API
      calls to manage the integration for a particular case.



      **Example Integration Metadata Schema**


      The data structure below is an example of the metadata schema for an
      integration with an external document management system. Here, the `files`
      key references an array of `id`s that represent the id of file/documents
      in the external system that a customer would want to associate with a
      particular case.


      ```json
          {
              "id": "integrationId", // provided by sixfold
              "files": [
                  {
                      "id": "id-of-file-in-external-system",
                  },
              ]
          }
      ```



      **Example Usage**


      See the [documentation for this API
      endpoint](#operation/addDetailsToIntegrationOfLifeCase) for example usage.


      ---


      ## Supported Integrations


      Currently, Sixfold supports integrations with the following:

      -  **[IBM FileNet Content Manager
      Integration](#tag/IBM-FileNet-Content-Manager)**



      If you'd like to integrate with a third-party service that is not
      currently in the list above, please reach out to us via email to inquire.
  - name: IBM FileNet Content Manager
    description: >
      This integration allows Sixfold to interact with this external document
      and content storage service. This integration enables seamless management
      and attachment of files to cases within Sixfold’s system.


      ## Prerequisites


      Before Sixfold can begin adding files to cases using the FileNet
      integration, Sixfold’s operations team will need to configure the
      integration within your tenant. The configuration process will require the
      following information:


      - **FileNet Server URL**: The URL of the FileNet Content Manager server.

      - **FileNet Credentials**: The username and password for accessing the
      FileNet system.

      - **Authentication URLs and Credentials**: The URL(s) and credentials (if
      any) needed to receive a token used to authenticate requests to FileNet.


      ## Configuration Process


      1. **Contact Sixfold**: Reach out to Sixfold’s operations team to begin
      the setup process.

      2. **Provide Credentials**: Share the required FileNet server details and
      Authentication credentials.

      3. **Configuration**: Sixfold’s team will configure your tenant to use the
      provided credentials and server information.

      4. **Integration ID**: Once the setup is complete, Sixfold will provide
      your development team with an integration ID.


      ## Integration Metadata Schema


      The metadata schema for the FileNet integration is as follows:


      ```json
          {
              "id": "integrationId", // provided by sixfold
              "files": [
                  {
                    "id": "id-of-file-in-filenet",
                    "category": "Medical Record"  // optional top-level category of the document
                  },
                  { "id": "another-id-of-file-in-filenet" }
              ]
          }
      ```


      ## Using the Integration


      After setting up the FileNet integration, you will need to include the
      **integration ID** in all API requests that involve FileNet-related
      actions, such as creating a case while specifying files to be pulled in
      from FileNet, or updating a case to specify additional files to be pulled
      in from FileNet.


      ### Example API Call - Update Case with additional files from FileNet


      See example below, or the documentation for [this
      endpoint](#tag/2024-05-Life-and-Disability-(Coming-Soon)/operation/addDetailsToIntegrationOfLifeCase)


      ```http

      PATCH /life/cases/john-doe-case-id/integrations/file-net-integration-id
      HTTP/1.1

      Content-Type: application/json-patch+json


      [
        {
          "op": "add",
          "path": "/files/-",
          "value": {
            "id": "id-of-file-in-filenet",
            "category": "Medical Record"
          }
        },
      ]

      ```
  - name: Document Classification
    description: >-
      Documents can be classified into certain top-level categories.


      These document-level metadata can in turn be used to improve case level
      analysis of the relevant case information found in those documents, as
      well as give more contextual information to users in the UI.


      Sixfold's API allows its consumers to specify the top-level category /
      classification of a document when they:

      1. Create a case with documents

      2. Add documents to a case

      3. Specify files to add to a case from a third party integration


      The sections below detail the supported top-level categories per product
      line.



      ## Life & Disability


      | Category | Description |

      |----------|-------------|

      | Application | The main insurance application, capturing personal info,
      desired coverage, beneficiaries, and declarations around existing
      insurance. |

      | Part II | Any supplemental questionnaires or self-reported
      medical/lifestyle information (e.g., health history, lifestyle/hobbies,
      family history, etc.). |

      | Lab | Reports from examiners who measure vitals (blood pressure, height,
      weight), collect fluid samples, and summarize basic health indicators.
      Includes laboratory test results (blood/urine/saliva), including flagged
      abnormal values and reference ranges. |

      | EKG | Electrocardiogram reports and waveforms showing heart rate,
      rhythm, and electrical activity; used to assess cardiac function. |

      | RX/DX Report | Prescription histories from external databases, detailing
      medication usage and fill history. |

      | Medical Record | Physician summaries, detailed medical records from
      clinics, hospital discharge summaries, specialist reports, etc. This
      category should also be used if you have multiple Medical Records of
      different types contained within a single file. |

      | Financial | Pay stubs, tax returns, W-2 forms, profit-and-loss
      statements, personal or business financial statements, net-worth
      summaries. |

      | Diagnostic Report | Imaging, or reports for any diagnostic procedures or
      therapies. This category should also be used if you have multiple
      Diagnostic Reports of different types contained within a single file. |

      | Background Report | MIB codes, Motor Vehicle Records, credit checks, or
      other non-prescription third-party data used to validate applicant
      information. |



      ## Commercial


      More information coming soon.
paths:
  /2024-05/commercial/cases:
    post:
      tags:
        - 2024-05 Commercial - Cases
      summary: Create a commercial case
      description: >
        If the request omits name or insured information, the endpoint
        automatically extracts the missing company information from uploaded
        documents.


        **Note**: Document upload is required when relying on automatic field
        extraction.
      operationId: createCase
      x-hideTryItPanel: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCaseRequest'
            example:
              case:
                name: Diamond West Construction Case
                insuranceLineId: 1cfd8bdf-5a20-4dfb-aca0-729df7795e14
                externalId: bda31907-49ad-4cf2-b76f-7738f359ae5e
                insured:
                  name: Diamond West Construction
                  address:
                    street: 6676 Van Buren Boulevard
                    city: Riverside
                    state: CA
                    country: US
                    postalCode: '92503'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateCaseRequestWithDocument'
            example:
              case: |
                {
                  "name": "Diamond West Construction Case",
                  "insuranceLineId": "1cfd8bdf-5a20-4dfb-aca0-729df7795e14",
                  "externalId": "bda31907-49ad-4cf2-b76f-7738f359ae5e",
                  "insured": {
                    "name": "Diamond West Construction",
                    "address": {
                      "street": "6676 Van Buren Boulevard",
                      "city": "Riverside",
                      "state": "CA",
                      "country": "US",
                      "postalCode": "92503"
                    }
                  }
                }
              documents[]:
                - file: '@path/to/file1.pdf'
                - file: '@path/to/file2.pdf'
      responses:
        '201':
          description: Case created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CreatedCase'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_409'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_422'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_500'
      security:
        - ApiKeyAuth: []
    get:
      tags:
        - 2024-05 Commercial - Cases
      summary: Get all commercial cases
      operationId: getAllCases
      parameters:
        - name: external_id
          in: query
          schema:
            type: string
            example: bda31907-49ad-4cf2-b76f-7738f359ae5e
          description: Filter cases by unique external id
        - name: insurance_line_id
          in: query
          schema:
            type: string
            format: uuid
            example: 1cfd8bdf-5a20-4dfb-aca0-729df7795e14
          description: Filter cases by insurance line ID
        - name: created_at[gte]
          in: query
          schema:
            type: string
            format: date
            example: '2025-01-01'
          description: >-
            Filter cases where created_at is greater than or equal to this date
            (inclusive, start of day).
        - name: created_at[lte]
          in: query
          schema:
            type: string
            format: date
            example: '2025-01-31'
          description: >-
            Filter cases where created_at is less than or equal to this date
            (inclusive, end of day).
        - name: updated_at[gte]
          in: query
          schema:
            type: string
            format: date
            example: '2025-01-01'
          description: >-
            Filter cases where updated_at is greater than or equal to this date
            (inclusive, start of day).
        - name: updated_at[lte]
          in: query
          schema:
            type: string
            format: date
            example: '2025-01-31'
          description: >-
            Filter cases where updated_at is less than or equal to this date
            (inclusive, end of day).
        - name: sort_by
          in: query
          schema:
            type: string
            enum:
              - id
              - external_id
              - created_at
              - updated_at
            example: updated_at
          description: Sort results by id, external_id, created_at, or updated_at.
        - name: sort_dir
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
            example: desc
          description: >-
            Sort direction (asc for oldest first, desc for newest first).
            Defaults to desc when sort_by is provided.
        - name: page
          in: query
          schema:
            type: integer
            minimum: 1
            default: 1
            example: 1
          description: Page number for pagination (must be >= 1)
        - name: page_size
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 100
            example: 100
          description: Number of items per page (1-100, default 100)
      responses:
        '200':
          description: Cases retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Cases'
                  meta:
                    $ref: '#/components/schemas/PaginationMeta'
                  links:
                    $ref: '#/components/schemas/PaginationLinks'
        '400':
          description: Bad Request - Invalid pagination or query parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_404'
      security:
        - ApiKeyAuth: []
  /2024-05/commercial/cases/{case_id}:
    get:
      tags:
        - 2024-05 Commercial - Cases
      summary: Get a commercial case
      operationId: getCase
      parameters:
        - name: case_id
          in: path
          required: true
          schema:
            type: string
            example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
        - in: query
          name: lineOfBusinessId
          required: false
          schema:
            type: string
            example: b5f0a313-66f9-47dd-9dc0-808ff971cc64
          description: The uuid for a line of business for loss run analysis
      responses:
        '200':
          description: Case retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CommercialCase'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_404'
      security:
        - ApiKeyAuth: []
  /2024-05/commercial/cases/{case_id}.pdf:
    get:
      tags:
        - 2024-05 Commercial - Cases
      summary: Export a commercial case as PDF
      operationId: exportCaseAsPdf
      parameters:
        - name: case_id
          in: path
          required: true
          schema:
            type: string
            example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
      responses:
        '200':
          description: PDF exported successfully
          content:
            application/pdf:
              schema:
                type: string
                format: binary
                description: >
                  The PDF file containing the commercial case details.

                  [Example PDF
                  file](https://drive.google.com/file/d/1d_H0uxd0YDZplrcoqyJ50DUUPRuyfjz4/view)
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_404'
      security:
        - ApiKeyAuth: []
  /2024-05/commercial/cases/{case_id}/narrative.docx:
    get:
      tags:
        - 2024-05 Commercial - Cases
      summary: Export case narrative as Word document
      description: >
        Export the underwriting narrative for a commercial case as a Microsoft
        Word document (.docx).


        The narrative contains AI-generated sections summarizing key aspects of
        the case analysis,

        including risk assessment, business classification, and underwriting
        recommendations.


        **Note:** This endpoint will return a `409 Conflict` error if the case
        is still being processed.

        Wait for the case analysis to complete before requesting the narrative
        export.
      operationId: exportCaseNarrativeAsDocx
      parameters:
        - name: case_id
          in: path
          required: true
          description: The unique identifier of the commercial case
          schema:
            type: string
            format: uuid
            example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
      responses:
        '200':
          description: Word document exported successfully
          headers:
            Content-Disposition:
              description: Indicates the filename for the downloaded document
              schema:
                type: string
                example: attachment; filename="Case Name - Insurance Line.docx"
          content:
            application/vnd.openxmlformats-officedocument.wordprocessingml.document:
              schema:
                type: string
                format: binary
                description: >
                  The Word document (.docx) containing the case narrative
                  sections.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_404'
        '409':
          description: >
            Conflict - The case is still being processed and the narrative is
            not yet available.

            Retry the request after the case analysis has completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_409'
      security:
        - ApiKeyAuth: []
  /2024-05/commercial/cases/{case_id}/documents:
    post:
      tags:
        - 2024-05 Commercial - Documents
      summary: Add documents to a commercial case
      operationId: addDocumentsToCase
      x-hideTryItPanel: true
      parameters:
        - name: case_id
          in: path
          required: true
          schema:
            type: string
            example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - documents[]
              properties:
                documents[]:
                  type: array
                  description: |
                    Array of documents to be uploaded.
                  items:
                    type: string
                    format: binary
              example:
                documents[]:
                  - file: '@path/to/file4.pdf'
                  - file: '@path/to/file5.pdf'
      responses:
        '201':
          description: >
            Documents processed. A 201 response indicates at least one document
            was successfully uploaded. When uploading multiple documents, some
            may be accepted while others are rejected (partial success). Clients
            should always check the `errors` array even on successful responses.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Array of successfully uploaded documents
                    items:
                      $ref: '#/components/schemas/Document'
                  errors:
                    type: array
                    description: >
                      Array of errors for documents that could not be processed.
                      Present when some documents in a batch upload were
                      rejected (e.g., unsupported file types).
                    items:
                      type: object
                      properties:
                        title:
                          type: string
                          description: Error title
                          example: Invalid document
                        detail:
                          type: string
                          description: Detailed error message
                          example: >-
                            data.csv failed: Content type is not supported.
                            Check the list of supported content types
                        code:
                          type: string
                          description: Error code
                          example: invalid-document
                        source:
                          type: object
                          properties:
                            document:
                              type: string
                              description: Filename of the document that caused the error
                              example: data.csv
                        status:
                          type: integer
                          description: HTTP status code for this specific error
                          example: 422
              examples:
                fullSuccess:
                  summary: All documents uploaded successfully
                  value:
                    data:
                      - id: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
                        type: commercialDocuments
                        attributes:
                          filename: policy.pdf
                          contentType: application/pdf
                          byteSize: 102400
                          createdAt: '2024-05-01T12:00:00Z'
                          updatedAt: '2024-05-01T12:00:00Z'
                partialSuccess:
                  summary: Partial success - some documents rejected
                  value:
                    data:
                      - id: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
                        type: commercialDocuments
                        attributes:
                          filename: policy.pdf
                          contentType: application/pdf
                          byteSize: 102400
                          createdAt: '2024-05-01T12:00:00Z'
                          updatedAt: '2024-05-01T12:00:00Z'
                    errors:
                      - title: Invalid document
                        detail: >-
                          data.csv failed: Content type is not supported. Check
                          the list of supported content types
                        code: invalid-document
                        source:
                          document: data.csv
                        status: 422
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_422'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_500'
      security:
        - ApiKeyAuth: []
  /2024-05/commercial/cases/{case_id}/quote:
    post:
      tags:
        - 2024-05 Commercial - Quotes
      summary: Set or update case quote status
      description: >
        Creates or updates the quote status for a commercial case. Use the
        **status** parameter (recommended) with one of

        `quoted`, `not_quoted`, `bound`, `not_taken_up`, or `declined`. Send
        `status: null` to clear the quote status.


        The **quoted** boolean is deprecated; use **status** instead. Requests
        that send only **quoted** will succeed but

        return `Deprecation: true` and `X-Deprecation-Warning` response headers.
      operationId: addOrUpdateQuoteToCase
      parameters:
        - name: case_id
          in: path
          required: true
          schema:
            type: string
            example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddOrUpdateQuoteRequest'
            examples:
              statusBound:
                summary: Set status to bound (preferred)
                value:
                  case_quote:
                    status: bound
              statusQuoted:
                summary: Set status to quoted
                value:
                  case_quote:
                    status: quoted
              statusClear:
                summary: Clear quote status
                value:
                  case_quote:
                    status: null
              deprecatedQuoted:
                summary: Deprecated - use status instead
                value:
                  case_quote:
                    quoted: true
      responses:
        '204':
          description: >-
            Quote status set or updated successfully. No response body. When
            using deprecated **quoted** parameter, response includes Deprecation
            and X-Deprecation-Warning headers.
          headers:
            Deprecation:
              description: >-
                Present and set to `true` when request used deprecated
                **quoted** parameter.
              schema:
                type: string
                example: 'true'
            X-Deprecation-Warning:
              description: >-
                Message advising use of **status** parameter when **quoted** was
                used.
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
        '400':
          description: >-
            Bad Request — invalid or missing body; or status not one of quoted,
            not_quoted, bound, not_taken_up, declined.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '404':
          description: Not Found — case does not exist or not authorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_404'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_422'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_500'
      security:
        - ApiKeyAuth: []
    delete:
      tags:
        - 2024-05 Commercial - Quotes
      summary: Remove quote status from a commercial case
      description: >-
        Deletes the quote record for the case. Returns 204 even if the case had
        no quote. Requires case delete permission.
      operationId: deleteQuoteFromCase
      parameters:
        - name: case_id
          in: path
          required: true
          schema:
            type: string
            example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
      responses:
        '204':
          description: Quote removed successfully (or case had no quote). No response body.
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '404':
          description: Not Found — case does not exist or not authorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_404'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_500'
      security:
        - ApiKeyAuth: []
  /2024-05/life/cases:
    post:
      tags:
        - 2024-05 Life - Cases
      summary: Create a life case
      operationId: createLifeCase
      x-hideTryItPanel: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLifeCaseRequest'
            example:
              case:
                insuranceLineId: 1cfd8bdf-5a20-4dfb-aca0-729df7795e14
                externalId: client-custom-identifier
                insured:
                  name: Jane Doe
                  bornOn: '1949-12-31'
                  occupation: Software Engineer
                  sex: female
                integrations:
                  - id: 78ea09d0-55f7-407a-9fc9-d625cfd84085
                    files:
                      - id: filenet-unique-identifier
                        category: Medical Record
                      - id: filenet-unique-identifier-2
                        category: Application
          multipart/form:
            schema:
              $ref: '#/components/schemas/CreateLifeCaseRequestWithDocument'
            example:
              case: |
                {
                  "insuranceLineId": "89fd67dd-a959-4f8f-8b55-5ead03ac0406",
                  "externalId": "client-custom-identifier",
                  "insured": {
                    "name": "Jane Doe",
                    "bornOn": "1949-12-31",
                    "occupation": "Software Engineer"
                  },
                  "integrations": [{
                      id: "78ea09d0-55f7-407a-9fc9-d625cfd84085",
                      files: [{
                          id: "filenet-unique-identifier",
                          category: "Medical Record"
                        },{
                          id: "another-filenet-unique-identifier",
                          category: "Application"
                        },
                      ]
                    }
                  ]
                }
              documents[0][file]: '@path/to/file1.pdf'
              documents[0][category]: Medical Record
              documents[1][file]: '@path/to/file2.pdf'
      responses:
        '201':
          description: Case created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CreatedLifeCase'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_409'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_422'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_500'
      security:
        - ApiKeyAuth: []
    get:
      tags:
        - 2024-05 Life - Cases
      summary: Get all life cases
      operationId: getAllLifeCases
      parameters:
        - name: external_id
          in: query
          schema:
            type: string
            example: bda31907-49ad-4cf2-b76f-7738f359ae5e
          description: Filter cases by unique external id
        - name: created_at[gte]
          in: query
          schema:
            type: string
            format: date
            example: '2025-01-01'
          description: >-
            Filter cases where created_at is greater than or equal to this date
            (inclusive, start of day).
        - name: created_at[lte]
          in: query
          schema:
            type: string
            format: date
            example: '2025-01-31'
          description: >-
            Filter cases where created_at is less than or equal to this date
            (inclusive, end of day).
        - name: updated_at[gte]
          in: query
          schema:
            type: string
            format: date
            example: '2025-01-01'
          description: >-
            Filter cases where updated_at is greater than or equal to this date
            (inclusive, start of day).
        - name: updated_at[lte]
          in: query
          schema:
            type: string
            format: date
            example: '2025-01-31'
          description: >-
            Filter cases where updated_at is less than or equal to this date
            (inclusive, end of day).
        - name: sort_by
          in: query
          schema:
            type: string
            enum:
              - id
              - external_id
              - created_at
              - updated_at
            example: updated_at
          description: Sort results by id, external_id, created_at, or updated_at.
        - name: sort_dir
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
            example: desc
          description: >-
            Sort direction (asc for oldest first, desc for newest first).
            Defaults to desc when sort_by is provided.
        - name: page
          in: query
          schema:
            type: integer
            minimum: 1
            default: 1
            example: 1
          description: Page number for pagination (must be >= 1)
        - name: page_size
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 100
            example: 100
          description: Number of items per page (1-100, default 100)
      responses:
        '200':
          description: Cases retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/LifeCases'
                  meta:
                    $ref: '#/components/schemas/PaginationMeta'
                  links:
                    $ref: '#/components/schemas/PaginationLinks'
        '400':
          description: Bad Request - Invalid pagination or query parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_404'
      security:
        - ApiKeyAuth: []
  /2024-05/life/cases/{case_id}:
    get:
      tags:
        - 2024-05 Life - Cases
      summary: Get a life case
      operationId: getLifeCase
      parameters:
        - name: case_id
          in: path
          required: true
          schema:
            type: string
            example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
      responses:
        '200':
          description: Case retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/LifeCase'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_404'
      security:
        - ApiKeyAuth: []
  /2024-05/life/cases/{case_id}.pdf:
    get:
      tags:
        - 2024-05 Life - Cases
      summary: Export a life case as PDF
      operationId: exportLifeCaseAsPdf
      parameters:
        - name: case_id
          in: path
          required: true
          schema:
            type: string
            example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
      responses:
        '200':
          description: PDF exported successfully
          content:
            application/pdf:
              schema:
                type: string
                format: binary
                description: >
                  The PDF file containing the life case details. Link to example
                  PDF file coming soon.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_404'
      security:
        - ApiKeyAuth: []
  /2024-05/life/cases/{case_id}/documents:
    post:
      tags:
        - 2024-05 Life - Documents
      summary: Add documents to a life case
      description: >
        Add documents to a life case by providing an array of documents to be
        uploaded. When submitting via multipart/form-data, use indexed notation
        (documents[0][file], documents[0][category], etc.).
      operationId: addDocumentsToLifeCase
      parameters:
        - name: case_id
          in: path
          required: true
          schema:
            type: string
            example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
      x-hideTryItPanel: true
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - documents
              properties:
                documents:
                  type: array
                  description: >
                    Array of documents to be uploaded. When submitting via
                    multipart/form-data, use indexed notation
                    (documents[0][file], documents[0][category], etc.).
                  items:
                    $ref: '#/components/schemas/DocumentUpload'
                documents[]:
                  type: array
                  deprecated: true
                  items:
                    type: string
                    format: binary
            example:
              documents[0][file]: '@path/to/file1.pdf'
              documents[0][category]: Medical Record
              documents[1][file]: '@path/to/file2.pdf'
              documents[1][category]: Application
      responses:
        '201':
          description: >
            Documents processed. A 201 response indicates at least one document
            was successfully uploaded. When uploading multiple documents, some
            may be accepted while others are rejected (partial success). Clients
            should always check the `errors` array even on successful responses.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Array of successfully uploaded documents
                    items:
                      $ref: '#/components/schemas/Document-2'
                  errors:
                    type: array
                    description: >
                      Array of errors for documents that could not be processed.
                      Present when some documents in a batch upload were
                      rejected (e.g., unsupported file types).
                    items:
                      type: object
                      properties:
                        title:
                          type: string
                          description: Error title
                          example: Invalid document
                        detail:
                          type: string
                          description: Detailed error message
                          example: >-
                            data.csv failed: Content type is not supported.
                            Check the list of supported content types
                        code:
                          type: string
                          description: Error code
                          example: invalid-document
                        source:
                          type: object
                          properties:
                            document:
                              type: string
                              description: Filename of the document that caused the error
                              example: data.csv
                        status:
                          type: integer
                          description: HTTP status code for this specific error
                          example: 422
              examples:
                fullSuccess:
                  summary: All documents uploaded successfully
                  value:
                    data:
                      - id: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
                        type: lifeDocuments
                        attributes:
                          filename: medical_record.pdf
                          contentType: application/pdf
                          byteSize: 204800
                          createdAt: '2024-05-01T12:00:00Z'
                          updatedAt: '2024-05-01T12:00:00Z'
                          category: Medical Record
                partialSuccess:
                  summary: Partial success - some documents rejected
                  value:
                    data:
                      - id: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
                        type: lifeDocuments
                        attributes:
                          filename: medical_record.pdf
                          contentType: application/pdf
                          byteSize: 204800
                          createdAt: '2024-05-01T12:00:00Z'
                          updatedAt: '2024-05-01T12:00:00Z'
                          category: Medical Record
                    errors:
                      - title: Invalid document
                        detail: >-
                          data.csv failed: Content type is not supported. Check
                          the list of supported content types
                        code: invalid-document
                        source:
                          document: data.csv
                        status: 422
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_422'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_500'
      security:
        - ApiKeyAuth: []
  /2024-05/life/cases/{case_id}/facts:
    get:
      tags:
        - 2024-05 Life - Facts
      summary: Get all facts for a case
      description: >-
        Retrieves all facts for a case with pagination. Facts include
        medications, diagnoses, procedures, clinical data, family history, and
        lifestyle information. Conditions are accessed via the /conditions
        endpoints.
      operationId: getLifeCaseFacts
      parameters:
        - $ref: '#/components/parameters/CaseId'
        - $ref: '#/components/parameters/PageNumber'
        - $ref: '#/components/parameters/PageSize'
      responses:
        '200':
          description: Case facts retrieved successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/CaseFacts'
              example:
                data:
                  - id: f47ac10b-58cc-4372-a567-0e02b2c3d479
                    type: lifeCaseFacts
                    attributes:
                      factType: Medication
                      name: Metformin
                      shortSummary: Metformin 500mg twice daily
                      longSummary: >-
                        Patient prescribed Metformin 1000mg twice daily for
                        diabetes management. Medication compliance reported as
                        good with no significant side effects
                      occurredAt: '2024-01-10T00:00:00Z'
                      createdAt: '2024-01-10T12:00:00Z'
                      updatedAt: '2024-01-10T12:00:00Z'
                      relatedConditions:
                        - id: c7d8e9f0-1a2b-3c4d-5e6f-7a8b9c0d1e2f
                          name: Type 2 Diabetes Mellitus
                      sources:
                        - filename: prescription_history.pdf
                          page: 2
                          category: Medical Record
                  - id: a3e5c8b9-2f4d-4c7a-8e1f-9d6b3c4a5b2e
                    type: lifeCaseFacts
                    attributes:
                      factType: ClinicalData
                      name: Blood Pressure
                      shortSummary: Elevated blood pressure reading
                      longSummary: >-
                        Blood pressure measured at 145/92 mmHg, above normal
                        reference range.
                      occurredAt: '2024-01-10T00:00:00Z'
                      createdAt: '2024-01-10T12:00:00Z'
                      updatedAt: '2024-01-10T12:00:00Z'
                      relatedConditions:
                        - id: b1c2d3e4-5f6a-7b8c-9d0e-1f2a3b4c5d6e
                          name: Hypertension Stage 2
                      sources:
                        - filename: lab_results_2024.pdf
                          page: 1
                          category: RX/DX Report
                  - id: e8f9a0b1-2c3d-4e5f-6a7b-8c9d0e1f2a3b
                    type: lifeCaseFacts
                    attributes:
                      factType: Procedure
                      name: Echocardiogram
                      shortSummary: Cardiac ultrasound examination
                      longSummary: >-
                        Patient underwent echocardiogram to assess cardiac
                        function related to hypertension management.
                      occurredAt: '2023-06-15T00:00:00Z'
                      createdAt: '2024-01-10T12:00:00Z'
                      updatedAt: '2024-01-10T12:00:00Z'
                      relatedConditions:
                        - id: b1c2d3e4-5f6a-7b8c-9d0e-1f2a3b4c5d6e
                          name: Hypertension Stage 2
                      sources:
                        - filename: medical_records_2024.pdf
                          page: 5
                          category: Medical Record
                links:
                  self: >-
                    https://api.sixfold.dev/2024-05/life/cases/33b95b3b-f30a-40e1-b2cc-c09847cb903c/facts?page=3&page_size=20
                  first: >-
                    https://api.sixfold.dev/2024-05/life/cases/33b95b3b-f30a-40e1-b2cc-c09847cb903c/facts?page=1&page_size=20
                  last: >-
                    https://api.sixfold.dev/2024-05/life/cases/33b95b3b-f30a-40e1-b2cc-c09847cb903c/facts?page=63&page_size=20
                  prev: >-
                    https://api.sixfold.dev/2024-05/life/cases/33b95b3b-f30a-40e1-b2cc-c09847cb903c/facts?page=2&page_size=20
                  next: >-
                    https://api.sixfold.dev/2024-05/life/cases/33b95b3b-f30a-40e1-b2cc-c09847cb903c/facts?page=4&page_size=20
                meta:
                  page: 3
                  pageSize: 20
                  totalItems: 1247
                  totalPages: 63
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_404'
      security:
        - ApiKeyAuth: []
  /2024-05/life/cases/{case_id}/facts/{fact_id}:
    get:
      tags:
        - 2024-05 Life - Facts
      summary: Get a single fact for a life case
      description: Retrieves a single fact by its unique identifier
      operationId: getLifeCaseFact
      parameters:
        - $ref: '#/components/parameters/CaseId'
        - $ref: '#/components/parameters/FactId'
      responses:
        '200':
          description: Fact retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    anyOf:
                      - $ref: '#/components/schemas/Medication'
                      - $ref: '#/components/schemas/Procedure'
                      - $ref: '#/components/schemas/FamilyHistory'
                      - $ref: '#/components/schemas/ClinicalData'
                      - $ref: '#/components/schemas/Lifestyle'
              example:
                data:
                  id: f47ac10b-58cc-4372-a567-0e02b2c3d479
                  type: lifeCaseFacts
                  attributes:
                    factType: Medication
                    name: Lisinopril
                    shortSummary: Lisinopril 10mg daily
                    longSummary: >-
                      Patient prescribed Lisinopril 10mg once daily for
                      hypertension management. Started in January 2023 with good
                      tolerance.
                    occurredAt: '2023-01-20T00:00:00Z'
                    createdAt: '2024-01-10T12:00:00Z'
                    updatedAt: '2024-01-10T12:00:00Z'
                    relatedConditions:
                      - id: b1c2d3e4-5f6a-7b8c-9d0e-1f2a3b4c5d6e
                        name: Hypertension Stage 2
                    sources:
                      - filename: prescription_history.pdf
                        page: 1
                        category: Medical Record
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_404'
      security:
        - ApiKeyAuth: []
  /2024-05/life/cases/{case_id}/conditions:
    get:
      tags:
        - 2024-05 Life - Conditions
      summary: Get all conditions for a life case
      description: >-
        Retrieves all conditions for a case with pagination. Each condition
        includes an array of related facts that support or provide evidence for
        the condition.
      operationId: getLifeCaseConditions
      parameters:
        - $ref: '#/components/parameters/CaseId'
        - $ref: '#/components/parameters/PageNumber'
        - $ref: '#/components/parameters/PageSize'
      responses:
        '200':
          description: Conditions retrieved successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedResponse'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Condition'
              example:
                data:
                  - id: b1c2d3e4-5f6a-7b8c-9d0e-1f2a3b4c5d6e
                    type: lifeCaseConditions
                    attributes:
                      factType: Condition
                      name: Hypertension Stage 2
                      shortSummary: History of hypertension
                      longSummary: >-
                        Patient diagnosed with Stage 2 hypertension in January
                        2023. Condition is currently managed with medication and
                        lifestyle modifications.
                      occurredAt: '2023-01-15T00:00:00Z'
                      createdAt: '2024-01-10T12:00:00Z'
                      updatedAt: '2024-01-10T12:00:00Z'
                      relatedFacts:
                        - id: f47ac10b-58cc-4372-a567-0e02b2c3d479
                          name: Lisinopril
                          factType: Medication
                        - id: a3e5c8b9-2f4d-4c7a-8e1f-9d6b3c4a5b2e
                          name: Blood Pressure
                          factType: ClinicalData
                        - id: e8f9a0b1-2c3d-4e5f-6a7b-8c9d0e1f2a3b
                          name: Echocardiogram
                          factType: Procedure
                      sources:
                        - filename: medical_records_2024.pdf
                          page: 1
                          category: Medical Record
                  - id: c7d8e9f0-1a2b-3c4d-5e6f-7a8b9c0d1e2f
                    type: lifeCaseConditions
                    attributes:
                      factType: Condition
                      name: Type 2 Diabetes Mellitus
                      shortSummary: Type 2 Diabetes diagnosis
                      longSummary: >-
                        Patient diagnosed with Type 2 Diabetes Mellitus
                        requiring ongoing blood sugar monitoring and medication
                        management.
                      occurredAt: '2024-01-15T00:00:00Z'
                      createdAt: '2024-01-10T12:00:00Z'
                      updatedAt: '2024-01-10T12:00:00Z'
                      relatedFacts:
                        - id: d4e5f6a7-8b9c-0d1e-2f3a-4b5c6d7e8f9a
                          name: Metformin
                          factType: Medication
                      sources:
                        - filename: medical_records_2024.pdf
                          page: 3
                          category: Medical Record
                links:
                  self: >-
                    https://api.sixfold.dev/2024-05/life/cases/33b95b3b-f30a-40e1-b2cc-c09847cb903c/conditions?page=1&page_size=20
                  first: >-
                    https://api.sixfold.dev/2024-05/life/cases/33b95b3b-f30a-40e1-b2cc-c09847cb903c/conditions?page=1&page_size=20
                  last: >-
                    https://api.sixfold.dev/2024-05/life/cases/33b95b3b-f30a-40e1-b2cc-c09847cb903c/conditions?page=5&page_size=20
                  prev: null
                  next: >-
                    https://api.sixfold.dev/2024-05/life/cases/33b95b3b-f30a-40e1-b2cc-c09847cb903c/conditions?page=2&page_size=20
                meta:
                  page: 1
                  pageSize: 20
                  totalItems: 87
                  totalPages: 5
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_404'
      security:
        - ApiKeyAuth: []
  /2024-05/life/cases/{case_id}/conditions/{condition_id}:
    get:
      tags:
        - 2024-05 Life - Conditions
      summary: Get a single condition for a life case
      description: >-
        Retrieves a single condition by its unique identifier, including an
        array of related facts that support or provide evidence for the
        condition.
      operationId: getLifeCaseCondition
      parameters:
        - $ref: '#/components/parameters/CaseId'
        - $ref: '#/components/parameters/ConditionId'
      responses:
        '200':
          description: Condition retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Condition'
              example:
                data:
                  id: b1c2d3e4-5f6a-7b8c-9d0e-1f2a3b4c5d6e
                  type: lifeCaseConditions
                  attributes:
                    factType: Condition
                    name: Hypertension Stage 2
                    shortSummary: History of hypertension
                    longSummary: >-
                      Patient diagnosed with Stage 2 hypertension in January
                      2023. Condition is currently managed with medication and
                      lifestyle modifications. Blood pressure readings have been
                      consistently elevated above 140/90 mmHg.
                    occurredAt: '2023-01-15T00:00:00Z'
                    createdAt: '2024-01-10T12:00:00Z'
                    updatedAt: '2024-01-10T12:00:00Z'
                    relatedFacts:
                      - id: f47ac10b-58cc-4372-a567-0e02b2c3d479
                        name: Lisinopril
                        factType: Medication
                      - id: a3e5c8b9-2f4d-4c7a-8e1f-9d6b3c4a5b2e
                        name: Blood Pressure
                        factType: ClinicalData
                      - id: e8f9a0b1-2c3d-4e5f-6a7b-8c9d0e1f2a3b
                        name: Echocardiogram
                        factType: Procedure
                    sources:
                      - filename: medical_records_2024.pdf
                        page: 1
                        category: Medical Record
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_404'
      security:
        - ApiKeyAuth: []
  /2024-05/life/cases/{case_id}/conditions/{condition_id}/facts:
    get:
      tags:
        - 2024-05 Life - Conditions
      summary: Get facts related to a condition
      description: >-
        Retrieves a paginated list of facts that provide supporting evidence for
        the condition (medications, diagnoses, procedures, clinical data, etc.).
        Note that relatedConditions is not included in the response for this
        endpoint since the relationship to the condition is already implied.
      operationId: getLifeCaseConditionFacts
      parameters:
        - $ref: '#/components/parameters/CaseId'
        - $ref: '#/components/parameters/ConditionId'
        - $ref: '#/components/parameters/PageNumber'
        - $ref: '#/components/parameters/PageSize'
      responses:
        '200':
          description: Related facts retrieved successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/CaseFacts'
              example:
                data:
                  - id: f47ac10b-58cc-4372-a567-0e02b2c3d479
                    type: lifeCaseFacts
                    attributes:
                      factType: Medication
                      name: Lisinopril
                      shortSummary: Lisinopril 10mg daily
                      longSummary: >-
                        Patient prescribed Lisinopril 10mg once daily for
                        hypertension management. Started in January 2023 with
                        good tolerance.
                      occurredAt: '2023-01-20T00:00:00Z'
                      createdAt: '2024-01-10T12:00:00Z'
                      updatedAt: '2024-01-10T12:00:00Z'
                      sources:
                        - filename: prescription_history.pdf
                          page: 1
                          category: Medical Record
                  - id: a3e5c8b9-2f4d-4c7a-8e1f-9d6b3c4a5b2e
                    type: lifeCaseFacts
                    attributes:
                      factType: ClinicalData
                      name: Blood Pressure
                      shortSummary: Elevated blood pressure reading
                      longSummary: >-
                        Blood pressure measured at 145/92 mmHg, above normal
                        reference range.
                      occurredAt: '2024-01-10T00:00:00Z'
                      createdAt: '2024-01-10T12:00:00Z'
                      updatedAt: '2024-01-10T12:00:00Z'
                      sources:
                        - filename: lab_results_2024.pdf
                          page: 1
                          category: RX/DX Report
                  - id: e8f9a0b1-2c3d-4e5f-6a7b-8c9d0e1f2a3b
                    type: lifeCaseFacts
                    attributes:
                      factType: Procedure
                      name: Echocardiogram
                      shortSummary: Cardiac ultrasound examination
                      longSummary: >-
                        Patient underwent echocardiogram to assess cardiac
                        function related to hypertension management. Results
                        showed normal left ventricular function.
                      occurredAt: '2023-06-15T00:00:00Z'
                      createdAt: '2024-01-10T12:00:00Z'
                      updatedAt: '2024-01-10T12:00:00Z'
                      sources:
                        - filename: procedure_reports.pdf
                          page: 3
                          category: Medical Record
                links:
                  self: >-
                    https://api.sixfold.dev/2024-05/life/cases/33b95b3b-f30a-40e1-b2cc-c09847cb903c/conditions/a3b7d1e0-6c4f-4330-81e3-a8e05448f9f7/facts?page=1&page_size=20
                  first: >-
                    https://api.sixfold.dev/2024-05/life/cases/33b95b3b-f30a-40e1-b2cc-c09847cb903c/conditions/a3b7d1e0-6c4f-4330-81e3-a8e05448f9f7/facts?page=1&page_size=20
                  last: >-
                    https://api.sixfold.dev/2024-05/life/cases/33b95b3b-f30a-40e1-b2cc-c09847cb903c/conditions/a3b7d1e0-6c4f-4330-81e3-a8e05448f9f7/facts?page=3&page_size=20
                  prev: null
                  next: >-
                    https://api.sixfold.dev/2024-05/life/cases/33b95b3b-f30a-40e1-b2cc-c09847cb903c/conditions/a3b7d1e0-6c4f-4330-81e3-a8e05448f9f7/facts?page=2&page_size=20
                meta:
                  page: 1
                  pageSize: 20
                  totalItems: 47
                  totalPages: 3
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_404'
      security:
        - ApiKeyAuth: []
  /2024-05/life/cases/{case_id}/integrations/{integration_id}:
    patch:
      tags:
        - 2024-05 Life - Integrations
      summary: Add metadata to an integration of a life case
      description: |
        Add to an integration by providing metadata to the integration spec
      operationId: addDetailsToIntegrationOfLifeCase
      parameters:
        - name: case_id
          description: Unique identifier for the case
          in: path
          required: true
          schema:
            type: string
            example: c4fb4c10-5b2e-4220-90d2-96d94337e8e6
        - name: integration_id
          in: path
          description: Unique identifier for the integration (provided by Sixfold)
          required: true
          schema:
            type: string
            example: 78ea09d0-55f7-407a-9fc9-d625cfd84085
      requestBody:
        required: true
        content:
          application/json-patch+json:
            schema:
              type: array
              description: Array of the specs to be added to the case integration spec
              items:
                anyOf:
                  - $ref: '#/components/schemas/AddFileNetIntegrationFileRequest'
                  - $ref: '#/components/schemas/AddGenericIntegrationMetadataRequest'
            example:
              - op: add
                path: /files/-
                value:
                  id: filenet-unique-identifier
                  category: Medical Record
              - op: add
                path: /files/-
                value:
                  id: another-filenet-unique-identifier
                  category: Application
      responses:
        '201':
          description: Integration specs added successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Integrations'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_401'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_404'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_500'
      security:
        - ApiKeyAuth: []
