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

# Accept proposals of an underwriting submission’s extraction

> Accepts values an extraction proposed for the inputs of the submission's program, and uses values it read for the profile's facts. Each accepted value is answered in the submission's log at its input path, citing the place it was read, and the proposal reads `ruled` with `ruling` `accepted` while the log holds that value, in this extraction and in any later one that reads the same value. Nothing else is kept for an accept: the extraction's `rulings` list only the values set aside. A fact's value is named by its fact, row and field and written to the note it is of, and shows in the extraction's `factValues`.

Name the proposals in `paths` by input path and the facts' values in `facts` as `{fact, row?, field?}` (each once, at most 500 together), or send `{"all": true}` to accept every valid proposal and fact value not yet ruled on. A row of a record fact named without `field` uses each of its fields, skipping a field in conflict. A path or a fact's field that holds several values (a conflict) is named with the value chosen, as `{path, value}` or `{fact, row, field, value}`, one of the conflict's values: that value is kept and every other value in the conflict, the one held before included, is marked `overridden`, so a later extraction that reads one of them again does not ask again. Choosing the value the submission already holds keeps it. `all` never accepts a conflict.

Answers `accepted`, the paths now accepted; `skipped`, each path left as it was and why; `facts`, the same for the facts' values, one per field; and `outstanding`, what the submission still waits on. A path already accepted is answered in `accepted` again. 422 `unknown_proposal` for a path or fact, or a chosen value, the extraction did not read; 422 `conflict_needs_value` for a conflict named without a value. Either refuses the whole request.

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}/accept
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}/accept:
    post:
      tags:
        - Underwriting submissions
      summary: Accept proposals of an underwriting submission’s extraction
      description: >-
        Accepts values an extraction proposed for the inputs of the submission's
        program, and uses values it read for the profile's facts. Each accepted
        value is answered in the submission's log at its input path, citing the
        place it was read, and the proposal reads `ruled` with `ruling`
        `accepted` while the log holds that value, in this extraction and in any
        later one that reads the same value. Nothing else is kept for an accept:
        the extraction's `rulings` list only the values set aside. A fact's
        value is named by its fact, row and field and written to the note it is
        of, and shows in the extraction's `factValues`.


        Name the proposals in `paths` by input path and the facts' values in
        `facts` as `{fact, row?, field?}` (each once, at most 500 together), or
        send `{"all": true}` to accept every valid proposal and fact value not
        yet ruled on. A row of a record fact named without `field` uses each of
        its fields, skipping a field in conflict. A path or a fact's field that
        holds several values (a conflict) is named with the value chosen, as
        `{path, value}` or `{fact, row, field, value}`, one of the conflict's
        values: that value is kept and every other value in the conflict, the
        one held before included, is marked `overridden`, so a later extraction
        that reads one of them again does not ask again. Choosing the value the
        submission already holds keeps it. `all` never accepts a conflict.


        Answers `accepted`, the paths now accepted; `skipped`, each path left as
        it was and why; `facts`, the same for the facts' values, one per field;
        and `outstanding`, what the submission still waits on. A path already
        accepted is answered in `accepted` again. 422 `unknown_proposal` for a
        path or fact, or a chosen value, the extraction did not read; 422
        `conflict_needs_value` for a conflict named without a value. Either
        refuses the whole request.


        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: acceptUnderwritingSubmissionProposals
      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/V2AcceptUnderwritingSubmissionProposalsRequest
      responses:
        '200':
          description: >-
            What was accepted and skipped, and what the submission still waits
            on.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2AcceptedUnderwritingSubmissionProposals'
        '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, conflict_needs_value or log_refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
      security:
        - bearerAuth: []
components:
  schemas:
    V2AcceptUnderwritingSubmissionProposalsRequest:
      anyOf:
        - type: object
          properties:
            paths:
              type: array
              items:
                anyOf:
                  - type: string
                    minLength: 1
                    maxLength: 500
                    description: 'A proposal of this extraction, by its input path: `state`.'
                  - type: object
                    properties:
                      path:
                        type: string
                        minLength: 1
                        maxLength: 500
                        description: >-
                          A proposal of this extraction, by its input path:
                          `state`.
                      value:
                        anyOf:
                          - type: string
                          - type: number
                          - type: boolean
                          - nullable: true
                          - type: array
                            items:
                              nullable: true
                          - type: object
                            additionalProperties:
                              nullable: true
                        description: >-
                          The value chosen: one of the values the conflict at
                          this path holds.
                    required:
                      - path
                      - value
                    additionalProperties: false
              minItems: 1
              maxItems: 500
              description: >-
                Each proposal to accept, by its input path, each path once. A
                path in conflict is `{path, value}`, naming the value chosen.
            facts:
              type: array
              items:
                anyOf:
                  - 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.
                  - 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.'
                      value:
                        anyOf:
                          - type: string
                          - type: number
                          - type: boolean
                          - nullable: true
                          - type: array
                            items:
                              nullable: true
                          - type: object
                            additionalProperties:
                              nullable: true
                        description: >-
                          The value chosen: one of the values the conflict at
                          this fact’s field holds.
                    required:
                      - fact
                      - value
                    additionalProperties: false
              minItems: 1
              maxItems: 500
              description: >-
                Each fact’s value to use, by fact, row and field, each once. A
                row without `field` uses each of its fields that is not in
                conflict. A field in conflict is named with `value`, the value
                chosen.
          additionalProperties: false
        - type: object
          properties:
            all:
              type: boolean
              enum:
                - true
              description: >-
                Accept every valid proposal and fact value not yet ruled on.
                Never accepts a conflict.
          required:
            - all
          additionalProperties: false
    V2AcceptedUnderwritingSubmissionProposals:
      type: object
      properties:
        accepted:
          type: array
          items:
            type: string
            minLength: 1
          description: >-
            The paths whose proposal is accepted, with its value kept for the
            submission.
        skipped:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                minLength: 1
              reason:
                type: string
                minLength: 1
            required:
              - path
              - reason
          description: "Each path not accepted and why. `reason` is extensible: `underwriter_value` (the submission holds that value inside a record it holds), `invalid` (the proposal does not fit its input; with `all`, also a value the submissionâ\x80\x99s log refuses, such as a code outside its inputâ\x80\x99s pattern), `conflict` (with `all`: the path holds several values), `dismissed` or `overridden` (already ruled on: reopen it first)."
        facts:
          type: object
          properties:
            accepted:
              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 now used, one per field, with its value kept.
            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 not used and why, with the reasons of
                `skipped`.
          required:
            - accepted
            - 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:
        - accepted
        - 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.