# Monitors API Reference

Source: https://instatus.com/help/api/monitors

- [Monitors](https://instatus.com/help/api/monitors#get-monitors): Check the uptime of your websites, APIs, and services
- [Cron Monitors](https://instatus.com/help/api/monitors#cron-monitors): Monitor your scheduled jobs via HTTP pings

## Possible Values for fields

**Monitor Location**

| Value            | Description       |
| ---------------- | ----------------- |
| `US_EAST_1`      | N. Virginia       |
| `CA_CENTRAL_1`   | Canada (Montreal) |
| `EU_CENTRAL_1`   | Frankfurt         |
| `AP_NORTHEAST_1` | Tokyo             |

**Monitor Alert Types**

| Value             | Description           |
| ----------------- | --------------------- |
| `INCIDENT`        | Incident alert        |
| `EMAIL`           | Email alert           |
| `SMS`             | SMS alert             |
| `SLACK`           | Slack alert           |
| `DISCORD`         | Discord alert         |
| `MICROSOFT_TEAMS` | Microsoft Teams alert |
| `PHONE_CALL`      | Phone call alert      |
| `WEBHOOK`         | Webhook alert         |
| `GOOGLE_CHAT`     | Google Chat alert     |
| `WHATSAPP`        | WhatsApp alert        |

**Monitor Status**

| Value      | Description                       |
| ---------- | --------------------------------- |
| `UP`       | Monitor is running normally       |
| `DOWN`     | Monitor has failed                |
| `DEGRADED` | Monitor is experiencing issues    |
| `UNKNOWN`  | Monitor state can't be determined |

## Get Monitors

You can use this endpoint to find and navigate through a list of all the existing monitors.

**Endpoint:**

```bash
GET /:page_id/monitors
```

**Query Parameters**

| Parameter | Type     | Default Value | Description                                            |
| --------- | -------- | ------------- | ------------------------------------------------------ |
| `page`    | `number` | `1`           | The page number to fetch.                              |
| `limit`   | `number` | `100`         | The number of monitors per page.                       |
| `search`  | `string` | `null`        | Search term for filtering results.                     |
| `status`  | `enum`   | `null`        | Status filter _('UP', 'DOWN', 'UNKNOWN', 'DEGRADED')_. |

**Example request**

```bash
GET /1/monitors?limit=3&page=2&status=DOWN
```

**Example response**

```json
{
  "monitors": [{ "...": "monitor objects" }],
  "total": 10,
  "page": 3,
  "totalPages": 5,
  "limit": 2
}
```

## Create a Monitor

**Endpoint:**

```bash
POST /monitors
```

**Example request**

```json
{
  "pageId": "page123",
  "url": "https://example.com",
  "httpMethod": "GET",
  "body": null,
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer token"
  },
  "queryParams": {
    "search": "test",
    "limit": "10"
  },
  "basicAuth": {
    "username": "user",
    "password": "password"
  },
  "type": "HTTP",
  "assertions": [
    {
      "type": "STATUSCODE",
      "comparison": "EQUALS",
      "selector": null,
      "target": "200"
    }
  ],
  "alerts": ["alert-id-1", "alert-id-2"],
  "name": "Example Monitor",
  "locations": "US_EAST_1",
  "checksInterval": 300,
  "createComponent": true,
  "createMetric": true,
  "onFail": {
    "createIncident": true,
    "createOutageDuration": true,
    "publishIncident": true,
    "notifySubscribers": true
  },
  "onRecover": {
    "resolveIncident": true,
    "resolveOutageDuration": true,
    "publishIncident": true,
    "notifySubscribers": true
  }
}
```

**Example response**

```json
{
  "monitor": {
    "pageId": "page123",
    "url": "https://example.com",
    "httpMethod": "GET",
    "body": null,
    "headers": {
      "Content-Type": "application/json",
      "Authorization": "Bearer token"
    },
    "queryParams": {
      "search": "test",
      "limit": "10"
    },
    "basicAuth": {
      "username": "user",
      "password": "password"
    },
    "type": "HTTP",
    "assertions": [
      {
        "id": "assertion1",
        "type": "STATUSCODE",
        "comparison": "EQUALS",
        "selector": null,
        "target": "200"
      }
    ],
    "alerts": ["alert1", "alert2"],
    "name": "Example Monitor",
    "locations": "US_EAST_1",
    "checksInterval": 300,
    "createComponent": true,
    "createMetric": true,
    "onFail": {
      "createIncident": true,
      "createOutageDuration": true,
      "publishIncident": true,
      "notifySubscribers": true
    },
    "onRecover": {
      "resolveIncident": true,
      "resolveOutageDuration": true,
      "publishIncident": true,
      "notifySubscribers": true
    },
    "createdAt": "2023-08-08T12:00:00Z",
    "updatedAt": "2023-08-08T12:00:00Z"
  },
  "message": "Monitor created successfully"
}
```

## Update a Monitor

**Endpoint:**

```bash
PUT /monitors/:id
```

**Example request**

```json
{
  "url": "https://updated.com",
  "name": "Updated Monitor Name"
}
```

**Example response**

```json
{
  "monitor": {
    "pageId": "page123",
    "url": "https://updated.com",
    "httpMethod": "GET",
    "body": null,
    "headers": {
      "Content-Type": "application/json",
      "Authorization": "Bearer token"
    },
    "queryParams": {
      "search": "test",
      "limit": "10"
    },
    "basicAuth": {
      "username": "user",
      "password": "password"
    },
    "type": "HTTP",
    "assertions": [
      {
        "id": "assertion1",
        "type": "STATUSCODE",
        "comparison": "EQUALS",
        "selector": null,
        "value": "200"
      }
    ],
    "alerts": ["alert1", "alert2"],
    "name": "Updated Monitor Name",
    "locations": "US_EAST_1",
    "checksInterval": 300,
    "createComponent": true,
    "createMetric": true,
    "onFail": {
      "createIncident": true,
      "createOutageDuration": true,
      "publishIncident": true,
      "notifySubscribers": true
    },
    "onRecover": {
      "resolveIncident": true,
      "resolveOutageDuration": true,
      "publishIncident": true,
      "notifySubscribers": true
    },
    "createdAt": "2023-08-08T12:00:00Z",
    "updatedAt": "2023-08-08T12:00:00Z"
  },
  "message": "Monitor updated successfully"
}
```

## Delete a Monitor

**Endpoint:**

```bash
DELETE /monitors/:id
```

**Example request**

```bash
DELETE /monitors/monitor-id-1
```

**Example response**

```json
{
  "message": "Monitor deleted successfully."
}
```

## Get Monitor Logs

**Endpoint:**

```bash
GET /monitors/:id/logs
```

# Query Parameters

| Parameter              | Type                                    | Default Value   | Description                                                                             |
| ---------------------- | --------------------------------------- | --------------- | --------------------------------------------------------------------------------------- |
| `limit`                | `number`                                | 100             | The number of items per page. Cannot exceed 1000.                                       |
| `page`                 | `number`                                | 1               | The page number to retrieve.                                                            |
| `monitorId`            | `string`                                | -               | The ID of the monitor.                                                                  |
| `location`             | `string`                                | `null`          | The location of the monitor.                                                            |
| `createdAt`            | `string` \| `object` \| `number`        | `null`          | The creation date. Can be a string, a number, or an object with `gte` and `lte` fields. |
| `isSuccessful`         | `boolean`                               | `null`          | Whether the check was successful.                                                       |
| `isSSLCheck`           | `boolean`                               | `null`          | Whether the check is an SSL check.                                                      |
| `httpStatusCode`       | `string`                                | `null`          | The HTTP status code of the response.                                                   |
| `status`               | `('UP', 'DOWN', 'UNKNOWN', 'DEGRADED')` | `null`          | The status of the monitor.                                                              |
| `dnsTime`              | `string` \| `number` \| `object`        | `null`          | Time taken for DNS resolution.                                                          |
| `tcpTime`              | `string` \| `number` \| `object`        | `null`          | Time taken for TCP connection.                                                          |
| `tlsTime`              | `string` \| `number` \| `object`        | `null`          | Time taken for TLS handshake.                                                           |
| `firstByteTime`        | `string` \| `number` \| `object`        | `null`          | Time taken for the first byte to be received.                                           |
| `downloadTime`         | `string` \| `number` \| `object`        | `null`          | Time taken for the download.                                                            |
| `responseTime`         | `string` \| `number` \| `object`        | `null`          | Total response time.                                                                    |
| `performanceTime`      | `string` \| `number` \| `object`        | `null`          | Performance time.                                                                       |
| `accessabilityScore`   | `string` \| `number` \| `object`        | `null`          | Accessibility score.                                                                    |
| `seoScore`             | `string` \| `number` \| `object`        | `null`          | SEO score.                                                                              |
| `bestPracticesScore`   | `string` \| `number` \| `object`        | `null`          | Best practices score.                                                                   |
| `successfulAssertions` | `string` \| `number` \| `object`        | `null`          | Number of successful assertions.                                                        |
| `sort`                 | `string`                                | chronologically | Field to sort by.                                                                       |

**Example request**

```bash
GET /monitors/monitor-id-1/logs?limit=100&page=1
```

**Example response**

```json
{
  "monitorLogs": [
    // {monitor log object},
    // {monitor log object 2}
  ],
  "total": 478,
  "page": 1,
  "totalPages": 5,
  "limit": 100
}
```

## Run Monitor Check by ID

**Endpoint:**

```bash
GET /monitors/:id/run
```

**Query Parameters**

| Parameter      | Type                                                                              | Default Value | Description                                                       |
| -------------- | --------------------------------------------------------------------------------- | ------------- | ----------------------------------------------------------------- |
| `location`     | `'US_EAST_1', 'EU_CENTRAL_1', 'AP_NORTHEAST_1', 'AP_SOUTHEAST_2', 'CA_CENTRAL_1'` | -             | The location of the monitor. Must be one of the specified values. |
| `retry`        | `boolean`                                                                         | `false`       | Indicates whether the operation should be retried. Optional.      |
| `monitorLogId` | `string`                                                                          | `null`        | The unique identifier of the monitor log. Optional.               |

**Example request**

```bash
GET /monitors/monitor-id-1/run?monitorId=abc123&location=US_EAST_1&retry=true&monitorLogId=log456
```

**Example response**

```json
{
  "status": "success",
  "message": "Monitor check run successfully."
}
```

## Create Monitor Alert

**Endpoint:**

```bash
POST /monitor-alerts
```

**Example request**

```json
{
  "type": "EMAIL",
  "pageId": "page123",
  "recipient": "user@example.com",
  "recipientWorkspace": "workspace123",
  "whenFails": true,
  "whenRecovers": true,
  "whenDegrades": false,
  "whenSslExpires": true,
  "sslExpiresInDays": 30,
  "monitors": ["monitor1", "monitor2"],
  "metadata": "Additional information about the alert"
}
```

**Example response**

```json
{
  "monitor": {
    "id": "alert123",
    "siteId": "site123",
    "type": "EMAIL",
    "recipient": "user@example.com",
    "whenFails": true,
    "whenRecovers": true,
    "whenDegrades": false,
    "whenSslExpires": true,
    "sslExpiresInDays": 30,
    "monitors": [{ "id": "monitor1" }, { "id": "monitor2" }],
    "createdAt": "2023-08-08T12:00:00Z",
    "updatedAt": "2023-08-08T12:00:00Z",
    "metadata": "Additional information about the alert"
  },
  "message": "Monitor Alert created successfully"
}
```

## Update Monitor Alert

**Endpoint:**

```bash
PUT /monitor-alerts/:id
```

**Example request**

```json
{
  "type": "EMAIL",
  "monitors": ["monitor-1-id", "monitor-2-id", "monitor-3-id"]
}
```

**Example response**

```json
{
  "monitor": {
    "type": "EMAIL",
    "pageId": "page123",
    "recipient": "user@example.com",
    "recipientWorkspace": "workspace123",
    "whenFails": true,
    "whenRecovers": true,
    "whenDegrades": false,
    "whenSslExpires": true,
    "sslExpiresInDays": 30,
    "monitors": ["monitor-1-id", "monitor-2-id"],
    "metadata": "Additional information about the alert"
  },
  "message": "Monitor alert updated successfully."
}
```

## Get Monitor Alerts

**Endpoint:**

```bash
GET /:page_id/monitor-alerts
```

**Query Parameters**

| Parameter | Type     | Default Value | Description                   |
| --------- | -------- | ------------- | ----------------------------- |
| `limit`   | `number` | 100           | The number of items per page. |
| `page`    | `number` | 1             | The page number to retrieve.  |

**Example request**

```bash
GET /1/monitor-alerts?limit=2&page=3
```

**Example response**

```json
{
  "monitorAlerts": [
    {...monitor alert objects}
  ],
  "total": 27,
  "page": 3,
  "totalPages": 14,
  "limit": 2
}
```

## Delete Monitor Alert

**Endpoint:**

```bash
DELETE /monitor-alerts/:id
```

**Example request**

```bash
DELETE /monitor-alerts/alert-id-1
```

**Example response**

```json
{
  "message": "Monitor alert deleted successfully."
}
```

## Create Monitor Group

**Endpoint:**

```bash
POST /monitors-groups
```

**Example request**

```json
{
  "pageId": "page123",
  "name": "Example Name",
  "childId": "child456"
}
```

**Example response**

```json
{
  "monitor": {
    "id": "group123",
    "name": "Example Name",
    "siteId": "site123",
    "collapsed": false,
    "monitors": [{ "id": "monitor1" }, { "id": "monitor2" }],
    "groupId": "parentGroup123",
    "children": [
      { "id": "childGroup1", "name": "Child Group 1" },
      { "id": "childGroup2", "name": "Child Group 2" }
    ],
    "order": 1,
    "createdAt": "2023-08-08T12:00:00Z",
    "updatedAt": "2023-08-08T12:00:00Z",
    "parents": ["parent1", "parent2"],
    "componentId": "component123"
  },
  "message": "Monitor group created successfully."
}
```

## Update Monitor Group

**Endpoint:**

```bash
PUT /monitors-groups/:id
```

**Example request**

```json
{
  "name": "Updated Monitor Group Name"
}
```

**Example response**

```json
{
  "monitor": {
    "id": "group123",
    "name": "Updated Monitor Group Name",
    "siteId": "site123",
    "collapsed": true,
    "monitors": [{ "id": "monitor1" }, { "id": "monitor2" }],
    "groupId": "parentGroup123",
    "children": [
      { "id": "childGroup1", "name": "Child Group 1" },
      { "id": "childGroup2", "name": "Child Group 2" }
    ],
    "order": 1,
    "createdAt": "2023-08-08T12:00:00Z",
    "updatedAt": "2023-08-08T12:00:00Z",
    "parents": ["parent1", "parent2"],
    "componentId": "component123"
  },
  "message": "Monitor group updated successfully."
}
```

## Delete Monitor Group

**Endpoint:**

```bash
DELETE /monitors-groups/:id
```

**Example request**

```bash
DELETE /monitors-groups/group-id-1
```

**Example response**

```json
{
  "message": "Monitor group deleted successfully."
}
```

## Add Monitors to Group

**Endpoint:**

```bash
POST /monitors-groups/:id/monitors
```

**Example request**

```json
{
  "monitors": ["monitor1", "monitor2", "monitor3"]
}
```

**Example response**

```json
{
  "message": "Monitors added to the group successfully."
}
```

## Run Monitor Group Check

**Endpoint:**

```bash
GET /monitors-groups/:id/run
```

**Query Parameters**

| Parameter      | Type                                                                              | Default Value | Description                                                       |
| -------------- | --------------------------------------------------------------------------------- | ------------- | ----------------------------------------------------------------- |
| `location`     | `'US_EAST_1', 'EU_CENTRAL_1', 'AP_NORTHEAST_1', 'AP_SOUTHEAST_2', 'CA_CENTRAL_1'` | -             | The location of the monitor. Must be one of the specified values. |
| `retry`        | `boolean`                                                                         | `false`       | Indicates whether the operation should be retried. Optional.      |
| `monitorLogId` | `string`                                                                          | `null`        | The unique identifier of the monitor log. Optional.               |

**Example request**

```bash
GET /monitors-groups/group-id-1/run
```

**Example response**

```json
{
  "result": "OK",
  "monitorLogId": "monitor-log-id-1"
}
```

## Cron Monitors

Cron monitors track scheduled jobs via HTTP pings. For product setup and dashboard usage, see [Cron Monitoring](https://instatus.com/help/monitoring/cron).

### Possible values for fields

**Cron Monitor Status**

| Value      | Description                       |
| ---------- | --------------------------------- |
| `UP`       | Monitor is running normally       |
| `DOWN`     | Monitor has failed                |
| `DEGRADED` | Monitor is experiencing issues    |
| `UNKNOWN`  | Monitor state can't be determined |

**Cron Monitor State**

| Value    | Description                          |
| -------- | ------------------------------------ |
| `ACTIVE` | Monitor is actively checked          |
| `PAUSED` | Monitor checks are paused            |
| `MUTED`  | Monitor is muted (no notifications)  |

**Cron Monitor Log Status**

| Value     | Description                                      |
| --------- | ------------------------------------------------ |
| `SUCCESS` | Job completed successfully                       |
| `FAILURE` | Job explicitly reported a failure              |
| `MISSED`  | Job did not ping within the expected window      |
| `LATE`    | Job pinged after the period but within grace     |
| `STARTED` | Job reported that it started (execution timing)  |

**Period and grace**

Both `period` and `grace` are specified in **seconds**. `period` is how often the job should run; `grace` is extra time allowed before the monitor is marked down.

### Get Cron Monitors

**Endpoint:**

```bash
GET /:page_id/monitors/cron
```

**Query Parameters**

| Parameter | Type     | Default Value | Description                                            |
| --------- | -------- | ------------- | ------------------------------------------------------ |
| `limit`   | `number` | `100`         | The number of cron monitors per page. Maximum is 100.  |
| `page`    | `number` | `1`           | The page number.                                       |
| `search`  | `string` | `null`        | Search term for filtering results by name.             |
| `status`  | `enum`   | `null`        | Status filter _('UP', 'DOWN', 'UNKNOWN', 'DEGRADED')_. |

**Example request**

```bash
GET /page123/monitors/cron?limit=10&page=1&status=DOWN
```

**Example response**

```json
{
  "cronMonitors": [
    {
      "id": "cron-abc123",
      "name": "Daily backup",
      "slug": "my-page-x7k2m9n4p1q8w3e5",
      "period": 86400,
      "grace": 3600,
      "status": "UP",
      "state": "ACTIVE",
      "siteId": "page123",
      "order": 1,
      "groupId": null,
      "componentId": "component-id-1",
      "onFailCreateIncident": true,
      "onFailCreateOutageDuration": false,
      "onFailPublishIncident": true,
      "onFailNotifySubscribers": true,
      "onRecoverResolveIncident": true,
      "onRecoverResolveOutageDuration": false,
      "onRecoverPublishIncident": true,
      "onRecoverNotifySubscribers": true,
      "createTemplateId": null,
      "resolveTemplateId": null,
      "createdAt": "2024-01-15T08:00:00.000Z",
      "updatedAt": "2024-01-15T08:00:00.000Z"
    }
  ],
  "total": 1,
  "page": 1,
  "totalPages": 1,
  "limit": 10
}
```

### Create a Cron Monitor

**Endpoint:**

```bash
POST /monitors/cron
```

**Example request**

```json
{
  "pageId": "page123",
  "name": "Daily backup",
  "period": 86400,
  "grace": 3600,
  "alerts": ["alert-id-1", "alert-id-2"],
  "createComponent": true,
  "onFail": {
    "createIncident": true,
    "createOutageDuration": false,
    "publishIncident": true,
    "notifySubscribers": true
  },
  "onRecover": {
    "resolveIncident": true,
    "resolveOutageDuration": false,
    "publishIncident": true,
    "notifySubscribers": true
  }
}
```

**Example response**

```json
{
  "cronMonitor": {
    "id": "cron-abc123",
    "name": "Daily backup",
    "slug": "my-page-x7k2m9n4p1q8w3e5",
    "period": 86400,
    "grace": 3600,
    "status": "UP",
    "state": "ACTIVE",
    "siteId": "page123",
    "order": 1,
    "groupId": null,
    "componentId": "component-id-1",
    "onFailCreateIncident": true,
    "onFailCreateOutageDuration": false,
    "onFailPublishIncident": true,
    "onFailNotifySubscribers": true,
    "onRecoverResolveIncident": true,
    "onRecoverResolveOutageDuration": false,
    "onRecoverPublishIncident": true,
    "onRecoverNotifySubscribers": true,
    "createTemplateId": null,
    "resolveTemplateId": null,
    "createdAt": "2024-01-15T08:00:00.000Z",
    "updatedAt": "2024-01-15T08:00:00.000Z"
  },
  "message": "Cron monitor created successfully."
}
```

The response includes a `slug`. Use it to build ping URLs for your job. The first successful ping schedules the background check job.

### Update a Cron Monitor

**Endpoint:**

```bash
PUT /monitors/cron/:id
```

**Example request**

```json
{
  "name": "Daily backup (updated)",
  "period": 43200,
  "grace": 1800,
  "state": "PAUSED",
  "alerts": ["alert-id-1"],
  "onFail": {
    "notifySubscribers": false
  }
}
```

**Example response**

```json
{
  "cronMonitor": {
    "id": "cron-abc123",
    "name": "Daily backup (updated)",
    "slug": "my-page-x7k2m9n4p1q8w3e5",
    "period": 43200,
    "grace": 1800,
    "status": "UP",
    "state": "PAUSED",
    "siteId": "page123",
    "order": 1,
    "groupId": null,
    "componentId": "component-id-1",
    "onFailCreateIncident": true,
    "onFailCreateOutageDuration": false,
    "onFailPublishIncident": true,
    "onFailNotifySubscribers": false,
    "onRecoverResolveIncident": true,
    "onRecoverResolveOutageDuration": false,
    "onRecoverPublishIncident": true,
    "onRecoverNotifySubscribers": true,
    "createTemplateId": null,
    "resolveTemplateId": null,
    "alerts": [
      {
        "id": "alert-id-1",
        "type": "EMAIL",
        "recipient": "ops@example.com"
      }
    ],
    "createdAt": "2024-01-15T08:00:00.000Z",
    "updatedAt": "2024-01-16T10:30:00.000Z"
  },
  "message": "Cron monitor updated successfully."
}
```

### Delete a Cron Monitor

**Endpoint:**

```bash
DELETE /monitors/cron/:id
```

**Example request**

```bash
DELETE /monitors/cron/cron-abc123
```

**Example response**

```json
{
  "cronMonitor": {
    "id": "cron-abc123",
    "name": "Daily backup",
    "slug": "my-page-x7k2m9n4p1q8w3e5",
    "period": 86400,
    "grace": 3600,
    "status": "UP",
    "state": "ACTIVE",
    "siteId": "page123",
    "order": 1,
    "groupId": null,
    "componentId": "component-id-1",
    "onFailCreateIncident": true,
    "onFailCreateOutageDuration": false,
    "onFailPublishIncident": true,
    "onFailNotifySubscribers": true,
    "onRecoverResolveIncident": true,
    "onRecoverResolveOutageDuration": false,
    "onRecoverPublishIncident": true,
    "onRecoverNotifySubscribers": true,
    "createTemplateId": null,
    "resolveTemplateId": null,
    "createdAt": "2024-01-15T08:00:00.000Z",
    "updatedAt": "2024-01-15T08:00:00.000Z"
  },
  "message": "Cron monitor deleted successfully."
}
```

### Get Cron Monitor Logs

**Endpoint:**

```bash
GET /monitors/cron/:id/logs
```

**Query Parameters**

| Parameter    | Type     | Default Value | Description                                              |
| ------------ | -------- | ------------- | -------------------------------------------------------- |
| `limit`      | `number` | `100`         | The number of logs per page. Maximum is 127.             |
| `page`       | `number` | `1`           | The page number. Maximum is 1000.                        |
| `startDate`  | `string` | 1 year ago    | ISO 8601 start date for the log range.                   |
| `endDate`    | `string` | now           | ISO 8601 end date for the log range.                     |
| `importance` | `enum`   | `null`        | Filter logs by importance _('all', 'important')_.        |

**Example request**

```bash
GET /monitors/cron/cron-abc123/logs?limit=50&page=1&importance=important
```

**Example response**

```json
{
  "logs": [
    {
      "id": "log-xyz789",
      "monitorId": "cron-abc123",
      "status": "SUCCESS",
      "requestType": "GET",
      "agent": "curl/8.4.0",
      "ipAddress": "203.0.113.10",
      "createdAt": "2024-01-16T06:00:00.000Z",
      "startedAt": "2024-01-16T05:59:58.000Z"
    }
  ],
  "page": 1
}
```

### Get Cron Monitor Summary

**Endpoint:**

```bash
GET /monitors/cron/:id/summary
```

**Example request**

```bash
GET /monitors/cron/cron-abc123/summary
```

**Example response**

```json
{
  "summary": {
    "totalLogs": 120,
    "totalFailedLogs": 3,
    "availability": 97.5,
    "oneDayAvailability": 100,
    "previousDayAvailability": 100,
    "sevenDayAvailability": 98.2,
    "previousSevenDayAvailability": 96.1,
    "thirtyDayAvailability": 97.5,
    "previousThirtyDayAvailability": 95.8,
    "lastSuccess": "2024-01-16T06:00:00.000Z",
    "lastFailure": "2024-01-10T06:00:00.000Z",
    "lastStarted": null,
    "upSince": "2024-01-10T07:00:00.000Z",
    "downSince": null
  }
}
```

### Ping endpoints

These endpoints do **not** require authentication. The monitor `slug` acts as the secret.

You can ping via the API base URL or the dedicated cron host:

- **Success:** `https://cron.instatus.com/{slug}` or `GET` / `POST` / `HEAD` `/monitors/cron/{slug}`
- **Failure:** `https://cron.instatus.com/{slug}/fail` or `GET` / `POST` / `HEAD` `/monitors/cron/{slug}/fail`
- **Start:** `https://cron.instatus.com/{slug}/start` or `GET` / `POST` / `HEAD` `/monitors/cron/{slug}/start`

Send a success ping each time your job completes on schedule. Send a start ping before the job runs and a success or failure ping when it finishes to record execution time.

**Example success ping**

```bash
curl https://cron.instatus.com/my-page-x7k2m9n4p1q8w3e5
```

**Example response**

```json
{
  "id": "log-xyz789",
  "monitorId": "cron-abc123",
  "status": "SUCCESS",
  "requestType": "GET",
  "agent": "curl/8.4.0",
  "ipAddress": "203.0.113.10",
  "createdAt": "2024-01-16T06:00:00.000Z"
}
```

If the slug is invalid, the response is:

```json
{
  "message": "Monitor not found"
}
```
