Documentation Index
Fetch the complete documentation index at: https://apidocs.hopnow.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
List endpoints in the HopNow API use page-based pagination to handle large result sets efficiently.
Parameters
All list endpoints support these query parameters:
| Parameter | Type | Default | Description |
page | integer | 1 | Page number (starts from 1) |
size | integer | 10 | Number of items per page (1-100) |
Example Request
GET /v1/customers/{customer_id}/accounts?page=2&size=20
Paginated responses include metadata about the result set:
{
"items": [
{
"id": "acct_1234567890abcdef",
"name": "Account 1",
"status": "active",
"created": "2024-01-01T00:00:00Z"
},
{
"id": "acct_fedcba0987654321",
"name": "Account 2",
"status": "active",
"created": "2024-01-02T00:00:00Z"
}
],
"total": 150,
"page": 2,
"size": 20,
"pages": 8
}
Response Fields
| Field | Type | Description |
items | array | Array of objects for the current page |
total | integer | Total number of items |
page | integer | Current page number |
size | integer | Number of items per page |
pages | integer | Total number of pages |
First Page
GET /v1/customers/{customer_id}/accounts?page=1&size=25
Next Page
GET /v1/customers/{customer_id}/accounts?page=2&size=25
Last Page
# If pages = 8
GET /v1/customers/{customer_id}/accounts?page=8&size=25
Code Examples
def get_all_accounts(client, customer_id):
accounts = []
page = 1
while True:
response = client.get(
f"/v1/customers/{customer_id}/accounts",
params={"page": page, "size": 100}
)
data = response.json()
accounts.extend(data["items"])
if page >= data["pages"]:
break
page += 1
return accounts
Best Practices
Choose Appropriate Page Sizes
- Interactive UI: 10-25 items per page
- Bulk processing: 50-100 items per page
- Maximum allowed: 100 items per page
Handle Empty Results
response = client.get("/v1/customers/{customer_id}/accounts")
data = response.json()
if not data["items"]:
print("No accounts found")
else:
print(f"Found {len(data['items'])} accounts on this page")
Monitor Total Count
The total count helps track collection changes:
first_response = client.get("/v1/accounts", params={"page": 1})
initial_total = first_response.json()["total"]
# After processing...
last_response = client.get("/v1/accounts", params={"page": 1})
final_total = last_response.json()["total"]
if final_total != initial_total:
print(f"Collection size changed: {initial_total} → {final_total}")