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

# Set the underwriter’s values on an underwriting submission

> Holds the underwriter's own value at each input of the submission's program named in `values` by path, and at each of the extraction profile's facts named in `facts` by fact, row and field, or takes it away with `null`, and adds each row in `rows` (each once, at most 500 together). This is how a value is entered where the files give none, or corrected where they give another, and a row the files missed is added or one they should not have is taken away.

Each input value is checked against its input as a proposal is: a path that names no input of the program, an input the program keeps as a note, or a value that does not fit is 422 `invalid_value`. Each fact's value is checked against the profile: a fact it keeps, a `row` for a fact of many rows and none otherwise, a `field` the fact has, a value among its choices where it lists them; a row of a record fact named without `field` takes a record of its fields. Anything else is 422 `invalid_value`, which refuses the whole request. A submission with no program holds no input values, and one with no extraction profile no facts (422 `invalid_value`).

Each row in `rows` is added to a fact the profile keeps as a list of records whose rows no file keys by a field of their own (a claim, another carrier's layer, a class at a location): a record of the fact's fields, checked as a fact's value is, with at least one of them given. The submission gives the row its id, `u-` and 8 hex digits, the same on a retry with the same `Idempotency-Key`. A row of a list keyed by one of its fields, such as a year, is added in `facts` under that key instead, and an item of a program list in `values` by its path, such as `loss_years[year=2024]` with its record. Either is 422 `invalid_value` in `rows`.

A row or item is taken away whole with `null` at its address: `{fact, row, value: null}` takes the row and its values out of the log, and `null` at an item's path takes the item out, whether its values were set whole or one by one. An item the program gives a role inside is kept field by field, so `null` there takes its values away and leaves the item.

Values are ruled against the latest completed extraction: a value it proposed there is accepted, as `accept` would, with the place it was read. Every other value proposed there, a conflict's and the one accepted before included, reads `ruled` with `ruling` `overridden` from then on. Taking a value away takes back the overrides there, so the proposals are offered again, and an input the program needs is `missing` again where none is left; a dismissal stands. With no completed extraction, the values are held as they are.

Answers `set`, the paths that hold the value sent; `cleared`, the paths taken away; `facts`, the same for the facts' values, one per field, with `added`, each row added from `rows` with its id; and `outstanding`, what the submission still waits on. The values held are on an extraction's read, in `values` and `factValues`.

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). 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}/values
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}/values:
    post:
      tags:
        - Underwriting submissions
      summary: Set the underwriter’s values on an underwriting submission
      description: >-
        Holds the underwriter's own value at each input of the submission's
        program named in `values` by path, and at each of the extraction
        profile's facts named in `facts` by fact, row and field, or takes it
        away with `null`, and adds each row in `rows` (each once, at most 500
        together). This is how a value is entered where the files give none, or
        corrected where they give another, and a row the files missed is added
        or one they should not have is taken away.


        Each input value is checked against its input as a proposal is: a path
        that names no input of the program, an input the program keeps as a
        note, or a value that does not fit is 422 `invalid_value`. Each fact's
        value is checked against the profile: a fact it keeps, a `row` for a
        fact of many rows and none otherwise, a `field` the fact has, a value
        among its choices where it lists them; a row of a record fact named
        without `field` takes a record of its fields. Anything else is 422
        `invalid_value`, which refuses the whole request. A submission with no
        program holds no input values, and one with no extraction profile no
        facts (422 `invalid_value`).


        Each row in `rows` is added to a fact the profile keeps as a list of
        records whose rows no file keys by a field of their own (a claim,
        another carrier's layer, a class at a location): a record of the fact's
        fields, checked as a fact's value is, with at least one of them given.
        The submission gives the row its id, `u-` and 8 hex digits, the same on
        a retry with the same `Idempotency-Key`. A row of a list keyed by one of
        its fields, such as a year, is added in `facts` under that key instead,
        and an item of a program list in `values` by its path, such as
        `loss_years[year=2024]` with its record. Either is 422 `invalid_value`
        in `rows`.


        A row or item is taken away whole with `null` at its address: `{fact,
        row, value: null}` takes the row and its values out of the log, and
        `null` at an item's path takes the item out, whether its values were set
        whole or one by one. An item the program gives a role inside is kept
        field by field, so `null` there takes its values away and leaves the
        item.


        Values are ruled against the latest completed extraction: a value it
        proposed there is accepted, as `accept` would, with the place it was
        read. Every other value proposed there, a conflict's and the one
        accepted before included, reads `ruled` with `ruling` `overridden` from
        then on. Taking a value away takes back the overrides there, so the
        proposals are offered again, and an input the program needs is `missing`
        again where none is left; a dismissal stands. With no completed
        extraction, the values are held as they are.


        Answers `set`, the paths that hold the value sent; `cleared`, the paths
        taken away; `facts`, the same for the facts' values, one per field, with
        `added`, each row added from `rows` with its id; and `outstanding`, what
        the submission still waits on. The values held are on an extraction's
        read, in `values` and `factValues`.


        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). Only where the workspace has underwriting turned on
        (403 `feature_not_enabled`).


        Alpha: this operation may change or be removed without notice.
      operationId: setUnderwritingSubmissionValues
      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
            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/V2SetUnderwritingSubmissionValuesRequest'
      responses:
        '200':
          description: What was set and taken away, and what the submission still waits on.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2SetUnderwritingSubmissionValues'
        '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 the caller cannot read it.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '409':
          description: >-
            idempotency_conflict: the key was used with a different request.
            conflict: a value changed in the submission’s log since it was read;
            read the submission again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '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: invalid_value or log_refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
      security:
        - bearerAuth: []
