# Stops report (https://docs.pulsarml.com/v1/api-reference/reports/post-reports-stops)

Return individual machine stops with their duration, cause and classification.

This is the drill-down behind the downtime totals in the metrics report. `stopId` accepts
the full comparison grammar, so a specific stop or a range of them can be pulled directly.

## `POST /v1/reports/stops`

Base URLs:
- `https://draco.prod.pulsarml.com` — Production
- `https://draco.dev.pulsarml.com` — Development (sandbox)

Authentication: send your API key in the `x-api-key` header.

### Request body (`application/json`, required)

Type: object (`GetStopsReportRequestV1`)

- `page` (integer, optional, default `1`, > 0, e.g. `1`) — The page number for pagination
- `limit` (integer, optional, default `10`, > 0, e.g. `10`) — The number of items per page for pagination
- `machines` (object, optional, nullable) — Filter criteria for machines
  - `search` (string, optional, nullable) — Search term for Machines
  - `include` (array of integer, optional, nullable) — Items to include by id
  - `exclude` (array of integer, optional, nullable) — Items to exclude by id
- `stopId` (object, optional, nullable) — Filter criteria for machines
  - `include` (array of integer, optional, nullable) — Items to include by id
  - `exclude` (array of integer, optional, nullable) — Items to exclude by id
  - `greaterThan` (number, optional, nullable, e.g. `1`) — Greater than value
  - `greaterThanOrEqual` (number, optional, nullable, e.g. `1`) — Greater than or equal to value
  - `lessThan` (number, optional, nullable, e.g. `1`) — Less than value
  - `lessThanOrEqual` (number, optional, nullable, e.g. `1`) — Less than or equal to value
  - `equal` (number, optional, nullable, e.g. `1`) — Equal value
  - `notEqual` (number, optional, nullable, e.g. `1`) — Not equal value
- `startDate` (object, optional, nullable) — Filter criteria for start date
  - `after` (string (date-time), optional, nullable) — Filter by after date
  - `before` (string (date-time), optional, nullable) — Filter by before date
  - `between` (object, optional, nullable) — Filter by date range
    - `start` (string (date-time), optional, nullable, e.g. `"2024-01-01T00:00:00.000Z"`) — Start date of the range
    - `end` (string (date-time), optional, nullable, e.g. `"2024-01-31T23:59:59.000Z"`) — End date of the range
  - `equal` (string (date-time), optional, nullable) — Filter by equal date
- `endDate` (object, optional, nullable) — Filter criteria for end date
  - `after` (string (date-time), optional, nullable) — Filter by after date
  - `before` (string (date-time), optional, nullable) — Filter by before date
  - `between` (object, optional, nullable) — Filter by date range
    - `start` (string (date-time), optional, nullable, e.g. `"2024-01-01T00:00:00.000Z"`) — Start date of the range
    - `end` (string (date-time), optional, nullable, e.g. `"2024-01-31T23:59:59.000Z"`) — End date of the range
  - `equal` (string (date-time), optional, nullable) — Filter by equal date

### Responses

#### 200 — A page of stops with their cause and classification

Type: object (`GetStopsReportResponseV1`)

