> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Run sweeps

> Run both engine sweeps — stock holds (inventory reservations + backorder allocations) and traceability (lot expiry, lot and serial reservations) — once, right…

> [!WARNING]
>
> **Confirm your deployment before running this request.** This page describes an API contract;
> a published reference does not establish hosted availability. Check the dated
> [host report](/api-reference/hosts) and obtain your deployment URL and credentials.
> Replace the example host if your provisioned service uses a different URL.

Run both engine sweeps — stock holds (inventory reservations + backorder
allocations) and traceability (lot expiry, lot and serial reservations) —
once, right now, and report what each reclaimed. The same jobs run on the
server's background scheduler; this is the operator's manual trigger.

### Request body

No request body.

### Response

`SweepRunReport`

**sweeps** `SweepJobReport[]` *required*

One entry per sweep, in the order they ran.

**SweepJobReport**

**job** `string` *required*

The registered job name.

**message** `string` *required*

Human-readable summary from the job handler.

**ok** `boolean` *required*

Whether the sweep succeeded.

**reclaimed** `object` *required*

Per-sweep counters (`inventory_reservations_expired`, `backorder_allocations_expired`, `lots_expired`, …).

### Status codes

| Code | Meaning |
| - | - |
| `200` | What each sweep reclaimed |
| `500` | The sweep runner could not start |

### Using this contract

Read the [source OpenAPI document](/spec/stateset-icommerce.json) for declared schemas and alternatives.
This page also includes documented corrections from the [spec overlays](https://github.com/stateset/docs/tree/main/spec/overlays).
Example IDs and values are illustrative; replace them with records from your workspace.

```bash cURL theme={null}
curl --silent --show-error --fail-with-body --request POST \
  --url 'https://api.stateset.com/api/v1/inventory/sweeps/run' \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

```json 200 theme={null}
{
  "sweeps": [
    {
      "job": "string",
      "message": "Two-person tent, green — replacement for damaged pole set.",
      "ok": true,
      "reclaimed": {}
    }
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.