Source: https://spooly.eu/en/docs/api/printers

# Printers

All printers of your account and their print hours. They cannot be controlled.

## List printers

`GET /printers`

`state` is `online`, `offline` or `unknown`. `state` and `printing` come only with a reliable signal, otherwise `unknown` or null. Progress and remaining time exist only for Bambu Lab.

```bash
curl "https://spooly.eu/api/v1/printers" \
  -H "Authorization: Bearer $SPOOLY_KEY"
```

Response (200):

```
{
  "items": [
    {
      "printer_id": "e41b7c09a3d65f28b0c94e17d2a86f35",
      "name": "X1 Carbon von Tobi",
      "vendor": "bambulab",
      "model": "X1 Carbon",
      "state": "online",
      "printing": true,
      "progress_percent": 42,
      "remaining_minutes": 73
    }
  ]
}
```

## Correct print hours

`PUT /printers/{printer_id}/hours`

Sets the total hours to the number on the device. Due dates do not shift. Fewer hours than Spooly has recorded are not accepted.

Parameters:

- `printer_id` (Path): From `GET /printers` or `GET /maintenance`
- `total_hours` (Body): 0 to 1,000,000
- `Idempotency-Key` (Header, optional): 1 to 128 visible ASCII characters. [Idempotency-Key](https://spooly.eu/en/docs/api#api-idempotenz)

```bash
curl -X PUT "https://spooly.eu/api/v1/printers/e41b7c09a3d65f28b0c94e17d2a86f35/hours" \
  -H "Authorization: Bearer $SPOOLY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"total_hours":830}'
```

Response (200):

```
{
  "change_id": 381,
  "spool": null,
  "slot": null,
  "old_grams": null,
  "new_grams": null,
  "replayed": false,
  "task": null,
  "printer": {
    "printer_id": "e41b7c09a3d65f28b0c94e17d2a86f35",
    "printer": "X1 Carbon von Tobi",
    "hours": 830,
    "prints": 640,
    "filament_kg": 41.3,
    "due_count": 1,
    "soon_count": 2,
    "health_score": 84,
    "hours_confirmed": true
  },
  "stock_empty": null,
  "summary": "Druckstunden von 812,5 auf 830 h korrigiert"
}
```
