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

# On-call load

> Count how long each person was on call, how many alert notifications each received, how many came at night or on a weekend, and how many nights were broken.

```http theme={null}
GET /api/v1/alerts/insights/oncall-load
```

Measures each person's on-call load over a period, most notifications first. The call requires
`alerts.incidents.read`.

A notification is an alert-fired or escalation notification delivered to a person, counted once per person
per notification; failed sends do not count. Night is 22:00 to 08:00 the next day local time, and the
weekend is local Saturday and Sunday. Local time follows the timezone of the person's schedule; for someone
on no schedule it follows the timezone of that person's [quiet hours](https://docs.molesignal.com/en-US/account.md#notify), and otherwise UTC. A
notification in the small hours counts toward the night before.

**Query parameters**

| Param | Type | Notes |
| - | - | - |
| `window_secs` | integer | How many seconds to look back. Defaults to `2592000` (30 days) and is clamped to between 1 and 90 days. |
| `schedule_id` | string | Counts only this schedule's members and shifts. |

```bash cURL theme={null}
curl "http://localhost:5080/api/v1/alerts/insights/oncall-load?window_secs=604800" \
  -H "authorization: Bearer $MS_TOKEN"
```

```json 200 theme={null}
{
  "window_secs": 604800,
  "night_start_hour": 22,
  "night_end_hour": 8,
  "people": [
    {
      "user_id": "<user-id>",
      "oncall_secs": 302400,
      "pages": 9,
      "night_pages": 3,
      "weekend_pages": 2,
      "interrupted_nights": 2,
      "timezone": "Asia/Shanghai",
      "responded": 6,
      "mtta_secs": 214.0
    }
  ]
}
```

**Response**

| Field | Notes |
| - | - |
| `window_secs` | The window after clamping. |
| `night_start_hour`, `night_end_hour` | The hours night runs between. |
| `people[].oncall_secs` | Seconds on call on a schedule in the period, overrides and swaps included. |
| `people[].pages` | Alert notifications received. |
| `people[].night_pages`, `people[].weekend_pages` | How many of them came at night and on a weekend. |
| `people[].interrupted_nights` | Nights with at least one notification. |
| `people[].timezone` | The timezone used to tell night and weekend. |
| `people[].responded`, `people[].mtta_secs` | Incidents this person was first to take in the period, and the mean seconds from the trigger to taking them. Taking is counted as in [Incident insights](https://docs.molesignal.com/en-US/api/alerting/insights.md). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.