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

# Handles `POST /v1/cases/{id}/decision`.

> # Errors

Returns `401` without usable credentials, `403` when the caller is an
integration rather than a person or when their role may not override,
`404` for an unknown case, `409` when the case is already finished, `422`
when the conclusion carries no reason, and `500` when a store fails.



## OpenAPI

````yaml /openapi.json post /v1/cases/{case_id}/decision
openapi: 3.1.0
info:
  title: Esectra API
  description: >-
    Transaction screening, identity verification, and wallet risk.


    Every create route accepts `Idempotency-Key`; replaying one returns the
    original record with `200` where the first call returned `201`. `POST
    /v1/transactions` requires the header, because a duplicated transaction is a
    duplicated financial record.
  license:
    name: proprietary
    identifier: proprietary
  version: 0.1.0
servers:
  - url: https://qa.esectra.com
    description: Esectra QA Documentation
security: []
paths:
  /v1/cases/{case_id}/decision:
    post:
      tags:
        - Cases
      summary: Handles `POST /v1/cases/{id}/decision`.
      description: >-
        # Errors


        Returns `401` without usable credentials, `403` when the caller is an

        integration rather than a person or when their role may not override,

        `404` for an unknown case, `409` when the case is already finished,
        `422`

        when the conclusion carries no reason, and `500` when a store fails.
      operationId: decide_case_handler
      parameters:
        - name: case_id
          in: path
          description: Case identifier
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CaseDecisionRequestBody'
        required: true
      responses:
        '200':
          description: The resolved case
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CaseDecisionResponseBody'
        '401':
          description: No usable credentials
        '403':
          description: An API key, or a role that may not override
        '404':
          description: No such case in this tenant
        '409':
          description: The case is already resolved
        '422':
          description: The conclusion carries no reason
        '503':
          description: A backing store could not be reached
      security:
        - session_cookie: []
