# Monitor https://api-docs.lumar.io/docs/graphql/monitor Monitor is Lumar's ongoing site health tracking feature. It works alongside Protect (builds and tests) to give you continuous visibility into how your site's metrics change over time. ## How Monitor works In the Monitor context, **projects** are the primary entity. You can list all monitor projects on an account using the `monitorProjects` field on `Account`, and retrieve a single project using `getProject`. Each project contains builds, tests, and monitoring configuration. :::note In Lumar's GraphQL schema, `Project` and `TestSuite` both implement the `BaseProject` interface and are effectively the same entity. The Monitor UI works with projects (`monitorProjects`, `getProject`), but some mutations still use `testSuiteId` as a parameter name. When a mutation requires a `testSuiteId`, pass your **project ID** -- they are interchangeable. ::: Monitor tracks the results of health score tests and Protect test results across builds. When a test fails or a health score degrades, Monitor surfaces those changes so you can take action -- either manually or through automated notifications via webhooks and email alerts. ## Querying test results Retrieve the latest build's test results for a project. Each test result shows whether the test passed, the measured value, and the configured threshold. ```graphql query GetTestResults($testSuiteId: ObjectID!) { node(id: $testSuiteId) { ... on TestSuite { id name builds(first: 1, orderBy: [{ field: createdAt, direction: DESC }]) { nodes { id status createdAt testResults(first: 10) { nodes { id passed reportTemplate { code name } absoluteThreshold reportTotalRows severity } totalCount } } } } } } ``` **Variables:** ```json { "testSuiteId": "TjAxMVRlc3RTdWl0ZTEyMw" } ``` **Response:** ```json { "data": { "node": { "id": "TjAxMVRlc3RTdWl0ZTEyMw", "name": "Production SEO Suite", "builds": { "nodes": [ { "id": "TjAxMkJ1aWxkNDU2", "status": "Finished", "createdAt": "2025-01-15T10:00:00.000Z", "testResults": { "nodes": [ { "id": "TjAxM1Rlc3RSZXN1bHQ3ODk", "passed": true, "reportTemplate": { "code": "broken_pages", "name": "Broken Pages" }, "absoluteThreshold": 5.0, "reportTotalRows": 2.0, "severity": "Fail" } ], "totalCount": 1 } } ] } } } } ``` ## Managing notification status Use `updateMonitorNotificationsStatus` to acknowledge or dismiss notifications for specific test results. This is useful when building custom notification workflows. ```graphql mutation UpdateMonitorNotificationsStatus($input: UpdateMonitorNotificationsStatusInput!) { updateMonitorNotificationsStatus(input: $input) { updatedTestResultsCount } } ``` **Variables:** ```json { "input": { "accountId": "TjAwN0FjY291bnQ3MTU", "testResultIds": ["TjAxM1Rlc3RSZXN1bHQ3ODk"] } } ``` **Response:** ```json { "data": { "updateMonitorNotificationsStatus": { "updatedTestResultsCount": 1 } } } ``` ## Setting up monitoring workflows A typical monitoring workflow involves: 1. **Create a project** with tests that define your acceptance criteria (see [Protect documentation](/docs/protect/test-suites/test-suites-overview.md)). 2. **Set up a build schedule** to run tests on a recurring cadence (e.g., weekly). 3. **Configure webhooks** to receive real-time alerts when tests fail (see [Webhooks](webhooks)). 4. **Query test results** programmatically to feed data into your own dashboards or alerting systems. ## Webhook integration Monitor integrates with webhooks to push alerts when builds complete. You can configure: - **API callbacks** -- POST requests to your own endpoint with test result payloads. - **Slack webhooks** -- messages sent to a Slack channel. - **MS Teams webhooks** -- messages sent via Microsoft Teams connectors. See the [Webhooks guide](webhooks) for details on setting up webhook notifications, and the [webhook payload documentation](/docs/notifications/webhook-notifications.md) for the payload schema.