Pagination
Pagination allows you to retrieve large datasets from APIs by breaking them into smaller chunks. This system supports multiple pagination strategies to work with different API designs.
When to Use Pagination
APIs that return data in pages (e.g., 100 records per page)
APIs with rate limits that require controlled data retrieval
Large datasets that cannot be retrieved in a single request
APIs that use cursor tokens or next URL links
Pagination Types Overview
Page-based
APIs using page numbers
?page=1, ?page=2
Offset-based
APIs using skip/offset
?offset=0&limit=20, ?offset=20&limit=20
Cursor-based
APIs using cursor tokens
?cursor=abc123
Next URL
APIs providing next page links
Uses full URL from response
Computed
Custom calculation needed
skip=iteration*20
Getting Started
Step 1: Access Pagination Configuration
Navigate to your API connection configuration
Look for the Pagination section
Click Add Pagination Field to start configuring
Step 2: Understand Field Properties
Each pagination field has these key properties:
Name: A descriptive name for this field
Parameter Name: The API parameter name (e.g.,
page,offset,cursor)Parameter Type: The type of pagination (
page,offset,cursor,next_url,custom)Field Type: How the value is determined (
static,jsonpath,computed)Parameter Location: Where to place the parameter (
query,body,header)Start Value: Initial value (for static pagination)
End Value: Final value (for static pagination)
Step: Increment value (for static pagination)
Max Iterations: Maximum number of pages to fetch
Step 3: Test Your Configuration
Click Test Next Iteration to test a single page
Review the response to verify data is correct
Click Verify Pagination Configuration to test iteration 2
Once verified, save your configuration
Scenario 1: Page-Based Pagination
Use Case: API uses page numbers like ?page=1, ?page=2, etc.
Example API
Configuration Steps
Add Pagination Field
Click Add Pagination Field
Configure Field Properties
Name:
Page NumberParameter Name:
pageParameter Type:
pageField Type:
staticParameter Location:
queryStart Value:
1End Value:
100(or leave empty for no limit)Step:
1Max Iterations:
100
Test Configuration
Click Test Next Iteration - should show page 1
Click again - should show page 2
Verify the URL shows
?page=1, then?page=2
Verify and Save
Click Verify Pagination Configuration
Once verified, save your connection
Expected Behavior
Iteration 1:
GET /users?page=1Iteration 2:
GET /users?page=2Iteration 3:
GET /users?page=3Continues until end value or max iterations reached
Scenario 2: Offset-Based Pagination
Use Case: API uses offset/limit like ?offset=0&limit=20, ?offset=20&limit=20
Example API
Configuration Steps
Add Pagination Field for Offset
Name:
OffsetParameter Name:
offsetParameter Type:
offsetField Type:
staticParameter Location:
queryStart Value:
0End Value:
1000(or leave empty)Step:
20(must match your limit)Max Iterations:
50
Add Limit Field (if API requires it)
Name:
LimitParameter Name:
limitParameter Type:
customField Type:
staticParameter Location:
queryStatic Value:
20Max Iterations:
50
Test Configuration
Iteration 1 should show
?offset=0&limit=20Iteration 2 should show
?offset=20&limit=20Iteration 3 should show
?offset=40&limit=20
Expected Behavior
Iteration 1:
GET /products?offset=0&limit=20Iteration 2:
GET /products?offset=20&limit=20Iteration 3:
GET /products?offset=40&limit=20Offset increases by step (20) each iteration
Important Notes
Step value must match your limit if the API uses offset/limit pattern
If API only uses offset (no limit parameter), you only need the offset field
Scenario 3: Cursor-Based Pagination
Use Case: API returns a cursor token in the response that you use for the next request
Example API Response
Configuration Steps
Add Cursor Field
Name:
Cursor TokenParameter Name:
cursorParameter Type:
cursorField Type:
jsonpathParameter Location:
queryJSONPath:
$.body.next_cursor(adjust based on your response structure)Max Iterations:
100Is Dynamic Pagination:
true
Optional: Add Stop Condition
Name:
No More DataSource:
stop_conditionLogic Operator:
ORRules:
Rule 1: Field
$.body.next_cursor, OperatorisNullRule 2: Field
$.body.has_more, Operatorequals, Valuefalse
Test Configuration
First iteration: No cursor parameter (initial request)
Second iteration: Should extract cursor from first response
Verify cursor value appears in query params
Expected Behavior
Iteration 1:
GET /items(no cursor)Iteration 2:
GET /items?cursor=eyJpZCI6IjEyMzQ1In0(from iteration 1 response)Iteration 3:
GET /items?cursor=eyJpZCI6IjY3ODkwIn0(from iteration 2 response)Stops when cursor is null or stop condition met
Finding the Correct JSONPath
Make a test API call and view the response
Identify where the cursor appears (e.g.,
response.next_cursor,response.pagination.cursor)Use JSONPath format:
Root level:
$.next_cursorNested:
$.pagination.next_cursorIn body:
$.body.next_cursor
Scenario 4: Next URL Pagination
Use Case: API provides a complete next page URL in the response
Example API Response
Configuration Steps
Add Next URL Field
Name:
Next Page URLParameter Type:
next_urlField Type:
jsonpathParameter Location:
query(or leave default)JSONPath:
$.body.pagination.next(adjust based on your response)Max Iterations:
100Is Dynamic Pagination:
true
Test Configuration
First iteration: Uses your base URL
Second iteration: Should use the next URL from first response
Verify the URL changes correctly
Expected Behavior
Iteration 1:
GET https://api.example.com/users?page=1Iteration 2:
GET https://api.example.com/users?page=2&token=abc123(from response)Iteration 3:
GET https://api.example.com/users?page=3&token=def456(from response)Stops when next URL is null or empty
Handling Relative URLs
If the API returns relative URLs like /users?page=2:
The system automatically converts them to absolute URLs
Uses your base URL as the origin
No additional configuration needed
Handling Query Parameters in Next URL
If the next URL contains query parameters:
The system extracts them automatically
Merges with your existing query parameters
Next URL parameters take priority
Scenario 5: Computed Pagination
Use Case: Need to calculate pagination value using a formula
Example: Skip Parameter
Configuration Steps
Add Computed Field
Name:
Skip RecordsParameter Name:
skipParameter Type:
customField Type:
computedParameter Location:
queryComputed Rule:
iteration * 20Max Iterations:
50
Test Configuration
Iteration 1:
skip=20(1 * 20)Iteration 2:
skip=40(2 * 20)Iteration 3:
skip=60(3 * 20)
Common Computed Rules
iteration * 20
20, 40, 60
(iteration - 1) * 50
0, 50, 100
iteration * 10 + 5
15, 25, 35
iteration * 100
100, 200, 300
Expected Behavior
Iteration 1:
GET /items?skip=20Iteration 2:
GET /items?skip=40Iteration 3:
GET /items?skip=60Value calculated using the formula each iteration
Scenario 6: Pagination with Stop Conditions
Use Case: Stop pagination when certain conditions are met (e.g., empty data, null next cursor)
Example: Stop When Data is Empty
Configuration Steps
Add Pagination Field (e.g., page-based)
Configure your pagination as usual
Add Stop Condition
Name:
Empty Data CheckSource:
stop_conditionLogic Operator:
ORRules:
Rule 1:
Field:
$.body.dataOperator:
isEmpty
Rule 2:
Field:
$.body.itemsOperator:
isEmpty
Test Configuration
Test iterations until you reach an empty response
System should stop automatically when condition is met
Status should show "Stop condition met"
Common Stop Conditions
Stop When Next Cursor is Null
Stop When Has More is False
Stop When Data Array is Empty
Available Operators
Equality:
equals,notEqualsNull Checks:
isNull,isNotNullEmpty Checks:
isEmpty,isNotEmptyComparison:
greaterThan,lessThan,greaterThanOrEqual,lessThanOrEqualString:
contains,notContains,startsWith,endsWith
Logic Operators
AND: All rules must be true
OR: At least one rule must be true
Scenario 7: Pagination in Request Body
Use Case: API requires pagination parameters in the request body (POST/PUT requests)
Example API
Configuration Steps
Add Pagination Field
Name:
Page NumberParameter Name:
pageParameter Type:
pageField Type:
staticParameter Location:
body⚠️ Important: Select "body"Start Value:
1Max Iterations:
50
Add Page Size Field (if needed)
Name:
Page SizeParameter Name:
pageSizeParameter Type:
customField Type:
staticParameter Location:
bodyStatic Value:
20
Test Configuration
Verify the request body includes pagination parameters
Check that page number increments correctly
Expected Behavior
Iteration 1: Body contains
{"page": 1, "pageSize": 20}Iteration 2: Body contains
{"page": 2, "pageSize": 20}Iteration 3: Body contains
{"page": 3, "pageSize": 20}
Important Notes
Body pagination works with JSON request bodies
Existing body parameters are preserved
Pagination parameters are merged into the JSON body
Scenario 8: Pagination in Headers
Use Case: API requires pagination token in request headers
Example API
Configuration Steps
Add Pagination Field
Name:
Page TokenParameter Name:
X-Page-TokenParameter Type:
cursor(if token comes from response)Field Type:
jsonpathParameter Location:
header⚠️ Important: Select "header"JSONPath:
$.body.next_tokenMax Iterations:
100
Test Configuration
Verify headers include the pagination token
Check that token updates from response
Expected Behavior
Iteration 1: Header
X-Page-Token: (none or initial value)Iteration 2: Header
X-Page-Token: abc123(from iteration 1 response)Iteration 3: Header
X-Page-Token: def456(from iteration 2 response)
Last updated