components:
  schemas:
    CaseDecisionRequestBody:
      type: object
      description: Case decision request body.
      required:
        - status
        - disposition
        - reason
      properties:
        disposition:
          $ref: '#/components/schemas/CaseDisposition'
          description: What the reviewer concluded.
        note:
          type: string
          description: Optional note for the case timeline.
        override_decision:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/OverrideBody'
              description: >-
                The override to apply, when the reviewer is replacing the
                decision.
        reason:
          type: string
          description: Why.
        status:
          $ref: '#/components/schemas/CaseStatus'
          description: Status the case moves to.
    CaseDecisionResponseBody:
      type: object
      description: Case decision response body.
      required:
        - case
      properties:
        case:
          $ref: '#/components/schemas/CaseBody'
          description: The updated case.
        superseding_decision:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/DecisionRecord'
              description: >-
                The superseding decision, when the reviewer overrode the
                original.
    CaseDisposition:
      type: string
      description: What a reviewer concluded.
      enum:
        - CONFIRMED_RISK
        - FALSE_POSITIVE
        - ACCEPTED_RISK
        - INSUFFICIENT_EVIDENCE
        - CUSTOMER_EXPLAINED
        - ESCALATED
        - OTHER
    OverrideBody:
      type: object
      description: The override a reviewer is applying, when they are applying one.
      required:
        - decision
      properties:
        decision:
          $ref: '#/components/schemas/Decision'
          description: The outcome the reviewer is putting in place of the original.
        risk_level:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/RiskLevel'
              description: Revised risk level, when the reviewer revises it.
    CaseStatus:
      type: string
      description: >-
        Lifecycle status of a review case.


        A case moves forward: it is opened, picked up, and resolved. It never

        silently reopens, because a reopened case would make the audit trail
        read

        as though the first resolution had not happened.
      enum:
        - OPEN
        - IN_REVIEW
        - APPROVED
        - REJECTED
        - ESCALATED
        - CLOSED
    CaseBody:
      type: object
      description: A case as returned to a customer.
      required:
        - case_id
        - case_type
        - subject_id
        - decision_id
        - queue
        - severity
        - status
        - notes
        - created_at
        - updated_at
      properties:
        assignee:
          type:
            - string
            - 'null'
          description: Reviewer the case is assigned to.
        case_id:
          type: string
          description: Case identifier.
        case_type:
          $ref: '#/components/schemas/CaseType'
          description: Kind of subject under review.
        created_at:
          type: string
          description: RFC 3339 creation timestamp.
        decision_id:
          type: string
          description: Decision under review.
        disposition:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CaseDisposition'
              description: What the reviewer concluded.
        notes:
          type: array
          items:
            $ref: '#/components/schemas/CaseNote'
          description: Notes left while working the case.
        queue:
          type: string
          description: Queue the case belongs to.
        reviewer:
          type:
            - string
            - 'null'
          description: Reviewer who resolved it.
        severity:
          $ref: '#/components/schemas/RiskLevel'
          description: How severe the opening decision judged it.
        status:
          $ref: '#/components/schemas/CaseStatus'
          description: Lifecycle status.
        subject_id:
          type: string
          description: Subject the decision was about.
        updated_at:
          type: string
          description: RFC 3339 time of the last change.
    DecisionRecord:
      type: object
      description: Standard record that every Gorgon module must emit.
      required:
        - id
        - tenant_id
        - subject_type
        - subject_id
        - source_module
        - decision
        - risk_level
        - reasons
        - evidence
        - created_at
        - review_status
      properties:
        confidence:
          type:
            - number
            - 'null'
          format: float
          description: Confidence from rule, provider, model, or reviewer.
        created_at:
          type: string
          description: ISO-8601 creation timestamp.
        decision:
          $ref: '#/components/schemas/Decision'
          description: Decision outcome.
        evidence:
          type: array
          items:
            $ref: '#/components/schemas/EvidenceRef'
          description: Evidence references.
        id:
          type: string
          description: Unique decision identifier.
        model_version:
          type:
            - string
            - 'null'
          description: Model version, when a model is involved.
        policy_version:
          type:
            - string
            - 'null'
          description: Tenant policy version.
        reasons:
          type: array
          items:
            $ref: '#/components/schemas/DecisionReason'
          description: Explanation reasons.
        recommended_action:
          type:
            - string
            - 'null'
          description: Recommended downstream action.
        review_status:
          $ref: '#/components/schemas/ReviewStatus'
          description: Review lifecycle state.
        risk_level:
          $ref: '#/components/schemas/RiskLevel'
          description: Explainable risk level.
        rule_version:
          type:
            - string
            - 'null'
          description: Rule version, when deterministic rules are involved.
        source_module:
          $ref: '#/components/schemas/SourceModule'
          description: Product module that produced the decision.
        subject_id:
          type: string
          description: Internal or external subject identifier.
        subject_type:
          $ref: '#/components/schemas/SubjectType'
          description: Subject type.
        supersedes:
          type:
            - string
            - 'null'
          description: >-
            Decision this record supersedes, when a reviewer or an appeal
            replaced

            an earlier outcome.


            A superseded decision is never rewritten: the original stays exactly

            as it was given, and this field is how the newer record points back
            to

            it.
        tenant_id:
          $ref: '#/components/schemas/TenantId'
          description: Customer tenant.
    Decision:
      type: string
      description: Decision emitted by an automated or human-assisted workflow.
      enum:
        - ALLOW
        - WARN
        - BLOCK
        - HOLD
        - REVIEW_REQUIRED
        - FLAG
        - BLOCK_RECOMMENDED
        - SUSPEND
        - END_STREAM
    RiskLevel:
      type: string
      description: Explainable risk level.
      enum:
        - LOW
        - MEDIUM
        - HIGH
        - CRITICAL
    CaseType:
      type: string
      description: What kind of subject a case is about.
      enum:
        - IDENTITY
        - TRANSACTION
        - WALLET
        - CONTENT
        - OTHER
    CaseNote:
      type: object
      description: A note a reviewer left on a case.
      required:
        - id
        - author
        - body
        - created_at
      properties:
        author:
          type: string
          description: Who wrote it.
        body:
          type: string
          description: What they wrote.
        created_at:
          type: string
          description: RFC 3339 creation timestamp.
        id:
          type: string
          description: Note identifier.
    EvidenceRef:
      type: object
      description: >-
        Reference to retained evidence without embedding raw evidence in
        decisions.
      required:
        - id
        - kind
        - location
        - retention_policy
      properties:
        id:
          type: string
          description: Internal evidence identifier.
        kind:
          $ref: '#/components/schemas/EvidenceKind'
          description: Evidence type.
        location:
          type: string
          description: Storage URI or provider-specific object key.
        retention_policy:
          type: string
          description: Retention policy identifier applied to this evidence.
    DecisionReason:
      type: object
      description: Human-readable reason with a stable machine code.
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable reason code.
        message:
          type: string
          description: Explainable user/operator-facing message.
    ReviewStatus:
      type: string
      description: Human review lifecycle for a decision.
      enum:
        - PENDING
        - APPROVED
        - OVERTURNED
        - NOT_REQUIRED
    SourceModule:
      type: string
      description: Product module that produced a decision.
      enum:
        - VERIFY
        - SHIELD
        - SENTINEL
        - WATCH
    SubjectType:
      type: string
      description: Subject being evaluated.
      enum:
        - USER
        - CONTENT
        - STREAM
        - TRANSACTION
        - WALLET
        - BANK_ACCOUNT
        - REPORT
    TenantId:
      type: string
      description: Stable identifier for a customer tenant.
    EvidenceKind:
      type: string
      description: Kind of evidence captured for a decision or case.
      enum:
        - IMAGE
        - VIDEO
        - TEXT
        - DOCUMENT
        - METADATA
  securitySchemes:
    session_cookie:
      type: apiKey
      in: cookie
      name: esectra_session
      description: >-
        A signed-in reviewer's session. httpOnly and SameSite=Lax; set by `POST
        /v1/control/sessions` and only usable once the second factor is met.

````