Start Custom Ingredient Pin Drift Scan
Start a background scan that lists the organization's recipes still using an older version of this custom ingredient. The scan compares each recipe with the version that is current when it 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 on an older version: subject_ref holds the recipe id, name and status, pinned_version_id, current_version_id, and label_affecting with the changed label_affecting_fields. 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 on the current version gives no item. result counts the recipes scanned and behind. Any ingredient status can be scanned; the job fails with subject_not_found if the ingredient is deleted while it runs.
The recipe list comes from a near-real-time index, so a recipe saved seconds before the scan may not be counted yet. An organization runs at most 5 jobs at a time.
custom_ingredient_id*Custom Ingredient IdIdempotency-Key?|Any string you choose, up to 255 characters. Send the same key again for the same ingredient within 7 days to get back the scan it started, in whatever state it is now, instead of starting another. To run a new scan, send a new key.
The Idempotency-Key was already used for this ingredient: the job it started, in its current state.
application/json- response
Response for an endpoint that starts a job: the job, without items.
data*One job, without its items.
meta*Response metadata.
curl -X POST 'https://api.bettermenu.live/studio/custom-ingredients/string/pin-drift-scans'{ "data": { "id": "string", "kind": "custom_ingredient.pin_drift_scan", "subject": { "type": "custom_ingredient", "id": "string" }, "state": "queued", "stalled": true, "progress": { "total": 0, "done": 0, "failed": 0, "skipped": 0 }, "result": {}, "last_error": { "code": "string", "detail": "" }, "created_by": { "type": "string", "id": "string" }, "channel": "string", "created_at": "2019-08-24T14:15:22Z", "started_at": "2019-08-24T14:15:22Z", "heartbeat_at": "2019-08-24T14:15:22Z", "finished_at": "2019-08-24T14:15:22Z", "redrives": 0 }, "meta": { "version": "string", "request_id": "string", "timestamp": "string" }}