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

# Decline an underwriting submission

> Declines the submission: takes the program’s refuse act, with why in `because` (and a reason code in `reason` where the act lists the ones it takes), which ends the log as `refused`. The submission’s `stage` is then `declined`, and its record’s `status` follows (`declined`, with `because` as its reason). The log takes a decline only where one of the program’s rules declines the submission (its `declines`). Where none does and the release declares a decline a role takes on its own judgment (an input that role answers, a yes or no that starts at no, which one declining rule alone reads), the decline answers that input yes as the caller, with `because`, and takes the act in the same write: the log keeps both or neither, and a caller below the input’s role is refused (`NOT_AUTHORIZED`). Otherwise the log refuses it (`NOT_DECLINABLE`).

Written in the submission's log, as the caller, in the program role they hold (403 `no_program_role` for one who holds none); the log decides whether the act may be taken now, and refuses it with 422 `log_refused` naming its code. `basedOn` is the log entry the caller read (`rating.seq` or `log.seq`): a value changed since is 409 `conflict`, so a decision is never taken on values the caller did not see.

The act is the program's own: the one of this kind its guideline declares, or the one named in `act` where it declares several (`getUnderwritingProgramReadiness` lists them). The caller takes it as a role of the program that the act allows: one it holds, or any as a workspace admin.

Idempotency-Key is required: a retry with the same key and request writes nothing again and answers the submission as it is now; the same key with a different request is 409 `idempotency_conflict`. Answers the submission, read after the act. 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}/decline
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}/decline:
    post:
      tags:
        - Underwriting submissions
      summary: Decline an underwriting submission
      description: >-
        Declines the submission: takes the program’s refuse act, with why in
        `because` (and a reason code in `reason` where the act lists the ones it
        takes), which ends the log as `refused`. The submission’s `stage` is
        then `declined`, and its record’s `status` follows (`declined`, with
        `because` as its reason). The log takes a decline only where one of the
        program’s rules declines the submission (its `declines`). Where none
        does and the release declares a decline a role takes on its own judgment
        (an input that role answers, a yes or no that starts at no, which one
        declining rule alone reads), the decline answers that input yes as the
        caller, with `because`, and takes the act in the same write: the log
        keeps both or neither, and a caller below the input’s role is refused
        (`NOT_AUTHORIZED`). Otherwise the log refuses it (`NOT_DECLINABLE`).


        Written in the submission's log, as the caller, in the program role they
        hold (403 `no_program_role` for one who holds none); the log decides
        whether the act may be taken now, and refuses it with 422 `log_refused`
        naming its code. `basedOn` is the log entry the caller read
        (`rating.seq` or `log.seq`): a value changed since is 409 `conflict`, so
        a decision is never taken on values the caller did not see.


        The act is the program's own: the one of this kind its guideline
        declares, or the one named in `act` where it declares several
        (`getUnderwritingProgramReadiness` lists them). The caller takes it as a
        role of the program that the act allows: one it holds, or any as a
        workspace admin.


        Idempotency-Key is required: a retry with the same key and request
        writes nothing again and answers the submission as it is now; the same
        key with a different request is 409 `idempotency_conflict`. Answers the
        submission, read after the act. 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: declineUnderwritingSubmission
      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/V2DeclineUnderwritingSubmissionRequest'
      responses:
        '200':
          description: The submission, after the act.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2UnderwritingSubmission'
        '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: >-
            conflict: a value changed in the submission’s log since `basedOn`;
            read the submission again. not_quotable: the submission is on no
            program, or its log is not open yet. idempotency_conflict: the key
            was used with a different request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '413':
          description: 'request_too_large: the body is over 32 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_act: the program declares no act of this kind, several and
            the request names none, or the one named is of another kind.
            log_refused: the log refused the act; its words name the log’s code,
            such as NOT_READY (an input is open or a rule holds it), NO_OFFER
            (no such quote, or it no longer stands) or REASON_REQUIRED.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
      security:
        - bearerAuth: []
