# List how each machine's stops can be classified (https://docs.pulsarml.com/v1/api-reference/stops/get-stops-classification-options)

**Required scope:** `stop_catalogs.read`.

List, per machine, the classifications `PUT /v1/stops/classifications` accepts for its stops:

* `generalCauses`: the general causes of the machine's loss tree, each with the
  `specificCauses` that can go under it.
* `components`: the components assigned to the machine.

A machine without a loss tree has no general causes; its stops can only be given a
`description`. Narrow the list with `machineId`, repeated for several machines:

```
GET /v1/stops/classification-options?machineId=12&machineId=13
```

## `GET /v1/stops/classification-options`

Base URLs:
- `https://draco.prod.pulsarml.com` — Production
- `https://draco.stage.pulsarml.com` — Sandbox (staging)

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

### Query parameters

- `machineId` (array of integer, optional, nullable) — Only these machines, as returned by `GET /v1/machines`. Repeat it for several machines (`machineId=12&machineId=13`). All of your machines when omitted.

### Responses

#### 200 — One entry per machine

Type: array of object

- `machineId` (integer, required, e.g. `12`) — The id of the machine, as returned by `GET /v1/machines`.
- `generalCauses` (array of object, required) — The general causes the machine's stops accept, from its loss tree. Empty when the machine has no loss tree, in which case its stops can only be classified with a `description`.
  - `id` (string (uuid), required, e.g. `"f89b5866-2d26-45a1-8cfc-8295557594d8"`) — The id of the option.
  - `name` (string, required, e.g. `"Bearing failure"`) — The name of the option.
  - `specificCauses` (array of object, required) — The specific causes that can go with this general cause on the machine. Empty when it takes none.
    - `id` (string (uuid), required, e.g. `"f89b5866-2d26-45a1-8cfc-8295557594d8"`) — The id of the option.
    - `name` (string, required, e.g. `"Bearing failure"`) — The name of the option.
- `components` (array of object, required) — The components that can be named on the machine's stops.
  - `id` (string (uuid), required, e.g. `"f89b5866-2d26-45a1-8cfc-8295557594d8"`) — The id of the option.
  - `name` (string, required, e.g. `"Bearing failure"`) — The name of the option.

#### 401 — * `unauthenticated`: The credentials are missing, invalid or expired.

#### 403 — * `missing_scope`: The credentials are valid but lack the scope this endpoint requires.

#### 422 — Validation Error

Type: object (`HTTPValidationError`)

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

#### 429 — * `rate_limited`: The API key exceeded its rate limit. Retry after `Retry-After` seconds.

### Example request

```bash
curl -X GET 'https://draco.prod.pulsarml.com/v1/stops/classification-options' \
  -H 'x-api-key: <YOUR_API_KEY>'
```