---
title: "Trigger AI-powered Smart Fix for validation errors"
method: POST
path: "/roster-records/{rosterId}/smartfix"
tags: ["RosterRecord"]
---

# Trigger AI-powered Smart Fix for validation errors

`POST /roster-records/{rosterId}/smartfix`

Fetches all VALIDATION_FAILED rows (max 2000), extracts eligible validation errors, and calls the Smart Fix service to suggest corrections. Returns suggestions for the frontend to review and apply. Disabled when roster.smart-fix.enabled=false.

## Path parameters

- `rosterId` string, required

## Headers

- `tenant-id` string, required

## Response `200`

Smart Fix suggestions

- SmartFixTriggerResponse — Aggregated Smart Fix response returned to the frontend
  - `suggestions` EnrichedSuggestion[] — Per-error fix suggestions enriched with rowId
    - `fieldName` string — CSV column header
    - `currentValue` string — Original cell value
    - `mappedAttribute` string — System attribute name (e.g. dateOfBirth)
    - `errorCategory` string — Error category sent to Smart Fix
    - `suggestedValue` string — Corrected value, or null if unfixable
    - `confidence` string — high, medium, or low
    - `confidenceScore` number, double — Numeric confidence 0.0-1.0
    - `reasoning` string — Explanation of the correction
    - `status` string — auto_fixed, llm_suggested, or requires_human_review
    - `rowIndex` string — Spanner row_id (recordKey) for correlating back to RosterRowItem
  - `totalErrors` integer — Total validation errors sent to Smart Fix
  - `totalFixed` integer — Errors for which a suggested_value was returned
  - `totalSkipped` integer — Errors where no fix could be suggested
  - `totalRowsProcessed` integer — Number of VALIDATION_FAILED rows processed
  - `success` boolean — True if all Smart Fix batches succeeded
  - `batchErrors` string[] — Error messages from any failed batches

## Other responses

- `400` — Too many failed rows or no eligible errors
- `401` — Unauthorized - Authentication required
- `403` — Forbidden - Insufficient permissions
- `404` — Roster not found
- `503` — Smart Fix feature is disabled

---

[API](https://skmtc.net/certifyos/apis/certify-api-layer.md) · [All operations](https://skmtc.net/certifyos/apis/certify-api-layer/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/certifyos/certify-api-layer/revisions/3d27e9019c7b/schema)
