Skip to main content

Pagination

List endpoints in the neuroflash API support pagination using page and size query parameters.

Request Parameters

ParameterTypeDefaultDescription
pageinteger1Page number (1-based)
sizeinteger20Number of items per page (max varies by endpoint, typically 200)
sortstringvariesField to sort by (e.g., name, createdAt, updatedAt)
orderstringvariesSort direction: asc or desc

Response Format

Paginated responses include a page object with metadata:

{
"data": [
{ "id": "abc-123", "name": "Example item" },
{ "id": "def-456", "name": "Another item" }
],
"page": {
"size": 20,
"totalElements": 42,
"totalPages": 3,
"currentPage": 1
}
}
FieldDescription
dataArray of resources for the current page
page.sizeNumber of items per page
page.totalElementsTotal number of items across all pages
page.totalPagesTotal number of pages
page.currentPageCurrent page number (1-based)

Example: Paginating Through Results

# Get the first page (20 items)
curl "https://app.neuroflash.com/api/digital-twin-service/v1/workspaces/{workspace_id}/static-groups/millennials/twins?page=1&size=20" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

# Get the second page
curl "https://app.neuroflash.com/api/digital-twin-service/v1/workspaces/{workspace_id}/static-groups/millennials/twins?page=2&size=20" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Filtering and Sorting

Many list endpoints support additional query parameters for filtering and sorting. Check each endpoint's documentation for available options.

# List twins sorted by name descending, 10 per page
curl "https://app.neuroflash.com/api/digital-twin-service/v1/workspaces/{workspace_id}/static-groups/gen_z/twins?page=1&size=10&order=desc" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"