> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canary.effectiveai.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Open a submission's underwriting file

> Open the submission's file on one of its product's guidelines, from `listUwGuidelines`. The file is pinned to the guidelines' latest version for good, and starts at `seq` 0 with no inputs. A submission has one file: opening it again returns 409. Guidelines whose latest version has problems are refused with 400 and the problems in `details`. Requires `scope`, edit access to the submission and read access to its product; the submission must have a product.



## OpenAPI

````yaml /openapi.json post /insurance/uw-submissions/{submissionId}/file
openapi: 3.0.3
info:
  title: Effective API
  version: 2.0.0
  description: The public Effective REST API. Authenticate using an Effective API key.
servers:
  - url: https://api.canary.effectiveai.app/api/v2
    description: Canary
security:
  - bearerAuth: []
paths:
  /insurance/uw-submissions/{submissionId}/file:
    post:
      tags:
        - Underwriting
      summary: Open a submission's underwriting file
      description: >-
        Open the submission's file on one of its product's guidelines, from
        `listUwGuidelines`. The file is pinned to the guidelines' latest version
        for good, and starts at `seq` 0 with no inputs. A submission has one
        file: opening it again returns 409. Guidelines whose latest version has
        problems are refused with 400 and the problems in `details`. Requires
        `scope`, edit access to the submission and read access to its product;
        the submission must have a product.
      operationId: openUwSubmissionFile
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: submissionId
          in: path
        - schema:
            type: string
            pattern: ^mc:[A-Za-z0-9][A-Za-z0-9-]{0,127}$
            description: Authorization scope UUID or stable slug prefixed with mc:.
          required: true
          description: Authorization scope UUID or stable slug prefixed with mc:.
          name: scope
          in: query
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V2UwFileOpen'
      responses:
        '201':
          description: The new, empty file.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2UwFile'
        '400':
          description: >-
            Invalid request, or guidelines or an input the guidelines cannot
            use; `details` lists each problem. Restart a list after
            `invalid_cursor`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '403':
          description: Credential or scope access denied, or the change is not permitted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '404':
          description: Scope, product, guidelines, submission, file or input not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '409':
          description: >-
            The resource changed or already exists: read it again before
            retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '413':
          description: Request body is too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '415':
          description: Content-Type must be application/json.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '503':
          description: Temporarily unavailable. Honor Retry-After in seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
      security:
        - bearerAuth: []
