# Re-scan a window for state transitions and backfill events (/docs/api-reference/downtime/DowntimeController_scan)

`POST /api/factories/{factoryId}/downtime/events/scan`

Base URL: https://api.xentr.ai

Authentication: bearer token (`Authorization: Bearer <token>`).

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `factoryId` | path | yes | string | Factory slug |

## Request body

Required.

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "from": {
      "type": "string",
      "example": "2026-04-22T00:00:00Z"
    },
    "to": {
      "type": "string",
      "example": "2026-04-23T00:00:00Z"
    },
    "machineId": {
      "type": "string",
      "description": "Limit to a single machine code; otherwise scans all machines in the factory."
    }
  },
  "required": [
    "from",
    "to"
  ]
}
```

## Responses

### 201