Skip to content

Commit f9c12a5

Browse files
committed
Added 'created_at__gt', 'created_at__lt' params to get_alerts()
1 parent 04fda93 commit f9c12a5

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

docs/known-issues.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,3 +527,12 @@ The v2 `/groups/` endpoint DOES support `expand=account`. When used, the
527527
for a separate `/accounts/` fetch to resolve group account names. Known
528528
endpoints that support `expand`: `/routers/` (group, account), `/groups/`
529529
(account).
530+
531+
### v2 `/alerts/` Endpoint Does Not Support `order_by` (discovered 2026-06-26)
532+
The `/alerts/` endpoint returns `409 Conflict` with `"Invalid ordering field
533+
specified: created_at"` when using `order_by=-created_at` or any `order_by`
534+
parameter. The endpoint does not support ordering — results must be sorted
535+
client-side. The endpoint does support `created_at__gt` for time filtering,
536+
but requires full ISO 8601 format with microseconds and timezone offset
537+
(e.g. `2026-06-26T15:00:37.703000+00:00`). The alert `type` field for
538+
custom alerts is `custom_alert` (not `custom`).

ncm/ncm/ncm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,8 @@ def get_alerts(self, **kwargs):
514514
call_type = 'Alerts'
515515
get_url = '{0}/alerts/'.format(self.base_url)
516516

517-
allowed_params = ['account', 'created_at', 'created_at_timeuuid',
517+
allowed_params = ['account', 'created_at', 'created_at__gt',
518+
'created_at__lt', 'created_at_timeuuid',
518519
'detected_at', 'friendly_info', 'info',
519520
'router', 'type', 'order_by', 'limit', 'offset']
520521
params = self.__parse_kwargs(kwargs, allowed_params)

0 commit comments

Comments
 (0)