components:
  schemas:
    V2DeclineUnderwritingSubmissionRequest:
      type: object
      properties:
        basedOn:
          type: integer
          minimum: 0
          description: >-
            The log entry the decision rests on: `rating.seq` (or `log.seq`) as
            last read. Refused as `conflict` when a value changed since.
        because:
          type: string
          minLength: 1
          maxLength: 2000
          description: Why it is declined, kept with the decision in the log.
        reason:
          type: string
          minLength: 1
          maxLength: 128
          description: >-
            A reason code, where the program’s decline act lists the ones it
            takes.
        act:
          type: string
          pattern: ^[A-Za-z_][A-Za-z0-9_]{0,63}$
          description: >-
            The program’s act, by its name. Left out, the one act of this kind
            the program declares.
      required:
        - basedOn
        - because
      additionalProperties: false
    V2UnderwritingSubmission:
      type: object
      properties:
        authority:
          type: object
          properties:
            releaseVersion:
              type: integer
              nullable: true
            ordinary:
              oneOf:
                - type: object
                  properties:
                    allowed:
                      type: boolean
                      enum:
                        - true
                    role:
                      type: string
                  required:
                    - allowed
                    - role
                - type: object
                  properties:
                    allowed:
                      type: boolean
                      enum:
                        - false
                    reason:
                      type: string
                  required:
                    - allowed
                    - reason
            actions:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  kind:
                    type: string
                  permission:
                    oneOf:
                      - type: object
                        properties:
                          allowed:
                            type: boolean
                            enum:
                              - true
                          role:
                            type: string
                        required:
                          - allowed
                          - role
                      - type: object
                        properties:
                          allowed:
                            type: boolean
                            enum:
                              - false
                          reason:
                            type: string
                        required:
                          - allowed
                          - reason
                required:
                  - name
                  - kind
                  - permission
            decline:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - record
                  required:
                    - kind
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - act
                    act:
                      type: string
                    role:
                      type: string
                  required:
                    - kind
                    - act
                    - role
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - unavailable
                    reason:
                      type: string
                  required:
                    - kind
                    - reason
            fields:
              type: object
              additionalProperties:
                oneOf:
                  - type: object
                    properties:
                      allowed:
                        type: boolean
                        enum:
                          - true
                      role:
                        type: string
                    required:
                      - allowed
                      - role
                  - type: object
                    properties:
                      allowed:
                        type: boolean
                        enum:
                          - false
                      reason:
                        type: string
                    required:
                      - allowed
                      - reason
          required:
            - releaseVersion
            - ordinary
            - actions
            - decline
            - fields
          description: >-
            Caller permissions on this submission’s release, provided by the
            detail read. The log checks each write.
        id:
          type: string
          format: uuid
        controlNumber:
          type: string
          nullable: true
          description: The sender’s reference; null when none was given.
        title:
          type: string
          minLength: 1
          description: The insured’s name as given, else a placeholder.
        status:
          type: string
          minLength: 1
          description: >-
            Extensible: `received` when created, then the desk’s statuses, such
            as `in_review`, `quoted` or `declined`.
        programId:
          type: string
          nullable: true
          description: The RSL program it is quoted on; null until set.
        releaseVersion:
          type: integer
          nullable: true
          minimum: 0
          exclusiveMinimum: true
          description: >-
            The release of its program it is on, fixed when it was made; null
            for a submission on no program, or made before submissions kept one.
        productId:
          type: string
          nullable: true
          format: uuid
          description: The catalog product its program is linked to; null when none is.
        agencyAccountId:
          type: string
          nullable: true
          format: uuid
        sender:
          type: object
          nullable: true
          properties:
            name:
              type: string
              nullable: true
            email:
              type: string
              nullable: true
          required:
            - name
            - email
          description: Who sent the request; null when nobody was named.
        source:
          type: string
          nullable: true
          description: >-
            Extensible: `api`, `email` or `web`. Null for submissions made
            before intake stored it, or made through the records routes.
        businessType:
          type: string
          nullable: true
        requestedEffectiveDate:
          type: string
          nullable: true
          format: date
          description: A calendar date, `YYYY-MM-DD`.
        requestedExpirationDate:
          type: string
          nullable: true
          format: date
          description: A calendar date, `YYYY-MM-DD`.
        neededBy:
          type: string
          nullable: true
          format: date
          description: A calendar date, `YYYY-MM-DD`.
        coverageAsked:
          type: string
          nullable: true
        targetPremium:
          type: number
          nullable: true
        message:
          type: string
          nullable: true
          description: The broker’s message, as sent.
        receivedAt:
          type: string
          nullable: true
          format: date-time
        underwriterIds:
          type: array
          items:
            type: string
        createdAt:
          type: string
          format: date-time
        createdBy:
          type: object
          properties:
            type:
              type: string
              enum:
                - user
                - system
            id:
              type: string
              minLength: 1
          required:
            - type
            - id
          description: A user, or `system` for email intake.
        latestExtraction:
          type: object
          nullable: true
          properties:
            id:
              type: string
              format: uuid
            status:
              type: string
              minLength: 1
              description: >-
                Extensible: `queued`, `running`, `completed`, `failed` or
                `cancelled`.
            createdAt:
              type: string
              format: date-time
            finishedAt:
              type: string
              nullable: true
              format: date-time
          required:
            - id
            - status
            - createdAt
            - finishedAt
          description: The latest extraction run on its documents; null before any.
        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 is missing and who has to act, blocking items first, from the
            latest completed extraction. Once the submission has a log, an input
            is listed only while the program still asks for it, and an answer
            that lapsed when its document was replaced is asked again. Empty
            before any extraction.
        next:
          type: string
          nullable: true
          enum:
            - broker
            - underwriter
            - system
            - null
          description: >-
            Who acts now: `system` while an extraction runs, else the first
            outstanding item’s, else null.
        rating:
          type: object
          nullable: true
          properties:
            status:
              type: string
              description: >-
                Extensible: `incomplete` (an input is still open), `ready` (it
                can be quoted), `referred` (a rule waits for a sign-off),
                `ineligible`, or a final `accepted`, `refused` or `ended`.
            outcomes:
              type: object
              additionalProperties:
                nullable: true
              description: >-
                What the program computes, by the outcome names its guideline
                declares, such as `premium`. Empty until the program has what it
                needs.
            seq:
              type: integer
              minimum: 0
              description: >-
                The log’s last entry this was read at. The log is
                `/rsl/{programId}/logs/{id}`.
          required:
            - status
            - outcomes
            - seq
          description: >-
            Where the submission stands on its program and what the program
            computes from its values, such as the premium, as its log’s status
            gives them. Null while it has no program or no value has been
            written yet.
        stage:
          type: string
          minLength: 1
          description: >-
            Extensible. Where the whole flow stands, the first that holds:
            `bound`, `declined` or `closed` once the log took its accept, refuse
            or end act; `extracting` while an extraction is queued or running;
            `needs_review` while a blocking item waits on the underwriter,
            `needs_info` while one waits on the broker; then from the log:
            `referred` (a rule waits for a sign-off), `ineligible` (a rule
            declines), `quoted` (an offer stands), `ready_to_quote`; `received`
            before any of these.
        quotes:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                minLength: 1
                description: The offer’s name in the log, such as `q1`.
              outcomes:
                type: object
                additionalProperties:
                  nullable: true
                description: >-
                  What the program computed when it was offered, such as
                  `premium`.
              stands:
                type: boolean
                description: >-
                  The submission’s values are still the ones offered. Only a
                  quote that stands is bound.
              accepted:
                type: boolean
                description: This is the quote that was bound.
              status:
                type: string
                nullable: true
                description: >-
                  Extensible: `ready`, `referred` (a rule that held it still
                  waits for a sign-off), `ineligible`, `accepted` or `ended`
                  (withdrawn). Null where the log does not say.
            required:
              - name
              - outcomes
              - stands
              - accepted
              - status
          description: >-
            Each quote given, as the log keeps it, oldest first. Empty before
            any.
        declines:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                minLength: 1
                description: The rule’s code, or the referral’s name.
              message:
                type: string
                description: Why, in the program’s words.
              path:
                type: string
                description: The input it reads.
            required:
              - code
              - message
              - path
          description: >-
            Each rule that declines the submission as it stands. Empty when none
            does.
        questions:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                minLength: 1
                description: An input’s path, or a referral’s name for a sign-off.
              kind:
                type: string
                minLength: 1
                description: >-
                  Extensible: `input` (a value is needed) or `signoff` (a role’s
                  warrant is needed).
              role:
                type: string
                nullable: true
                description: >-
                  The lowest program role that may answer it; null where any
                  role may.
              choices:
                nullable: true
                description: The values the input takes, where it lists them.
              because:
                type: string
                description: 'For a sign-off: why the submission is referred.'
              proposed:
                type: array
                items:
                  type: object
                  properties:
                    value:
                      nullable: true
                    status:
                      type: string
                      minLength: 1
                      description: The proposal’s status in the latest extraction.
                    quote:
                      type: string
                      description: The text it was read from.
                  required:
                    - status
                description: >-
                  What the latest completed extraction proposed for it and is
                  not yet ruled on: accept one with
                  `acceptUnderwritingSubmissionProposals`, or set another with
                  `setUnderwritingSubmissionValues`.
            required:
              - path
              - kind
              - role
              - proposed
          description: >-
            What the submission’s log asks now: each input it needs a value for,
            and each sign-off it waits on, with what the latest extraction
            proposed. Empty while it has no log.
        log:
          type: object
          nullable: true
          properties:
            programId:
              type: string
              minLength: 1
            seq:
              type: integer
              minimum: 0
              description: The log’s last entry, as this read saw it.
            href:
              type: string
              minLength: 1
              description: 'The log’s path on API v2: `/api/v2/rsl/{programId}/logs/{id}`.'
          required:
            - programId
            - seq
            - href
          description: >-
            The submission’s log on its program, which holds its values, quotes
            and decisions. Null until its first value is written.
        nextUrl:
          type: string
          nullable: true
          format: uri
          description: >-
            Where the person who acts next does so: the submission’s page while
            `next` is `underwriter`, else null.
        webUrl:
          type: string
          format: uri
          description: The submission’s page in Effective.
      required:
        - id
        - controlNumber
        - title
        - status
        - programId
        - releaseVersion
        - productId
        - agencyAccountId
        - sender
        - source
        - businessType
        - requestedEffectiveDate
        - requestedExpirationDate
        - neededBy
        - coverageAsked
        - targetPremium
        - message
        - receivedAt
        - underwriterIds
        - createdAt
        - createdBy
        - latestExtraction
        - outstanding
        - next
        - rating
        - stage
        - quotes
        - declines
        - questions
        - log
        - nextUrl
        - webUrl
    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.