On this page

Allows API users to update existing alerts. Alerts can currently be created either from Asset Locator Portal or via [Create alert](https://docs.genlogs.io/alerts/create-alert). These alerts are triggered when a scheduled job is performed and search the detections based on the alert criteria. Notifications are sent via email and webhooks.

This endpoint is restricted to authorized users with appropriate permissions.

---

### Authentication

Include the following headers in your requests:
- **Access-Token**: The access token obtained from the "Create Access Token" endpoint.
- **x-api-key**: The API key provided by GenLogs. This header must be included in the request.

---

### Permissions

Make sure your API user is created with a role that includes either `admin` or `edit-alert-endpoint` permissions.

---

### Endpoint

- **URL**: `https://api.genlogs.io/alerts/{alert_id}`
- **Method**: `PATCH`

---

### Request Parameters

Only the following fields are updatable:

- **alert_name** (string, Optional): The name of the alert for identification.
- **location_state** (string, Optional): State where the alert is triggered.
- **location_city** (string, Optional): City where the alert is triggered.
- **license_plate** (string, Optional): License plate number related to the alert.
- **location_plate_state** (string, Optional): State where the license plate is registered.
- **usdot_number** (string, Optional): USDOT number of the vehicle.
- **mc_number** (string, Optional): MC number of the vehicle.
- **vin** (string, Optional): Last 6 digits of the VIN.
- **cab_number** (string, Optional): Cab number of the vehicle.
- **equipment_type** (string, Optional): Equipment type of the trailer.
- **trailer_logo** (string, Optional): Logo displayed on the trailer.
- **trailer_number** (string, Optional): Trailer number associated with the alert.
- **exact_match_trailer_number** (boolean, Optional): Whether to do an exact match on trailer number.
- **cc_emails** (array of strings, Optional): Additional recipients for email notifications.
- **alert_type** (string, Optional): `normal` or `hot`. Defines how often alerts are triggered.
- **disabled** (boolean, Optional): Indicates whether the alert is active.
- **start_date** (string (ISO 8601 date-time string), Optional): Alert start date.
- **end_date** (string (ISO 8601 date-time string), Optional): Alert end date.
- **deep_search** (boolean, Optional): Enables deeper asset match scanning.
- **notification_channels** (array of strings, Optional): List of channels to receive notifications.

`start_date` and `end_date` accept ISO 8601 date-time strings with `Z`, timezone offsets, or naive date-time strings. Timezone-aware input is normalized to UTC and stored/returned without timezone. Invalid date-time strings return `400`.

---

### Response Codes

| Code    | Meaning                                          |
|---------|-------------------------------------------------|
| `200 OK`      | Successfully updated the alert.               |
| `400 Bad Request` | Missing or invalid parameters.               |
| `401 Unauthorized` | Authentication credentials are missing or invalid. |
| `403 Forbidden` | User lacks required permissions.               |
| `404 Not Found` | No alert found with the specified ID.         |
| `500 Internal Server Error` | An unexpected server error occurred.     |

### External Patch Alert

`patch/alerts/{alert_id}`

Partially update an existing alert by `alert_id`. `start_date` and `end_date` accept ISO 8601 date-time strings with `Z`, timezone offsets, or no timezone. Timezone-aware values are normalized to UTC and returned without timezone information.

---

#### Authorization

APIKeyHeader

#### Path parameters
- **alert_id** (integer, Required)

#### Body

```json
{
  "alert_name": "text",
  "location_state": "text",
  "location_city": "text",
  "license_plate": "text",
  "license_plate_state": "text",
  "usdot_number": "text",
  "chassis_number": "text",
  "exact_match_chassis_number": false,
  "container_number": "text",
  "equipment_type": "text",
  "exact_match_container_number": false,
  "mc_number": "text",
  "vin": "text",
  "cab_number": "text",
  "trailer_logo": "text",
  "trailer_number": "text",
  "disabled": true,
  "cc_emails": ["text"],
  "alert_type": "text",
  "exact_match_trailer_number": true,
  "start_date": "2025-06-27T15:46:59.165Z",
  "end_date": "2025-06-27T15:46:59.165Z",
  "deep_search": "text",
  "notification_channels": ["text"]
}
```

---

#### Successful Response

```json
{
  "alert_name": "text",
  "location_state": "text",
  "location_city": "text",
  "license_plate": "text",
  "license_plate_state": "text",
  "usdot_number": "text",
  "chassis_number": "text",
  "exact_match_chassis_number": false,
  "container_number": "text",
  "equipment_type": "text",
  "exact_match_container_number": false,
  "mc_number": "text",
  "vin": "text",
  "cab_number": "text",
  "trailer_logo": "text",
  "trailer_number": "text",
  "disabled": false,
  "cc_emails": ["text"],
  "alert_type": "normal",
  "exact_match_trailer_number": false,
  "start_date": "2026-07-17T15:24:35.262Z",
  "end_date": "2026-07-17T15:24:35.262Z",
  "deep_search": "text",
  "id": 1,
  "email": "text",
  "last_updated_timestamp": "2026-07-17T15:24:35.262Z",
  "insert_timestamp": "2026-07-17T15:24:35.262Z",
  "notification_channels": ["text"]
}
```

Last updated 1 month ago
