Page, filter and sort API lists
The big registers (findings, risks, remediation items, assets and others) answer one page at a time. The meta object in each answer says where you are.
Pages
| Query key | Default | What it does |
|---|---|---|
page | 1 | The page to read, counted from 1. |
limit | 25 | Records per page, from 1 to 100. A larger number is read as 100. |
Example:
curl -H "Authorization: Bearer cca_YOUR_KEY" \
"https://app.valystrum.io/api/v1/YOUR_ORG/risks?page=2&limit=100"
The answer carries "meta": { "total": 141, "page": 2, "limit": 100, "pages": 2 }. Keep asking for the next page until page reaches pages. A page past the end answers an empty data list, not an error.
Filters
Lists that take filters read them as filter[field]=value, for example:
/api/v1/YOUR_ORG/findings?filter[status]=open&filter[severity]=critical
Each endpoint accepts its own filter fields, listed as query keys in the API reference. A filter on a field the endpoint does not offer is ignored, so check the reference if a filter seems to do nothing. A query key the endpoint does not know is ignored too: ?status=open returns every record, so write it as filter[status]=open. A value that matches nothing returns an empty list.
Search
Where a list offers search, it matches the words you give in the record's title or name (and, in some lists, a description or code). Text is always taken as text: quotes, markup and SQL-like strings simply match nothing.
Sorting
The findings, risks, remediation, assets and vendors lists take sort=field:direction, for example sort=createdAt:asc. Without it, the newest records come first (createdAt:desc). Sort only on a field that the records in the answer carry: a field they do not carry answers 500.
Lists without pages
Some endpoints answer a whole list or a summary in one go (for example the incidents list, the controls list or a module's summary). Their answer has no meta and takes no page or limit.