Pagination, sorting and search
How collection endpoints page, sort and filter their results.
ReferenceAPI: pagination, sorting and search — Overview
Most collection endpoints of the evalink talos API — for example the Company list, the device list, or the Alarm list — accept the same three query parameters (page, size, sort). Depending on how the underlying endpoint is implemented, the response comes back in one of three JSON shapes: a HAL collection with paging metadata, a plain Page object with a content array, or a HAL collection with no paging metadata at all. Endpoints under a resource's /search/... path are finders (for example /search/findByCompanyId) that filter by specific fields instead of returning the whole collection; a few resources additionally expose a free-text /search/lookup-style endpoint. This page describes these shared conventions; field-level detail for a specific resource is documented on its own API page (for example Alarm, Api Token).
ReferenceAPI: pagination, sorting and search — Pagination parameters
Every paged endpoint accepts:
| Parameter | Meaning | Default |
|---|---|---|
page |
zero-based page index | 0 |
size |
number of items per page | 100 |
sort |
property,asc or property,desc |
send it explicitly if you need a specific order |
The default page size of 100 is configured once, in the module shared by every Spring-Data-REST-backed service (companies, api tokens, custom sounds and most other simple resources), and separately for the log service's own auto-exposed repositories. Hand-written list controllers such as the Alarm list, the event log list and the audit log list bind the same page/size/sort parameters directly.
Some search-backed endpoints (the device text-search lookups) declare their own default size of 100 in code. Search-backed endpoints impose a pagination-depth limit — see Limits and edge cases.
ReferenceAPI: pagination, sorting and search — Response envelopes
Three shapes occur across the API, depending on how the endpoint is implemented:
HAL collection with paging metadata — the payload has an _embedded object whose single key is the plural relation name (_embedded.alarms, _embedded.event-logs, …) holding the array of items, an _links object, and a top-level page object with page.size, page.totalElements, page.totalPages and page.number. The Alarm list (GET /api/alarm-service/alarms), the event log list (GET /api/event-log-service/event-logs), and the device company/device-group lookups (GET /api/device-service/devices/search/findByCompanyId, .../findByDeviceGroupId) all use this shape.
Plain Page envelope — the payload has a top-level content array plus flat totalElements, totalPages, number and size fields, with no _embedded and no _links. The audit log list (GET /api/log-service/audit-logs) and the device text-search endpoints (GET /api/device-service/devices/search/lookupByCompanyIdAndQuery, .../searchByCompanyIdGroupIdAndFilter) return this shape.
HAL collection without paging metadata — an _embedded object and _links, but no page object, returned by finders backed by a repository method that returns a list rather than a Page (for example GET /api/api-token-service/api-tokens/search/findByCompanyId, GET /api/alarm-service/custom-sounds/search/findByCompanyId, GET /api/device-service/devices/search/findByIdIn, GET /api/alarm-service/alarms/search/findByIdIn). These are not paginated and ignore page/size/sort.
By default, these responses omit _links entries for an object's own relations: because many entities have numerous relationships, emitting a link for each would multiply payload size, so the platform's shared configuration disables relation-link collection by default.
ReferenceAPI: pagination, sorting and search — Search and finder endpoints
Collections that support filtering expose it as extra endpoints under /search/, named after the filter they apply:
GET /api/device-service/devices/search/findByCompanyId?companyId=<companyId>&page=0— paginated, HAL with paging metadata;companyIdis requiredGET /api/device-service/devices/search/findByDeviceGroupId?deviceGroupId=<deviceGroupId>&page=0— paginated, HAL with paging metadata;deviceGroupIdis requiredGET /api/device-service/devices/search/findByIdIn?ids=<id>&ids=<id>— takes the pluralids(repeat for several values); not paginatedGET /api/alarm-service/alarms/search/findByIdIn?ids=<id>— not paginatedGET /api/api-token-service/api-tokens/search/findByCompanyId?companyId=<companyId>— not paginatedGET /api/alarm-service/custom-sounds/search/findByCompanyId?companyId=<companyId>— not paginatedGET /api/event-log-service/event-logs/search/findByWorkflowId?workflowId=<workflowId>— not paginated
Parameter names generally follow the finder name, but not always (for example ids for findByIdIn); check each operation's schema.
Several resources additionally expose a free-text search taking a query string alongside companyId and paging parameters:
curl -H 'Authorization: Bearer <token>' \
'https://talos.evalink.io/api/device-service/devices/search/lookupByCompanyIdAndQuery?companyId=<companyId>&query=<text>&page=0&size=50'
Omitting page. If page is left out entirely (as opposed to 0) on the device company or device-group finders, the request is treated as unpaginated: a warning is logged and the result is silently capped at the first 1000 devices. The plain device list (GET /api/device-service/devices) behaves the same but caps at 5000 and logs the event at error level. Always send an explicit page value.
ReferenceAPI: pagination, sorting and search — Limits and edge cases
Search-backed list endpoints — the alarm list, the event log list, the device text-search/filter endpoints, and the contact list and contact search endpoints — enforce a maximum pagination depth per company: if the requested page offset plus size exceeds that company's configured limit (125,000 items by default), the request is rejected with a 400 error stating that pagination beyond that many items is not supported. This protects the underlying search engines and the database fallback from expensive deep-offset queries; it applies independently of size, so requesting a small page size does not avoid the limit once the offset itself is too high. The limit is adjustable per company.
For the same reason, the page.totalElements/totalElements figure on the alarm list and the event log list is not always an exact count: rather than running a full count query, these endpoints report the offset plus the number of items actually returned, incremented by one if a further page is known to exist. Treat it as "at least this many", not as an exact total, and use the presence or absence of further content to decide whether to keep paging rather than relying on totalPages.