# Start Custom Ingredient Latest Version Scan

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

Start a background scan that lists the organization's recipes that are not on the latest version of this custom ingredient. The scan compares the version each recipe uses now with the version that is current when the scan starts, and changes no recipe, ingredient or label.

Returns the job at once (`queued`). Read it with `getJob` until its state is `succeeded`, `partially_succeeded` or `failed`. A `succeeded` item is one recipe that is not on the latest version: `subject_ref` holds the recipe id, name and status, `pinned_version_id`, `current_version_id`, and `label_affecting_fields`. `label_affecting` is true when a field that may change a label differs. It does not mean the recipe's label changes, because that depends on the amount used. `label_affecting_fields_known: false` means the older version could not be read, so a person should check the recipe. A `skipped` item gives its reason in `detail`, for example `pinned_newer_than_scan` for a recipe moved to a version made after the scan started. A recipe already on the latest version gives no item.

`result` has `as_of`, the moment the scan started, and the counts `recipes_scanned`, `recipes_behind`, `recipes_behind_label_affecting` and `recipes_behind_unreadable`. `recipes_behind` at 0 means every active recipe is on the latest version. Any ingredient status can be scanned. The job fails with `subject_not_found` if the ingredient is deleted while it runs.

The scan covers each active recipe as it is now, read from a near-real-time index, so a recipe saved a moment ago may not be counted yet. An archived or deleted recipe is not scanned, and an archived recipe that is unarchived while still on an older version appears in the next scan. It does not look at earlier versions of a recipe, so it cannot say whether a label that was already issued needs reissuing. It scans one ingredient at a time and does not run by itself when a new version is confirmed. An organization runs at most 5 jobs at a time.