components:
  schemas:
    V2SetUnderwritingSubmissionValuesRequest:
      type: object
      properties:
        values:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                minLength: 1
                maxLength: 500
                description: 'An input of the submission’s program: `state`.'
              value:
                anyOf:
                  - type: string
                  - type: number
                  - type: boolean
                  - nullable: true
                  - type: array
                    items:
                      nullable: true
                  - type: object
                    additionalProperties:
                      nullable: true
                description: >-
                  The value to hold, as the input takes it; null takes the
                  underwriter’s value away.
              because:
                type: string
                minLength: 1
                maxLength: 2000
                description: >-
                  Why the underwriter holds this value, kept with it in the
                  submission’s log. The log needs a reason for an input the
                  program reserves for a role (`by` a role in the guideline),
                  and refuses one without it (422 `log_refused`,
                  `REASON_REQUIRED`). A value the files proposed keeps its quote
                  as its reason, and this is not used.
            required:
              - path
              - value
            additionalProperties: false
          minItems: 1
          maxItems: 500
          description: Each value to hold or take away, by its input path, each path once.
        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.'
              value:
                anyOf:
                  - type: string
                  - type: number
                  - type: boolean
                  - nullable: true
                  - type: array
                    items:
                      nullable: true
                  - type: object
                    additionalProperties:
                      nullable: true
                description: >-
                  The value to hold: one of the field’s or fact’s choices where
                  it lists them, a record of the fact’s fields for a row named
                  without `field`; null takes the value away.
            required:
              - fact
              - value
            additionalProperties: false
          minItems: 1
          maxItems: 500
          description: >-
            Each fact’s value to hold or take away, by fact, row and field, each
            once.
        rows:
          type: array
          items:
            type: object
            properties:
              fact:
                type: string
                maxLength: 100
                pattern: ^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)*$
                description: >-
                  A note the program keeps as a list whose rows no file names by
                  a key of their own: loss_claims.
              value:
                type: object
                additionalProperties:
                  anyOf:
                    - type: string
                    - type: number
                    - type: boolean
                    - nullable: true
                    - type: array
                      items:
                        nullable: true
                    - type: object
                      additionalProperties:
                        nullable: true
                description: >-
                  The new row: a record of the fact’s fields, at least one of
                  them with a value. Each field is checked as a value in `facts`
                  is.
            required:
              - fact
              - value
            additionalProperties: false
          minItems: 1
          maxItems: 500
          description: >-
            Each row to add to a fact kept as a list, in order. The submission
            gives each new row its id (`u-` and 8 hex digits), the same on a
            retry with the same Idempotency-Key, and answers them in
            `facts.added`. A row of a list keyed by one of its fields (a year, a
            location) is added in `facts` by that key; an item of a program list
            in `values` by its path. Take a row away with `{fact, row, value:
            null}` in `facts`.
      additionalProperties: false
    V2SetUnderwritingSubmissionValues:
      type: object
      properties:
        set:
          type: array
          items:
            type: string
            minLength: 1
          description: The paths that now hold the value sent, in the order sent.
        cleared:
          type: array
          items:
            type: string
            minLength: 1
          description: >-
            The paths whose value was taken away; the files’ proposals there are
            offered again.
        facts:
          type: object
          properties:
            set:
              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 held, one per field, in the order sent.
            cleared:
              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 taken away.
            added:
              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.'
                required:
                  - fact
                  - row
                additionalProperties: false
              description: >-
                Each row added from `rows`, with the id it was given, in the
                order sent.
          required:
            - set
            - cleared
            - added
          description: The same for the facts named, and the rows added.
        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:
        - set
        - cleared
        - 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
    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.