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

# GET /operator/{did}/machines

> List all machines registered under an operator DID, with paginated MCR scores.

## Endpoint

```http theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
GET /operator/{did}/machines
```

Returns a paginated list of machines registered under an operator DID, with a full MCR score for each machine. The MCR score is computed from the machine's full event history (not bond-only). Machines that are not registered in the IdentityRegistry contract are silently excluded.

The server reads the operator's `machines` DID attribute, truncates the list to the first 100 entries as a defensive bound, then paginates over that window. Operators with more than 100 registered machines surface only the first 100 here. Query the IdentityRegistry contract directly to enumerate the full set.

## Path parameters

<ParamField path="did" type="string" required default="did:peaq:0x19E7E376E7C213B7E7e7e46cc70A5dD086DAff2A">
  Operator DID (`did:peaq:0x...`) or raw EVM address (`0x...`)
</ParamField>

## Query parameters

<ParamField query="offset" type="integer" default="0">
  Number of machines to skip before the returned page. Must be `>= 0`.
</ParamField>

<ParamField query="limit" type="integer" default="20">
  Maximum number of machines to return per page. Range `1-20`.
</ParamField>

## Response

**200 OK**

| Field                      | Type    | Description                                                                                                                                                                                                                                           |
| :------------------------- | :------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `operator_did`             | string  | The operator DID as supplied in the request path                                                                                                                                                                                                      |
| `machines`                 | array   | List of machines registered to this operator (for the current page)                                                                                                                                                                                   |
| `machines[].did`           | string  | Machine DID derived from the machine wallet address (`did:peaq:<machine_wallet>`)                                                                                                                                                                     |
| `machines[].machine_id`    | integer | On-chain machine ID                                                                                                                                                                                                                                   |
| `machines[].mcr_score`     | integer | MCR score 0-100                                                                                                                                                                                                                                       |
| `machines[].mcr`           | string  | Letter rating: `AAA`, `AA`, `A`, `BBB`, `BB`, `B`, `NR`, or `Provisioned`                                                                                                                                                                             |
| `machines[].negative_flag` | boolean | `true` when the AdminFlags contract has a negative-flag timestamp set for this machine. Stays `true` regardless of whether the 180-day MCR scoring penalty is still active.                                                                           |
| `pagination`               | object  | Pagination metadata                                                                                                                                                                                                                                   |
| `pagination.offset`        | integer | The offset used for this page                                                                                                                                                                                                                         |
| `pagination.limit`         | integer | The limit used for this page                                                                                                                                                                                                                          |
| `pagination.total`         | integer | Number of valid machine IDs in the operator's `machines` DID attribute, after the 100-entry cap and integer validation but before registration filtering. Page slices may be smaller than `limit` because unregistered machines are dropped silently. |

An operator with no machines returns `200` with an empty `machines` array and `pagination.total` of `0`.

## Error responses

| Status | `detail`                            | Condition                                             |
| :----- | :---------------------------------- | :---------------------------------------------------- |
| 400    | `"Empty DID"`                       | Path parameter resolves to an empty string            |
| 400    | `"Invalid Ethereum address format"` | DID or address does not match the expected hex format |
| 422    | (FastAPI validation error)          | `offset` or `limit` fails validation constraints      |
| 503    | `"Service not initialised"`         | Server started without contract addresses             |
| 503    | `"Chain unavailable"`               | Any chain or DID call failed                          |

## Example

<CodeGroup>
  ```bash bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
  curl "${PEAQOS_MCR_API_URL}/operator/did:peaq:0xoperator0000000000000000000000000000001/machines?offset=0&limit=10"
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
  const response = await fetch(
    `${PEAQOS_MCR_API_URL}/operator/did:peaq:0xoperator0000000000000000000000000000001/machines?offset=0&limit=10`
  );
  const data = await response.json();
  console.log(data.machines.length, data.pagination.total);
  ```

  ```python Python theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
  import requests

  response = requests.get(
      f"{PEAQOS_MCR_API_URL}/operator/did:peaq:0xoperator0000000000000000000000000000001/machines",
      params={"offset": 0, "limit": 10},
  )
  data = response.json()
  print(len(data["machines"]), data["pagination"]["total"])
  ```
</CodeGroup>

**Response**

```json theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
{
  "operator_did": "did:peaq:0xoperator0000000000000000000000000000001",
  "machines": [
    {
      "did": "did:peaq:0xabc1230000000000000000000000000000000001",
      "machine_id": 1,
      "mcr_score": 45,
      "mcr": "BB",
      "negative_flag": false
    },
    {
      "did": "did:peaq:0xdef4560000000000000000000000000000000002",
      "machine_id": 2,
      "mcr_score": 0,
      "mcr": "NR",
      "negative_flag": false
    }
  ],
  "pagination": {
    "offset": 0,
    "limit": 10,
    "total": 2
  }
}
```

## Related endpoints

* [GET /mcr/{did}](/peaqos/api-reference/get-mcr) returns detailed MCR data for a single machine, including revenue trend and summary.
* [GET /machine/{did}](/peaqos/api-reference/get-machine) returns the full machine profile with data visibility-dependent fields.
