# Update proactive alerts

`PATCH https://api.parklio.com/v2/proactive-alerts/{id}`

This endpoint allows the user to update proactive alerts by id

**Auth:** `Authorization: Bearer <token>`

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes |  |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | Descriptive name of the alert. Must be between 3 and 256 characters. |
| `occupancy_threshold` | number | no | Occupancy percentage threshold in % that triggers an email notification when the parking lot reaches or exceeds this value. |
| `min_minutes_between_emails` | number | no | Minimum time interval (in minutes) required between sending alert emails. Must be between 1 and 3600 minutes. |

```json
{
  "name": "New Alert name",
  "occupancy_threshold": 90,
  "min_minutes_between_emails": 60
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "id": 1,
    "name": "Defualt Zone Alert",
    "occupancy_threshold": 90,
    "min_minutes_between_emails": 30,
    "created_at": "2026-01-15T09:30:00.000Z",
    "updated_at": "2026-01-15T09:30:00.000Z",
    "receivers": [
      {
        "id": 1,
        "name": "John Doe",
        "receiver_email": "john.doe@example.com"
      },
      {
        "id": 2,
        "name": "Jane Smith",
        "receiver_email": "jane.smith@example.com"
      }
    ],
    "zone": {
      "id": 1,
      "name": "Defualt Zone"
    }
  }
}
```

### 401 — Account user is not logged in and they should log in again.

```json
{
  "success": false,
  "errors": [
    {
      "code": 1,
      "message": "Unauthorized access."
    }
  ]
}
```

### 403 — User does not have permission to access requested resource.

```json
{
  "success": false,
  "errors": [
    {
      "code": 4,
      "message": "No permission."
    }
  ]
}
```

### 404 — Resource that has been requested does not exist. User should not try to repeat this request.

```json
{
  "success": false,
  "errors": [
    {
      "code": 6,
      "message": "Resource not found."
    }
  ]
}
```

### 422 — Some of the provided request parameters are missing or are invalid. User should add/change them according to response message.

```json
{
  "success": false,
  "errors": [
    {
      "code": 23,
      "message": "Validation error",
      "field": "field"
    }
  ]
}
```

