Skip to main content
The LENS API uses two pagination patterns depending on the endpoint type:
  • Offset-based (AG-Grid model) — used by POST endpoints that return tabular data. Covered in detail on this page.
  • Typesense page/per_page — used by the /search-public/* endpoints. See the Public Search group for query-string parameters.

Offset-based pagination

Tabular endpoints (companies at an address, watchlist members, person companies, etc.) accept a POST request whose JSON body specifies the row range, sort order, and filters.

Request body

{
  "startRow": 0,
  "endRow": 50,
  "sortModel": [
    { "colId": "companyName", "sort": "asc" }
  ],
  "filterModel": {}
}
FieldTypeDescription
startRowintZero-based index of the first row to return
endRowintZero-based index of the row after the last row (exclusive)
sortModelarrayOptional. Sorting instructions — see Sorting
filterModelobjectOptional. Server-side filters — see Filtering
The page size is endRow - startRow. For example, startRow: 0, endRow: 50 returns the first 50 rows.

Response

{
  "success": true,
  "rows": [ ... ],
  "lastrow": -1
}
FieldTypeDescription
successboolWhether the request succeeded
rowsarrayThe data rows for the requested range
lastrowintIndex of the last row in the dataset, or -1 if more rows exist

How to paginate

Use lastrow to determine if there are more pages:
  • lastrow == -1 — more rows available, request the next page
  • lastrow >= 0 — this is the last page, lastrow is the total row count
Example — fetch all rows in pages of 100:
# Page 1
curl -X POST "https://lens-api.tic.io/addresses/12345/companies" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "startRow": 0, "endRow": 100 }'
# → lastrow: -1 (more rows exist)

# Page 2
curl -X POST "https://lens-api.tic.io/addresses/12345/companies" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "startRow": 100, "endRow": 200 }'
# → lastrow: 142 (last page, 142 total rows)

Sorting

Add a sortModel array to sort by one or more columns:
{
  "startRow": 0,
  "endRow": 50,
  "sortModel": [
    { "colId": "companyName", "sort": "asc" }
  ]
}
FieldTypeValues
colIdstringColumn name to sort by
sortstringasc or desc

Filtering

Add a filterModel object to filter results server-side. Each key is a column name; the value describes the filter.

Text filter

{
  "filterModel": {
    "companyName": {
      "type": "contains",
      "filter": "Volvo",
      "filterType": "text"
    }
  }
}

Number filter

{
  "filterModel": {
    "numberOfEmployees": {
      "type": "greaterThan",
      "filter": 100,
      "filterType": "number"
    }
  }
}

Date range filter

{
  "filterModel": {
    "registrationDate": {
      "type": "inRange",
      "dateFrom": "2024-01-01",
      "dateTo": "2024-12-31",
      "filterType": "date"
    }
  }
}

Set filter (match any of the values)

{
  "filterModel": {
    "localCompanyCode": {
      "filterType": "set",
      "values": ["AB", "HB"]
    }
  }
}

Multiple conditions on the same column

{
  "filterModel": {
    "numberOfEmployees": {
      "operator": "AND",
      "filterType": "number",
      "conditions": [
        { "type": "greaterThan", "filter": 10, "filterType": "number" },
        { "type": "lessThan", "filter": 500, "filterType": "number" }
      ]
    }
  }
}

Supported filter operators

OperatorTypesDescription
equalstext, numberExact match
notEqualtext, numberNot equal
containstextSubstring match
startsWithtextStarts with
endsWithtextEnds with
greaterThannumber, dateGreater than
lessThannumber, dateLess than
inRangedateBetween dateFrom and dateTo (inclusive)
blankallValue is null
notBlankallValue is not null

Combining conditions

Use the operator field with "AND" or "OR" to combine multiple conditions on the same column.

Endpoints using this pattern

These POST endpoints accept the pagination request body described above:
EndpointDescription
POST /addresses/{id}/companiesCompanies at an address
POST /addresses/{id}/workplacesWorkplaces at an address
POST /addresses/{id}/personsPersons at an address
POST /properties/se/{uuid}/companiesCompanies at a property
POST /properties/se/{uuid}/workplacesWorkplaces at a property
POST /persons/{id}/companiesCompanies where person is a representative
POST /persons/{id}/beneficial-ownersBeneficial ownership positions
POST /watchlists/{id}/companiesCompany members of a watchlist
POST /watchlists/{id}/personsPerson members of a watchlist
POST /watchlists/{id}/addressesAddress members of a watchlist
POST /watchlists/{id}/propertiesProperty members of a watchlist
POST /watchlists/{id}/vehiclesVehicle members of a watchlist
POST /watchlists/{id}/eventsWatchlist events
POST /ordersYour document orders
POST /team/ordersTeam document orders
POST /team/exportsTeam exports