---
title: "Function Review"
method: POST
path: "/v3/functions/review"
tags: ["Function Accuracy"]
---

# Function Review

`POST /v3/functions/review`

**Estimate human review requirements for a function.**

Combines confusion-matrix metrics with the per-transformation evaluation
scores (confidence / hallucination / relevance produced by the eval service)
to compute:

- A confidence-bucketed distribution of the function's outputs.
- Sample-size estimates at configurable margin-of-error and confidence
levels (Wald or Wilson intervals).
- A precision-recall AUC and a per-threshold matrix you can use to
pick a review cutoff.

Supported for every function type that produces transformations and feeds
the auto-evaluation pipeline: `extract`, `transform`, `analyze`, `join`.
Extract works on both vision (PDF/PNG/JPEG/HEIC/HEIF/WebP) and OCR-routed
inputs.

Pass `isRegression: true` to scope the review to transformations created
by a previous regression run (see `POST /v3/functions/regression`).

## Request body

- FunctionReviewRequest — Request for estimating review requirements for a function
  - `functionName` string, required — Name of the function to analyze
  - `functionVersionNum` integer — Optional function version number to analyze. If not provided, uses the latest/current version of the function.
  - `evaluationVersion` '0.1.0-gemini' — Optional evaluation version to filter evaluations by. Must be one of the supported versions. If not provided, defaults to "0.1.0-gemini".
  - `marginOfError` number, float — Margin of error for statistical calculations
  - `thresholdMin` number, float — Minimum confidence threshold to analyze
  - `thresholdMax` number, float — Maximum confidence threshold to analyze
  - `thresholdStep` number, float — Step size for threshold analysis (smaller = more granular)
  - `confidenceLevels` integer[] — Confidence levels for statistical analysis as integers representing percentages (e.g., [90, 95, 99] for 90%, 95%, 99%). IMPORTANT: Only integers are accepted, floats like 0.95 will be rejected.
  - `confidenceMethod` 'wald' | 'wilson' — Confidence interval calculation method (default "wald"). - "wald": Normal approximation method (faster, standard) - "wilson": Wilson score interval (more robust for extreme rates)
  - `isRegression` boolean — Internal flag indicating if the request is from a regression test

## Response `200`

The request has succeeded.

