Skip to main content
Agnes uses skip / limit offset pagination on every list endpoint. The SDKs wrap this transparently with iterators; if you call the API directly, follow the conventions on this page.

The wire format

List responses share a common envelope:
To fetch the next page, send skip = previous_skip + previous_limit.
When skip + len(items) >= total, you’re done.

Default and maximum limits

If you exceed the maximum, the API returns validation_error with a 422.

Filtering

Many list endpoints support a search query parameter that does case-insensitive substring matching against the resource’s name (or the most relevant field). Combine with skip / limit:
The auto-generated API reference page for each endpoint enumerates the supported filters.

SDK helpers

Both SDKs hide the skip / limit math behind iterators.

Python

.pages() is useful if you want to know total up front (e.g. to render a progress bar) or you want to break the iteration after the first interesting page.

TypeScript

The async iterator backs each page with a single HTTP call; you do not need to manage offsets yourself.

Stable ordering

List endpoints sort by created_at DESC, id DESC by default. For most collections this is “newest first”, which keeps the first page useful in dashboards. If you need a different order (e.g. alphabetical for policies), the dashboard’s policy list does the sort client-side; the API does not currently expose a sort parameter. The is_default flag promotes the default policy to the top of the list returned by GET /api/v1/policies/. SDKs preserve that order.

Performance notes

  • Keep limit reasonable. For UI lists, 50 is a good default; going past 200 on policies / rules will rarely render usefully.
  • Stream analyzer logs. For exports of more than a few thousand events, prefer the POST /api/v1/analyzer-logs/search endpoint rather than GET /api/v1/analyzer-logs/events_summary. The search endpoint is paginated and tuned for high-volume reads.
  • Don’t poll for new pages on a hot loop. If you want near-real-time analysis log updates, use the analyzer log Elasticsearch index via the search endpoint with a created_at >= now-1m filter.

Next