The IT Management API primarily uses cursor-based pagination. A small number of endpoints (users) use page-number pagination.
Most list endpoints (people / services / devices / identity / event-logs / contracts / alerts, etc.) use cursor-based pagination.
Request Parameters
| Parameter | Type | Default | Maximum | Description |
|---|
cursor | string | — | — | The nextCursor value from the previous response. Omit to start from the beginning |
limit | number | — | 200 | Number of items to return per request |
For the event-logs endpoint, the request parameter is named nextCursor instead of cursor.
{
"meta": {
"nextCursor": "F3UdkoSbpBNrjwP93AX2HQ",
"totalItems": 100
},
"items": [
// Array of resources
]
}
Response Fields
| Field | Type | Description |
|---|
meta.nextCursor | string | null | Cursor for the next page. null when on the last page |
meta.totalItems | integer | null | Total item count. May be null |
items | array | Array of resources |
Examples
# Retrieve the first page
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.itmc.i.moneyforward.com/api/v1/organizations/YOUR_ORG_ID/people?limit=50"
# Retrieve the next page (using nextCursor from previous response)
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.itmc.i.moneyforward.com/api/v1/organizations/YOUR_ORG_ID/people?cursor=F3UdkoSbpBNrjwP93AX2HQ&limit=50"
async function fetchAllPeople(orgId) {
const allItems = [];
let cursor = undefined;
do {
const params = new URLSearchParams({ limit: '200' });
if (cursor) params.set('cursor', cursor);
const response = await fetch(
`https://api.itmc.i.moneyforward.com/api/v1/organizations/${orgId}/people?${params}`,
{ headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
);
const data = await response.json();
allItems.push(...data.items);
cursor = data.meta.nextCursor;
} while (cursor);
return allItems;
}
GET /api/v1/organizations/{id}/users uses page-number pagination.
Request Parameters
| Parameter | Type | Description |
|---|
page | number | Page number (1-indexed) |
limit | number | Items per page |
{
"metadata": {
"prevPage": 1,
"nextPage": 3
},
"users": [
// Array of users
]
}
Best Practices
- Loop until
nextCursor is null to retrieve all items
- Avoid setting
limit higher than necessary (maximum: 200)
- Do not rely on
totalItems for loop termination — use nextCursor instead, as totalItems may be null