Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .changeset/external-api-v2-alerts-response-shapes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@hyperdx/api': minor
---

External API v2: make error responses consistent and add concurrency safety.

- `/api/v2/alerts` `403`/`404` responses now return a JSON `{ message }` body
(previously an empty plaintext body), matching the documented `Error` schema
and the saved-search/webhook routers.
- `DELETE /api/v2/alerts/:id` now returns `404` for an alert that does not exist
(previously always `200`). The `404` was already part of the documented
contract; delete is no longer idempotent for a missing alert.
- `PUT /api/v2/webhooks/:id` can now return `409` when the webhook's destination
(`url`/`service`) was changed concurrently between read and write. Clients
should re-read and retry.
23 changes: 23 additions & 0 deletions .changeset/external-api-v2-list-pagination.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
"@hyperdx/api": minor
---

External API v2: add offset/limit pagination to the alerts, saved-searches, and
webhooks list endpoints. Each now accepts `limit` (1–1000, default 1000) and
`offset` (>=0, default 0) query params and returns a `meta: { total, limit,
offset }` block alongside `data`. Results are sorted by `_id` so paging is
stable across requests.

Backward compatible: the default `limit` is the maximum (1000), so callers that
don't paginate keep receiving all their records (up to the cap) as before. Use
`limit`/`offset` to page through larger result sets.

Behavior change: `/api/v2/alerts` and `/api/v2/webhooks` were previously
unbounded and now hard-cap a single page at 1000 records. A team that exceeds
1000 alerts or webhooks will only see the first 1000 unless the client reads
the total and pages with `offset`; the full set is still reachable, but a
pre-`meta` client that never paginated would silently process only the first
page. To make the truncation detectable without parsing the body, each list
response now also sets an `X-Total-Count` header with the full count (matching
`meta.total`), and the server logs a warning when a default-limit page is
truncated.
11 changes: 11 additions & 0 deletions .changeset/external-api-v2-saved-searches-webhooks-crud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@hyperdx/api": minor
---

External API v2: add bearer-auth CRUD for saved searches and webhooks so
providers can manage them as resources. Adds a new
`/api/v2/saved-searches` router (list/get/create/update/delete, team-scoped,
validates `sourceId` ownership) and upgrades `/api/v2/webhooks` from
list-only to full CRUD (POST/PUT/DELETE). Webhook `headers` and `queryParams`
are write-only — accepted on create/update but never returned on read — so
auth tokens and other secrets do not leak.
12 changes: 12 additions & 0 deletions .changeset/saved-search-filter-render-validation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@hyperdx/common-utils": patch
"@hyperdx/app": patch
---

Move the pinned-filter query parser (`parseQuery`) into `@hyperdx/common-utils`
as the inverse of `filtersToQuery`, and add an `isRenderablePinnedFilter`
helper. The app re-exports `parseQuery` from its previous location, so there is
no behavior change in the UI. The helper lets the external saved-search API
validate that a pinned filter will actually render as a sidebar facet (a
`type: 'sql'` `<column> IN (...)` / `NOT IN` / `BETWEEN` predicate) and reject
shapes that would be stored but never shown.
Loading
Loading