> ## 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.

# Reopen proposals of an underwriting submission’s extraction

> Takes back the ruling on each proposal named in `paths` and each fact's value named in `facts` as `{fact, row?, field?}` (at most 500 together; a row without `field` names each of its fields), so it is offered again: the undo of an accept, a conflict choice or a dismiss.

Reopening a path where the submission holds a value the extraction proposed retracts that value, and takes back every `overridden` ruling at the path: the path holds no value, and the values read there are offered again. A value the accepted one replaced is not put back; it is in the log's history. Reopening a dismissed or overridden proposal takes that ruling back and leaves a value the extraction did not propose as it is. A ruling stays on record as taken back, with who did it and when.

Answers `reopened`, `skipped` (each path left as it was and why: `no_ruling`), `facts` (the same for the facts' values) and `outstanding`. 422 `unknown_proposal` for a path or fact the extraction read nothing for, which refuses the whole request.

A value removed is retracted from the submission's log. The values live in the submission’s log on its program (`/v2/rsl/{id}/logs/{log}`, the log’s id is the submission’s), opened on the release the desk names the first time one is written. Each is written as the caller, in the program role they hold (or the one that acts for every other they hold): 403 `no_program_role` for a caller who holds none. What the log refuses is 422 `log_refused`, its words naming the log’s code (a value a higher role gave is `NOT_AUTHORIZED`), and changes nothing; a value another writer changed since the read, or a ruling another request made meanwhile, is 409 `conflict`. A value citing a document whose bytes changed since the extraction read it is 409 `document_changed`: run the extraction again. The log write is made under the request’s key, so the key sent with another request is 409 `idempotency_conflict` and writes nothing.

Idempotency-Key is required. The same key and request answer what the first one did for 24 hours, with `outstanding` as it stands now; the same key with a different request is 409 `idempotency_conflict`. A request refused before it writes the submission’s log changes and binds nothing. A ruling made at its paths after it read them refuses it with 409 `conflict` after its log write: the value the log took stays, and a retry finds it held.

Whoever rules writes to the submission’s log as one of the program’s roles: the caller needs a role of the program, or is a workspace admin. Needs edit access to the submission (403 for a reader, 404 when it cannot be read). An extraction with no result is 409 `extraction_not_finished`. Only where the workspace has underwriting turned on (403 `feature_not_enabled`).

Alpha: this operation may change or be removed without notice.



## OpenAPI

````yaml /openapi.json post /insurance/underwriting/submissions/{submissionId}/extractions/{extractionId}/reopen
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/underwriting/submissions/{submissionId}/extractions/{extractionId}/reopen:
    post:
      tags:
        - Underwriting submissions
      summary: Reopen proposals of an underwriting submission’s extraction
      description: >-
        Takes back the ruling on each proposal named in `paths` and each fact's
        value named in `facts` as `{fact, row?, field?}` (at most 500 together;
        a row without `field` names each of its fields), so it is offered again:
        the undo of an accept, a conflict choice or a dismiss.


        Reopening a path where the submission holds a value the extraction
        proposed retracts that value, and takes back every `overridden` ruling
        at the path: the path holds no value, and the values read there are
        offered again. A value the accepted one replaced is not put back; it is
        in the log's history. Reopening a dismissed or overridden proposal takes
        that ruling back and leaves a value the extraction did not propose as it
        is. A ruling stays on record as taken back, with who did it and when.


        Answers `reopened`, `skipped` (each path left as it was and why:
        `no_ruling`), `facts` (the same for the facts' values) and
        `outstanding`. 422 `unknown_proposal` for a path or fact the extraction
        read nothing for, which refuses the whole request.


        A value removed is retracted from the submission's log. The values live
        in the submission’s log on its program (`/v2/rsl/{id}/logs/{log}`, the
        log’s id is the submission’s), opened on the release the desk names the
        first time one is written. Each is written as the caller, in the program
        role they hold (or the one that acts for every other they hold): 403
        `no_program_role` for a caller who holds none. What the log refuses is
        422 `log_refused`, its words naming the log’s code (a value a higher
        role gave is `NOT_AUTHORIZED`), and changes nothing; a value another
        writer changed since the read, or a ruling another request made
        meanwhile, is 409 `conflict`. A value citing a document whose bytes
        changed since the extraction read it is 409 `document_changed`: run the
        extraction again. The log write is made under the request’s key, so the
        key sent with another request is 409 `idempotency_conflict` and writes
        nothing.


        Idempotency-Key is required. The same key and request answer what the
        first one did for 24 hours, with `outstanding` as it stands now; the
        same key with a different request is 409 `idempotency_conflict`. A
        request refused before it writes the submission’s log changes and binds
        nothing. A ruling made at its paths after it read them refuses it with
        409 `conflict` after its log write: the value the log took stays, and a
        retry finds it held.


        Whoever rules writes to the submission’s log as one of the program’s
        roles: the caller needs a role of the program, or is a workspace admin.
        Needs edit access to the submission (403 for a reader, 404 when it
        cannot be read). An extraction with no result is 409
        `extraction_not_finished`. Only where the workspace has underwriting
        turned on (403 `feature_not_enabled`).


        Alpha: this operation may change or be removed without notice.
      operationId: reopenUnderwritingSubmissionProposals
      parameters:
        - schema:
            type: string
            format: uuid
            description: The submission’s id.
          required: true
          description: The submission’s id.
          name: submissionId
          in: path
        - schema:
            type: string
            format: uuid
            description: The extraction’s id.
          required: true
          description: The extraction’s id.
          name: extractionId
          in: path
        - schema:
            type: string
            minLength: 1
            maxLength: 128
            pattern: ^[A-Za-z0-9\-_.:]+$
            description: >-
              Client-chosen key for safe retries: 1-128 letters, digits, -, _, .
              or :. Use a new random UUID for each intended operation and the
              same key when retrying it. Do not put customer data or credentials
              in the key.
          required: true
          description: >-
            Client-chosen key for safe retries: 1-128 letters, digits, -, _, .
            or :. Use a new random UUID for each intended operation and the same
            key when retrying it. Do not put customer data or credentials in the
            key.
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/V2ReopenUnderwritingSubmissionProposalsRequest
      responses:
        '200':
          description: >-
            What was reopened and skipped, and what the submission still waits
            on.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ReopenedUnderwritingSubmissionProposals'
        '400':
          description: 'invalid_request: an unknown or invalid field, or submission id.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '403':
          description: >-
            feature_not_enabled: underwriting is not enabled for the workspace.
            forbidden: the caller can read the submission and not edit it.
            no_program_role: the caller holds no role of the submission’s
            program.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '404':
          description: >-
            not_found: no such submission or extraction, or the caller cannot
            read the submission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '409':
          description: >-
            extraction_not_finished: the extraction has no result.
            idempotency_conflict: the key was used with a different request.
            conflict: a value changed in the submission’s log, or another ruling
            was made at the same paths, since it was read; read the submission
            again. document_changed: a cited document changed since the
            extraction read it; run the extraction again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2UnderwritingSubmissionRulingConflict'
        '413':
          description: 'request_too_large: the body is over 256 KiB.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '415':
          description: 'unsupported_media_type: use application/json.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '422':
          description: unknown_proposal or log_refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
      security:
        - bearerAuth: []
components:
  schemas:
    V2ReopenUnderwritingSubmissionProposalsRequest:
      type: object
      properties:
        paths:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 500
            description: 'A proposal of this extraction, by its input path: `state`.'
          minItems: 1
          maxItems: 500
          description: Each proposal whose ruling to take back, by its input path.
        facts:
          type: array
          items:
            type: object
            properties:
              fact:
                type: string
                maxLength: 100
                pattern: ^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)*$
                description: 'The program’s note, by its path: loss_year_figures.'
              row:
                type: string
                minLength: 1
                maxLength: 200
                pattern: ^[^\x00-\x1f\x7f]+$
                description: 'For a note kept as a list: the row’s id.'
              field:
                type: string
                maxLength: 64
                pattern: ^[a-z][a-z0-9_]*$
                description: 'For a fact given as a record: the field.'
            required:
              - fact
            additionalProperties: false
            description: >-
              A fact’s value the extraction read, by fact, row and field. A row
              without `field` names each of its fields.
          minItems: 1
          maxItems: 500
          description: >-
            Each fact’s value whose ruling to take back, by fact, row and field.
            A row without `field` names each of its fields.
      additionalProperties: false
    V2ReopenedUnderwritingSubmissionProposals:
      type: object
      properties:
        reopened:
          type: array
          items:
            type: string
            minLength: 1
          description: >-
            The paths whose rulings were taken back: the value accepted there
            goes, with what it overrode, and each value dismissed there is
            offered again. A value the accepted one replaced is not put back.
        skipped:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                minLength: 1
              reason:
                type: string
                minLength: 1
            required:
              - path
              - reason
          description: >-
            Each path left as it is and why. `reason` is extensible: `no_ruling`
            (nothing to take back: no value proposed there is held or set
            aside).
        facts:
          type: object
          properties:
            reopened:
              type: array
              items:
                type: object
                properties:
                  fact:
                    type: string
                    maxLength: 100
                    pattern: ^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)*$
                    description: 'The program’s note, by its path: loss_year_figures.'
                  row:
                    type: string
                    minLength: 1
                    maxLength: 200
                    pattern: ^[^\x00-\x1f\x7f]+$
                    description: 'For a note kept as a list: the row’s id.'
                  field:
                    type: string
                    maxLength: 64
                    pattern: ^[a-z][a-z0-9_]*$
                    description: 'For a fact given as a record: the field.'
                required:
                  - fact
                additionalProperties: false
              description: Each fact’s value whose ruling was taken back.
            skipped:
              type: array
              items:
                type: object
                properties:
                  fact:
                    type: string
                    maxLength: 100
                    pattern: ^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)*$
                    description: 'The program’s note, by its path: loss_year_figures.'
                  row:
                    type: string
                    minLength: 1
                    maxLength: 200
                    pattern: ^[^\x00-\x1f\x7f]+$
                    description: 'For a note kept as a list: the row’s id.'
                  field:
                    type: string
                    maxLength: 64
                    pattern: ^[a-z][a-z0-9_]*$
                    description: 'For a fact given as a record: the field.'
                  reason:
                    type: string
                    minLength: 1
                required:
                  - fact
                  - reason
                additionalProperties: false
              description: >-
                Each fact’s value left as it is and why, with the reasons of
                `skipped`.
          required:
            - reopened
            - skipped
          description: The same for the facts named.
        outstanding:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                minLength: 1
                maxLength: 600
                description: >-
                  Stable across runs: `conflict:<path>`,
                  `conflict:fact:<key>[<row>]#<field>`, `input:<path>`,
                  `document:<key>`, `unread:<name>`, `fact:<key>`,
                  `fact:<key>#<field>`.
              label:
                type: string
                minLength: 1
                maxLength: 600
                description: What is outstanding, in words.
              kind:
                type: string
                enum:
                  - conflict
                  - document
                  - input
                  - fact
              awaiting:
                type: string
                enum:
                  - broker
                  - underwriter
                  - system
              neededFor:
                type: string
                minLength: 1
                maxLength: 200
                description: What it is needed for, in words.
              severity:
                type: string
                enum:
                  - blocking
                  - advisory
              note:
                type: string
                minLength: 1
                maxLength: 2000
                description: >-
                  The run’s words on it, where it gave some; for an answer that
                  lapsed, what it was and from which file.
            required:
              - key
              - label
              - kind
              - awaiting
              - severity
            additionalProperties: false
          description: >-
            What the submission still waits on after this call, as a read of it
            answers.
      required:
        - reopened
        - skipped
        - facts
        - outstanding
    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.
            businessCode:
              type: string
              description: The rater’s own refusal code, for business_rejection.
            violations:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                    description: Authored or built-in constraint code
                  message:
                    type: string
                    description: Authored message for the failed constraint
                  path:
                    type: string
                    description: Input path of the offending value; empty for the request
                  value:
                    nullable: true
                    description: Offending input value, size-bounded by the runtime
                  constraint:
                    type: string
                    description: The constraint the value failed, as text
                  cite:
                    type: string
                    nullable: true
                    description: >-
                      Filing citation of the constraint, when the source cites
                      one
                required:
                  - code
                  - message
                  - path
                  - value
                  - constraint
                  - cite
                additionalProperties: false
              maxItems: 256
              description: >-
                Each input constraint the submission failed, for invalid_inputs
                and business_rejection.
            violationsTruncated:
              type: boolean
              description: >-
                True when the rater reported more violations than violations
                holds.
            executionId:
              type: string
              description: >-
                The recorded execution of a failed rating, for rater rating
                failures.
            accessUrl:
              type: string
              nullable: true
              format: uri
              description: Not currently returned.
          required:
            - code
    V2UnderwritingSubmissionRulingConflict:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: >-
            `extraction_not_finished`, `idempotency_conflict`, `conflict` or
            `document_changed`.
        error:
          type: string
          minLength: 1
        extractionId:
          type: string
          format: uuid
          description: The extraction with no result, for `extraction_not_finished`.
        requestId:
          type: string
          minLength: 1
          maxLength: 128
      required:
        - code
        - error
    V2Error:
      type: object
      properties:
        error:
          type: string
          minLength: 1
          description: Human-readable explanation of the failure.
      required:
        - error
  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.