{
 "openapi": "3.1.0",
 "info": {
  "title": "Risk Signals (Accounting)",
  "version": "20261030b",
  "description": "A scored observation with its EVIDENCE attached. \"Score 0.86\" persuades nobody; the facts that produced it are what a person acts on."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "risk-signals": {
    "type": "object",
    "required": [],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "detector_id": {
      "type": "string",
      "format": "uuid",
      "description": "Detector id",
      "readOnly": true
     },
     "detector_code": {
      "type": "string",
      "description": "Detector code",
      "readOnly": true
     },
     "signal_no": {
      "type": "string",
      "description": "Signal no",
      "readOnly": true
     },
     "detected_at": {
      "type": "string",
      "format": "date-time",
      "description": "Detected at",
      "readOnly": true
     },
     "subject_type": {
      "type": "string",
      "description": "Subject type",
      "readOnly": true
     },
     "subject_id": {
      "type": "string",
      "format": "uuid",
      "description": "Subject id",
      "readOnly": true
     },
     "document_type": {
      "type": "string",
      "description": "Document type",
      "readOnly": true
     },
     "document_id": {
      "type": "string",
      "format": "uuid",
      "description": "Document id",
      "readOnly": true
     },
     "document_no": {
      "type": "string",
      "description": "Document no",
      "readOnly": true
     },
     "document_date": {
      "type": "string",
      "format": "date",
      "description": "Document date",
      "readOnly": true
     },
     "amount": {
      "type": "string",
      "format": "decimal",
      "description": "Amount",
      "readOnly": true
     },
     "currency": {
      "type": "string",
      "description": "Currency",
      "readOnly": true
     },
     "supplier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Supplier id",
      "readOnly": true
     },
     "account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Account id",
      "readOnly": true
     },
     "employee_id": {
      "type": "string",
      "format": "uuid",
      "description": "Employee id",
      "readOnly": true
     },
     "user_id": {
      "type": "string",
      "format": "uuid",
      "description": "User id",
      "readOnly": true
     },
     "score": {
      "type": "string",
      "format": "decimal",
      "description": "Score",
      "readOnly": true
     },
     "severity": {
      "type": "string",
      "description": "Severity",
      "readOnly": true
     },
     "title": {
      "type": "string",
      "description": "Title",
      "readOnly": true
     },
     "explanation": {
      "type": "string",
      "description": "Explanation",
      "readOnly": true
     },
     "evidence": {
      "type": "object",
      "description": "Evidence",
      "readOnly": true
     },
     "observed_value": {
      "type": "string",
      "format": "decimal",
      "description": "Observed value",
      "readOnly": true
     },
     "expected_value": {
      "type": "string",
      "format": "decimal",
      "description": "Expected value",
      "readOnly": true
     },
     "deviation_sigma": {
      "type": "string",
      "format": "decimal",
      "description": "Deviation sigma",
      "readOnly": true
     },
     "related": {
      "type": "object",
      "description": "Related",
      "readOnly": true
     },
     "suggested_action": {
      "type": "string",
      "description": "Suggested action",
      "readOnly": true
     },
     "action_taken": {
      "type": "string",
      "description": "Action taken",
      "readOnly": true
     },
     "blocked_posting": {
      "type": "boolean",
      "description": "Blocked posting",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status"
     },
     "case_id": {
      "type": "string",
      "format": "uuid",
      "description": "Case id",
      "readOnly": true
     },
     "fingerprint": {
      "type": "string",
      "description": "Fingerprint",
      "readOnly": true
     },
     "occurrence_count": {
      "type": "integer",
      "description": "Occurrence count",
      "readOnly": true
     },
     "last_seen_at": {
      "type": "string",
      "format": "date-time",
      "description": "Last seen at",
      "readOnly": true
     },
     "model_version": {
      "type": "string",
      "description": "Model version",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/accounting/risk-signals": {
   "get": {
    "summary": "list risk-signals",
    "operationId": "list_risk_signals_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create risk-signals",
    "operationId": "create_risk_signals_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/risk-signals/{id}": {
   "get": {
    "summary": "get risk-signals",
    "operationId": "get_risk_signals_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change risk-signals",
    "operationId": "change_risk_signals_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete risk-signals",
    "operationId": "delete_risk_signals_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/risk-signals/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_risk_signals_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}