---
title: "Receive a print event from Moonraker (Klipper)."
method: POST
path: "/api/Moonraker/notifier"
tags: ["Moonraker"]
---

# Receive a print event from Moonraker (Klipper).

`POST /api/Moonraker/notifier`

## Request

- Base URL: `https://api.3dprintlog.com`
- URL: `https://api.3dprintlog.com/api/Moonraker/notifier`
- Auth: one of:
  - OAuth 2 (authorization code, authorization URL `https://3dprintlog.auth0.com/authorize`, token URL `https://3dprintlog.auth0.com/oauth/token`)
  - API key in header `X-Api-Key`
  - API key in query parameter `api_key`

Called by Moonraker's notifier on a Klipper printer, not by hand. Set it up as described at
https://www.3dprintlog.com/docs/klipper, authenticating with a personal API key.
            
The body is Moonraker's JSON notification, whose `message` field carries the print event.
`started` creates a print in the Printing status. `complete` marks that print Success, and
`cancelled` or `error` mark it Failed.
            
When the printer also has a live printlog-bridge connection, the bridge logs the job and
these events are dropped (and counted on the connection), so each job is logged once.

## Request body

- PrintLogApiModelsDTOsMoonrakerPrintEventDto: The JSON notification Moonraker's notifier posts (an Apprise `json://` URL). Other fields Apprise sends, such as `title` and `type`, are ignored.
  - `message` string, nullable: The print event, as a JSON-encoded string rather than a nested object: a `PrintLogApi.Models.DTOs.Moonraker.PrintEventMessageDto` serialized to text, for example `{"event_name": "started", "filament_used": 0.0, "filename": "cube.gcode", "message": "", "print_duration": 0.0, "printerId": 7, "state": "printing", "total_duration": 0.0}`.

## Response `200`

Returned if the webhook was handled successfully, echoing the decoded event.

- PrintLogApiModelsDTOsMoonrakerPrintEventMessageDto: A print event from Moonraker's notifier. Sent JSON-encoded inside PrintLogApi.Models.DTOs.Moonraker.PrintEventDto.Message, and echoed back decoded in the response.
  - `event_name` string, nullable: `started`, `complete`, `cancelled` or `error`. Anything else (`paused`, `resumed`) is accepted and ignored.
  - `filament_used` number, double: The filament used so far, in millimeters.
  - `filename` string, nullable: The G-code file's path on the printer.
  - `message` string, nullable
  - `print_duration` number, double: Time spent actually printing, in seconds.
  - `printerId` integer: The id of one of the caller's printers.
  - `state` string, nullable: Klipper's print state, such as `printing`.
  - `total_duration` number, double: Total job time including pauses, in seconds.

## Other responses

- `400`: Returned if required data is missing in the webhook (like the printerId, etc).
- `401`: Returned if the user is not authenticated.
- `403`: Returned if the current user cannot access the printer specified.

---

[API](https://skmtc.dev/3dprintlog/apis/3d-print-log-api.md) · [All operations](https://skmtc.dev/3dprintlog/apis/3d-print-log-api/llms.txt) · [OpenAPI document](https://skmtc.dev/3dprintlog/apis/3d-print-log-api/revisions/dfc3a4df4e38?raw)