- `totalCount` (integer, optional, default `100`) — The total count of items
- `totalPages` (integer, optional, default `10`) — The total number of pages
- `currentPage` (integer, optional, default `1`) — The current page
- `stops` (array of object, required)
  - `classification` (object, required) — The classification of the stop.
    - `id` (integer, required, nullable, e.g. `"9ce2c6b4-a1f4-4bf2-b5c8-10436d1018cc"`) — The unique identifier of the classification.
    - `createdAt` (string (date-time), required, nullable, e.g. `"2025-11-01T00:00:00"`) — Timestamp of classification creation.
    - `updatedAt` (string (date-time), required, nullable, e.g. `"2025-11-01T00:00:00"`) — Timestamp of last classification update.
    - `component` (object, required) — The component associated with the stop.
      - `id` (string (uuid), optional, nullable, e.g. `"51d34e1b-a294-4246-8c86-4f9acfe94367"`) — The unique identifier.
      - `name` (string, optional, nullable, e.g. `"a simple cause"`) — The name of the cause/component.
    - `specificCause` (object, required) — The specific cause of the stop.
      - `id` (string (uuid), optional, nullable, e.g. `"51d34e1b-a294-4246-8c86-4f9acfe94367"`) — The unique identifier.
      - `name` (string, optional, nullable, e.g. `"a simple cause"`) — The name of the cause/component.
    - `generalCause` (object, required) — The general cause of the stop.
      - `id` (string (uuid), optional, nullable, e.g. `"51d34e1b-a294-4246-8c86-4f9acfe94367"`) — The unique identifier.
      - `name` (string, optional, nullable, e.g. `"a simple cause"`) — The name of the cause/component.
    - `description` (string, optional, nullable, e.g. `"a simple description"`) — A description of the classification.
  - `company` (object, required) — The company associated with the stop.
    - `id` (integer, required, e.g. `1`) — The unique identifier for the company.
    - `name` (string, required, e.g. `"company 1"`) — The name of the company.
  - `machine` (object, required) — The machine of the stop.
    - `id` (integer, required, e.g. `1`) — The unique identifier for the machine.
    - `name` (string, required, e.g. `"machine 1"`) — The name of the machine.
  - `shift` (object, required) — The shift of the stop.
    - `id` (integer, required, e.g. `1`) — The unique identifier of the shift.
    - `name` (string, required, e.g. `"shift 1"`) — The name of the shift.
    - `startTime` (string (date-time), required, e.g. `"2024-01-01T08:00:00.000Z"`) — The start time of the shift.
    - `endTime` (string (date-time), required, e.g. `"2024-01-01T16:00:00.000Z"`) — The end time of the shift.
    - `isActive` (boolean, required, e.g. `true`) — Whether the shift is currently active.
  - `stop` (object, required) — Information about the stop event.
    - `id` (integer, required, e.g. `1`) — The unique identifier of the stop event.
    - `startTime` (string (date-time), required, e.g. `"2025-11-01T00:00:00"`) — The start time of the stop.
    - `endTime` (string (date-time), required, nullable, e.g. `"2025-11-01T00:00:00"`) — The end time of the stop.
    - `isProgrammed` (boolean, required, e.g. `true`) — Indicates if the stop was programmed.
    - `isIncludedInAvailability` (boolean, required, e.g. `true`) — Indicates if the stop affects availability calculation.
    - `isIncludedInStops` (boolean, required, e.g. `true`) — Indicates if the stop is counted as a production stop.
    - `isManual` (boolean, required, e.g. `true`) — Indicates if the stop was manually logged.
    - `createdAt` (string (date-time), required, nullable, e.g. `"2025-11-01T00:00:00"`) — Timestamp of stop record creation.
    - `updatedAt` (string (date-time), required, nullable, e.g. `"2025-11-01T00:00:00"`) — Timestamp of last stop record update.
    - `deletedAt` (string (date-time), optional, nullable, e.g. `"2025-11-01T00:00:00"`) — Timestamp of stop record deletion, if applicable.
    - `durationInMinutes` (number, required, e.g. `30`) — The duration of the stop in minutes.

#### 422 — Validation Error

Type: object (`HTTPValidationError`)

- `detail` (array of object, optional)
  - `loc` (array of string | integer, required)
  - `msg` (string, required)
  - `type` (string, required)

### Example request

```bash
curl -X POST 'https://draco.prod.pulsarml.com/v1/reports/stops' \
  -H 'x-api-key: <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
    "page": 1,
    "limit": 10,
    "machines": {
      "exclude": [
        1
      ],
      "include": [
        1
      ],
      "search": "machine 1"
    },
    "stopId": {
      "equal": 1,
      "exclude": [
        1
      ],
      "greaterThan": 1,
      "greaterThanOrEqual": 1,
      "include": [
        1
      ],
      "lessThan": 1,
      "lessThanOrEqual": 1,
      "notEqual": 1
    }
  }'
```