---
title: "The project's alerts: which are on, quiet hours, where they go, alerts firing now and the recent ones"
method: GET
path: "/projects/{projectId}/alerts"
tags: ["Alerts"]
---

# The project's alerts: which are on, quiet hours, where they go, alerts firing now and the recent ones

`GET /projects/{projectId}/alerts`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/projects/{projectId}/alerts`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `projectId` string, uuid, required

## Response `200`

Alerts

- object
  - `projectId` string, uuid, required
  - `rules` object, required
    - `siteDown` object, required
      - `enabled` boolean, required
    - `errorRate` object, required
      - `enabled` boolean, required
      - `percent` integer, required: alert when at least this share of requests answers 5xx
      - `minutes` union, required: over this many minutes
        - 5
        - 10
        - 15
      - `minRequests` integer, required: and at least this many requests came in
    - `logKeyword` object, required
      - `enabled` boolean, required
      - `keywords` string[], required: whole words, case does not matter
    - `sslExpiry` object, required
      - `enabled` boolean, required
    - `deployFailed` object, required
      - `enabled` boolean, required
  - `quietHours` object, nullable, required
    - `enabled` boolean, required
    - `start` string, required: local time, HH:MM
    - `end` string, required: local time, HH:MM (may be the next day)
    - `timeZone` string, required: IANA time zone, e.g. Europe/Stockholm
    - `urgentThrough` boolean, required: site-down alerts are sent right away even in quiet hours
  - `sms` boolean, required: text messages to the team's verified numbers
  - `isDefault` boolean, required: nothing was changed yet: the defaults apply
  - `updatedAt` string, nullable, required: ISO-8601 timestamp
  - `channels` object, required
    - `email` boolean, required: the server can send email (each member chooses under Settings → Notifications)
    - `webhooks` object[], required: Slack, Discord and other webhooks that receive this project's alerts
      - `id` string, uuid, required
      - `name` string, required
      - `kind` 'generic' | 'slack' | 'discord', required
      - `projectId` string, uuid, nullable, required
      - `enabled` boolean, required
      - `allEvents` boolean, required: the webhook receives every event type, not only alerts
    - `sms` 'available' | 'not_configured' | 'switched_off' | 'upgrade_required', required
    - `phones` object[], required
      - `id` string, uuid, required
      - `number` string, required: E.164, shown with only the last digits
      - `label` string, nullable, required
      - `verified` boolean, required
      - `createdAt` string, required: ISO-8601 timestamp
  - `errorRateAvailable` boolean, required: error answers reach the platform's request log (the error-rate alert can fire)
  - `open` object[], required: alerts firing now
    - `id` string, uuid, required
    - `kind` 'site_down' | 'error_rate' | 'log_keyword' | 'ssl_expiry' | 'deploy_failed', required
    - `subject` string, required
    - `openedAt` string, required: ISO-8601 timestamp
    - `resolvedAt` string, nullable, required: ISO-8601 timestamp
    - `repeats` integer, required
    - `details` object, required
  - `recent` object[], required: the last 20 alerts, newest first
    - `id` string, uuid, required
    - `kind` 'site_down' | 'error_rate' | 'log_keyword' | 'ssl_expiry' | 'deploy_failed', required
    - `subject` string, required
    - `openedAt` string, required: ISO-8601 timestamp
    - `resolvedAt` string, nullable, required: ISO-8601 timestamp
    - `repeats` integer, required
    - `details` object, required

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `403`: Authenticated but not permitted (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `429`: Too many requests (code rate_limited); see Retry-After
- `501`: Not available on this server yet (code not_configured): migration 190 is not applied

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
