Problem
Saved searches exist in the data model (SavedSearch collection, savedSearchId is already referenced in alerts) but there are no external API endpoints to create, read, update, or delete them. This makes infrastructure-as-code workflows impossible — teams cannot version-control or automate saved search provisioning.
Proposed solution
Add GET/POST /api/v2/saved-searches and GET/PUT/DELETE /api/v2/saved-searches/:id endpoints, following the same pattern as the existing dashboards/alerts external API.
The SavedSearch mongoose model and toExternalJSON() method are already implemented in packages/api/src/models/savedSearch.ts; only the router and index registration are missing.
Use case
IaC tooling (Terraform, Helm, scripts) that provisions HyperDX saved searches alongside dashboards and alerts without requiring UI interaction.
Scope of changes
- New file:
packages/api/src/routers/external-api/v2/savedSearches.ts — 5 endpoints with OpenAPI JSDoc annotations
- Edit:
packages/api/src/routers/external-api/v2/index.ts — register /saved-searches route
- New file:
packages/api/src/routers/external-api/__tests__/savedSearches.test.ts — integration tests
Problem
Saved searches exist in the data model (
SavedSearchcollection,savedSearchIdis already referenced in alerts) but there are no external API endpoints to create, read, update, or delete them. This makes infrastructure-as-code workflows impossible — teams cannot version-control or automate saved search provisioning.Proposed solution
Add
GET/POST /api/v2/saved-searchesandGET/PUT/DELETE /api/v2/saved-searches/:idendpoints, following the same pattern as the existing dashboards/alerts external API.The
SavedSearchmongoose model andtoExternalJSON()method are already implemented inpackages/api/src/models/savedSearch.ts; only the router and index registration are missing.Use case
IaC tooling (Terraform, Helm, scripts) that provisions HyperDX saved searches alongside dashboards and alerts without requiring UI interaction.
Scope of changes
packages/api/src/routers/external-api/v2/savedSearches.ts— 5 endpoints with OpenAPI JSDoc annotationspackages/api/src/routers/external-api/v2/index.ts— register/saved-searchesroutepackages/api/src/routers/external-api/__tests__/savedSearches.test.ts— integration tests