- FunctionReviewResponse — Response containing review requirements estimate
  - `functionName` string, required — Name of the analyzed function
  - `functionVersionNum` integer, required — Version number of the function that was analyzed
  - `estimate` ReviewEstimate, required — Detailed review requirements estimate
    - `totalTransformations` integer, required — Total number of transformations analyzed
    - `labeledTransformations` integer, required — Number of transformations already labeled
    - `unlabeledTransformations` integer, required — Number of transformations not yet labeled
    - `missingEvaluations` integer, required — Number of transformations without evaluation data
    - `confidenceDistribution` object, required — Distribution of confidence levels
      - `high` integer
      - `medium` integer
      - `low` integer
    - `thresholdMatrix` ThresholdResult[], required — Statistical analysis across confidence thresholds
      - `threshold` number, float, required — Confidence threshold value
      - `accuracyAboveThreshold` object — Accuracy confidence intervals for samples above threshold, by confidence level. Keys are confidence levels as strings ("90", "95", "99"). Values contain statistical confidence intervals.
        - `95` RateConfidenceInterval — Confidence interval for a rate/proportion using Wald (normal approximation) method by default. Wald confidence intervals use the normal approximation to the binomial distribution. For extreme rates or small sample sizes, Wilson confidence intervals may be more appropriate.
          - `ciLower` number, float, nullable — Lower bound of the confidence interval (null if insufficient sample size)
          - `mid` number, float, nullable — Point estimate (observed rate) at the center of the interval (null if insufficient sample size)
          - `ciUpper` number, float, nullable — Upper bound of the confidence interval (null if insufficient sample size)
          - `currentSample` integer, required — Current number of samples/observations available
          - `sampleNeeded` integer, required — Minimum number of samples needed for reliable confidence interval calculation
      - `precision` object — Precision confidence intervals by confidence level. Keys are confidence levels as strings ("90", "95", "99"). Values contain statistical confidence intervals.
        - `95` RateConfidenceInterval — Confidence interval for a rate/proportion using Wald (normal approximation) method by default. Wald confidence intervals use the normal approximation to the binomial distribution. For extreme rates or small sample sizes, Wilson confidence intervals may be more appropriate.
          - `ciLower` number, float, nullable — Lower bound of the confidence interval (null if insufficient sample size)
          - `mid` number, float, nullable — Point estimate (observed rate) at the center of the interval (null if insufficient sample size)
          - `ciUpper` number, float, nullable — Upper bound of the confidence interval (null if insufficient sample size)
          - `currentSample` integer, required — Current number of samples/observations available
          - `sampleNeeded` integer, required — Minimum number of samples needed for reliable confidence interval calculation
      - `recall` object — Recall confidence intervals by confidence level. Keys are confidence levels as strings ("90", "95", "99"). Values contain statistical confidence intervals.
        - `95` RateConfidenceInterval — Confidence interval for a rate/proportion using Wald (normal approximation) method by default. Wald confidence intervals use the normal approximation to the binomial distribution. For extreme rates or small sample sizes, Wilson confidence intervals may be more appropriate.
          - `ciLower` number, float, nullable — Lower bound of the confidence interval (null if insufficient sample size)
          - `mid` number, float, nullable — Point estimate (observed rate) at the center of the interval (null if insufficient sample size)
          - `ciUpper` number, float, nullable — Upper bound of the confidence interval (null if insufficient sample size)
          - `currentSample` integer, required — Current number of samples/observations available
          - `sampleNeeded` integer, required — Minimum number of samples needed for reliable confidence interval calculation
      - `falsePositiveRate` object — False Positive Rate confidence intervals by confidence level. Keys are confidence levels as strings ("90", "95", "99"). Values contain statistical confidence intervals.
        - `95` RateConfidenceInterval — Confidence interval for a rate/proportion using Wald (normal approximation) method by default. Wald confidence intervals use the normal approximation to the binomial distribution. For extreme rates or small sample sizes, Wilson confidence intervals may be more appropriate.
          - `ciLower` number, float, nullable — Lower bound of the confidence interval (null if insufficient sample size)
          - `mid` number, float, nullable — Point estimate (observed rate) at the center of the interval (null if insufficient sample size)
          - `ciUpper` number, float, nullable — Upper bound of the confidence interval (null if insufficient sample size)
          - `currentSample` integer, required — Current number of samples/observations available
          - `sampleNeeded` integer, required — Minimum number of samples needed for reliable confidence interval calculation
      - `falseDiscoveryRate` object — False Discovery Rate confidence intervals by confidence level. Keys are confidence levels as strings ("90", "95", "99"). Values contain statistical confidence intervals.
        - `95` RateConfidenceInterval — Confidence interval for a rate/proportion using Wald (normal approximation) method by default. Wald confidence intervals use the normal approximation to the binomial distribution. For extreme rates or small sample sizes, Wilson confidence intervals may be more appropriate.
          - `ciLower` number, float, nullable — Lower bound of the confidence interval (null if insufficient sample size)
          - `mid` number, float, nullable — Point estimate (observed rate) at the center of the interval (null if insufficient sample size)
          - `ciUpper` number, float, nullable — Upper bound of the confidence interval (null if insufficient sample size)
          - `currentSample` integer, required — Current number of samples/observations available
          - `sampleNeeded` integer, required — Minimum number of samples needed for reliable confidence interval calculation
      - `tp` integer, required — True Positives
      - `fp` integer, required — False Positives
      - `fn` integer, required — False Negatives
      - `tn` integer, required — True Negatives
  - `metrics` MetricsDetails — Detailed performance metrics and analysis
    - `fieldMetrics` FieldMetrics[] — Enhanced field metrics with comprehensive analytics
      - `fieldPath` string, required — JSON path to the field
      - `metrics` Metrics — Comprehensive performance metrics
        - `accuracy` number, float, nullable — Overall accuracy
        - `precision` number, float, nullable — Precision (TP / (TP + FP))
        - `recall` number, float, nullable — Recall (TP / (TP + FN))
        - `f1Score` number, float, nullable — F1 Score (harmonic mean of precision and recall)
        - `tp` integer — True Positives
        - `fp` integer — False Positives
        - `tn` integer — True Negatives
        - `fn` integer — False Negatives
    - `precisionRecallAuc` number, float — Area Under the Precision-Recall Curve
    - `aggregateMetrics` Metrics — Comprehensive performance metrics
      - `accuracy` number, float, nullable — Overall accuracy
      - `precision` number, float, nullable — Precision (TP / (TP + FP))
      - `recall` number, float, nullable — Recall (TP / (TP + FN))
      - `f1Score` number, float, nullable — F1 Score (harmonic mean of precision and recall)
      - `tp` integer — True Positives
      - `fp` integer — False Positives
      - `tn` integer — True Negatives
      - `fn` integer — False Negatives

## Other responses

- `400` — The server could not understand the request due to invalid syntax.
- `500` — Server error

---

[API](https://skmtc.dev/bem-team/apis/bem-api.md) · [All operations](https://skmtc.dev/bem-team/apis/bem-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/bem-team/bem-api/revisions/a6e4624117c6/schema)
