Pagination

Insuredspeaks uses page-based pagination for policy listings and searches, portfolios, profiles, and holdings. Request a page with page and choose its size with limit. The defaults are page 1 and 20 results per page, with a maximum page size of 100.

Supported endpoints

EndpointResource
GET /v1/policiesShared catalogue policies
GET /v1/policies/searchPolicy search results; requires q
GET /v1/portfoliosYour portfolios
GET /v1/portfolios/{portfolioId}/peopleProfiles in a portfolio
GET /v1/portfolios/{portfolioId}/policiesHoldings in a portfolio

Pagination does not apply to every array response. For example, carrier and policy filter-value endpoints return their lists without pagination metadata.

Request parameters

  • Name
    page
    Type
    integer
    Description

    The page number to retrieve, starting at 1. Defaults to 1. Portfolio, profile, and holding lists accept values up to 1000000.

  • Name
    limit
    Type
    integer
    Description

    The maximum number of results per page, from 1 to 100. Defaults to 20.

Portfolio, profile, and holding lists reject invalid pagination values or unknown query parameters with 400. Policy list and search endpoints parse pagination values as integers, fall back to defaults for zero or unparseable values, and clamp the page to at least 1 and the limit to 1–100. Send valid integers to get consistent behavior across endpoints.

Example request

This example requests the second portfolio, using a page size of one. Authenticate with your API key. The response is illustrative; your account's results will differ.

Pagination using cURL

curl -G https://api.insuredspeaks.com/v1/portfolios \
  -H "X-API-Key: $API_KEY" \
  -d page=2 \
  -d limit=1

Paginated response

{
  "success": true,
  "data": [
    {
      "id": "port_8f15e4c0904c4c118239c9628302c172",
      "name": "My Family Insurance",
      "created_at": 1792713600,
      "updated_at": 1792713600
    }
  ],
  "pagination": {
    "page": 2,
    "limit": 1,
    "total": 3,
    "totalPages": 3
  }
}

Reading the response

Successful paginated responses contain success: true, a data array, and a pagination object:

  • Name
    page
    Type
    integer
    Description

    The current page number.

  • Name
    limit
    Type
    integer
    Description

    The requested page size. The last page can contain fewer results.

  • Name
    total
    Type
    integer
    Description

    The total number of results matching the request.

  • Name
    totalPages
    Type
    integer
    Description

    The total number of pages, calculated by rounding total / limit up. This is 0 when there are no matching results.

To retrieve the next page, increment page while pagination.page < pagination.totalPages. Keep the same limit, filters, and sort settings between requests. Pages beyond the available results return an empty data array.

Portfolio, profile, and holding lists are ordered newest first, with an ID tie-breaker. Page-based results can shift if records are added or removed between requests.

Was this page helpful?