components:
  schemas:
    V2UwFileOpen:
      type: object
      properties:
        guidelinesId:
          type: string
          format: uuid
          description: One of the product's guidelines, from `listUwGuidelines`.
      required:
        - guidelinesId
      additionalProperties: false
    V2UwFile:
      type: object
      properties:
        submissionId:
          type: string
        guidelines:
          allOf:
            - $ref: '#/components/schemas/V2UwGuidelinesVersion'
            - description: The guidelines version the file is pinned to.
        seq:
          type: integer
          description: The number of the last input, or 0 before the first.
        updatedAt:
          type: string
          format: date-time
        view:
          $ref: '#/components/schemas/V2UwFileView'
      required:
        - submissionId
        - guidelines
        - seq
        - updatedAt
        - view
    V2CodedError:
      allOf:
        - $ref: '#/components/schemas/V2Error'
        - type: object
          properties:
            code:
              type: string
              minLength: 1
              description: Stable error code. Clients must tolerate unknown future codes.
            details:
              type: array
              items:
                type: object
                properties:
                  location:
                    type: string
                    enum:
                      - path
                      - query
                      - header
                      - body
                  path:
                    type: array
                    items:
                      type: string
                      maxLength: 64
                    maxItems: 12
                  code:
                    type: string
                    enum:
                      - required
                      - invalid_type
                      - invalid_value
                      - unknown_field
                  message:
                    type: string
                    minLength: 1
                    maxLength: 200
                required:
                  - location
                  - path
                  - code
                  - message
              minItems: 1
              maxItems: 20
              description: Bounded safe validation issues; may omit some invalid fields.
            requestId:
              type: string
              minLength: 1
              maxLength: 128
              description: >-
                Existing server correlation for this HTTP attempt, when
                available.
            dataset:
              type: string
              enum:
                - naic
                - osha
              description: Dataset needed for dataset_not_enabled.
            accessUrl:
              type: string
              nullable: true
              format: uri
              description: >-
                Where to add the product to your account, for
                product_access_required.
          required:
            - code
    V2UwGuidelinesVersion:
      type: object
      nullable: true
      properties:
        id:
          type: string
          description: The guidelines `id`.
        versionId:
          type: string
          description: The exact version. Read it with `downloadFile` and `versionId`.
        version:
          type: integer
          description: Version number, starting at 1.
      required:
        - id
        - versionId
        - version
      description: >-
        The guidelines version the submission's file is pinned to, or null
        before the file is opened.
    V2UwFileView:
      type: object
      properties:
        title:
          type: string
        through:
          type: integer
          description: The last input reflected, as its `seq`.
        asOf:
          type: string
          nullable: true
          description: The time of that input.
        headline:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              label:
                type: string
              value:
                $ref: '#/components/schemas/V2UwFileValue'
            required:
              - name
              - label
              - value
          description: The figures the guidelines lead with, such as premium.
        stages:
          type: array
          items:
            type: object
            properties:
              stage:
                type: string
                description: A milestone the guidelines name, such as rate, quote or bind.
              status:
                type: string
                enum:
                  - declined
                  - ineligible
                  - done
                  - blocked
                  - waiting
                  - ready
              open:
                type: array
                items:
                  type: object
                  properties:
                    label:
                      type: string
                    kind:
                      type: string
                      description: gate, referral, review, require, rating or select.
                    location:
                      type: string
                      nullable: true
                      description: The location it applies to, or null for the account.
                    state:
                      type: string
                      enum:
                        - met
                        - not met
                        - open
                    value:
                      $ref: '#/components/schemas/V2UwFileValue'
                  required:
                    - label
                    - kind
                    - location
                    - state
                    - value
                description: What still stands in the way of this stage.
            required:
              - stage
              - status
              - open
          description: Each stage in order, with what is still open.
        next:
          type: string
          nullable: true
          description: The next stage to work on, or null.
        missing:
          type: array
          items:
            type: string
          description: Facts still needed for the next stage.
        declines:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              reason:
                type: string
              location:
                type: string
                nullable: true
              state:
                type: string
                enum:
                  - applies
                  - may apply
            required:
              - id
              - reason
              - location
              - state
        obligations:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              kind:
                type: string
                enum:
                  - referral
                  - review
              label:
                type: string
              role:
                type: string
              stage:
                type: string
                nullable: true
              location:
                type: string
                nullable: true
              applies:
                type: string
                enum:
                  - 'yes'
                  - open
              decision:
                type: string
                nullable: true
              by:
                type: string
                nullable: true
              satisfied:
                type: boolean
              note:
                type: string
                nullable: true
            required:
              - id
              - kind
              - label
              - role
              - stage
              - location
              - applies
              - decision
              - by
              - satisfied
              - note
          description: Referrals and reviews the guidelines call for, and how each stands.
        subjectivities:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              label:
                type: string
              state:
                type: string
              due:
                type: string
                nullable: true
            required:
              - id
              - label
              - state
              - due
        open:
          type: array
          items:
            $ref: '#/components/schemas/V2UwFileEffect'
          description: Everything the file is waiting on someone to do.
        sections:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                nullable: true
              title:
                type: string
              level:
                type: integer
              line:
                type: integer
              blocks:
                type: array
                items:
                  type: object
                  additionalProperties:
                    nullable: true
                description: >-
                  Headings, text, lists, rules and tables, each annotated for
                  this submission.
            required:
              - id
              - title
              - level
              - line
              - blocks
          description: >-
            The guidelines document, section by section, annotated with this
            submission.
        problems:
          type: array
          items:
            type: string
          description: Problems with the inputs, if any.
      required:
        - title
        - through
        - asOf
        - headline
        - stages
        - next
        - missing
        - declines
        - obligations
        - subjectivities
        - open
        - sections
        - problems
      description: The whole file as an underwriter reads it now.
    V2Error:
      type: object
      properties:
        error:
          type: string
          minLength: 1
          description: Human-readable explanation of the failure.
      required:
        - error
    V2UwFileValue:
      anyOf:
        - type: object
          properties:
            known:
              type: boolean
              enum:
                - true
            text:
              type: string
              description: The value as written in the file, such as `USD 65,934`.
            provisional:
              type: boolean
              enum:
                - true
              description: Present when the value rests on a fact no one has confirmed yet.
          required:
            - known
            - text
        - type: object
          properties:
            known:
              type: boolean
              enum:
                - false
            need:
              type: array
              items:
                type: string
              description: The facts this value is waiting on.
            notes:
              type: array
              items:
                type: string
              description: Why it cannot be worked out yet, when not a fact.
          required:
            - known
            - need
            - notes
    V2UwFileEffect:
      type: object
      properties:
        id:
          type: string
          description: 'Stable ID: the same open item keeps the same ID across inputs.'
        kind:
          type: string
          enum:
            - request
            - refer
            - review
            - decline
            - chase
          description: >-
            request: ask for a fact before a stage. refer: get approval from a
            role. review: a role must do a piece of work. decline: decline
            reasons apply. chase: a subjectivity is overdue.
        stage:
          type: string
          nullable: true
        need:
          type: string
          description: 'request: the fact to ask for.'
        role:
          type: string
          description: 'refer and review: the role who must act.'
        obligation:
          type: string
        label:
          type: string
        reasons:
          type: array
          items:
            type: string
          description: 'decline: the reasons that apply.'
        subjectivity:
          type: string
        due:
          type: string
          nullable: true
      required:
        - id
        - kind
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Effective API key. Send Authorization: Bearer sk-eai-...'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.