Pagination
In all endpoints where a list is returned, pagination is supported via page tokens. The nextPageToken field is used to paginate the results. When there are no more pages, nextPageToken is either null or omitted from the response, so treat any missing/empty value as "no more pages".
The data will be nested in a data field.
The default page size may vary depending on the endpoint, and can be overridden via a query parameter. Account and subscription lists use limit; calendar and event lists use pageSize. Note that different endpoints may have different maximum limits.
To request the next page, you can pass the pageToken query parameter to the endpoint.
Example using query parameters
In this example, we request the second page of endUserAccounts with a limit of 10.
- Name
limit- Type
- integer
- Description
The number of items to return per page.
- Name
pageToken- Type
- string
- Description
The page number to return.
Manual pagination using cURL
curl -G https://api.apiroc.com/api/v1/endUserAccounts?limit=10&pageToken=123abcd \
-H "x-api-key: {API KEY}"
Paginated response
{
"data": [
{
"id": "example-id-1",
"createdAt": "2025-09-10T13:22:35.983Z",
"updatedAt": "2025-09-10T13:22:35.983Z",
"deletedAt": null,
"email": "example-email-1@example.com",
"externalId": "",
"authorizedScopes": [
"openid",
"email",
"profile",
"User.Read",
"Calendars.ReadWrite"
],
"providerAccountId": "example-account-id-1",
"providerId": "example-provider-id-1",
"applicationId": "example-app-id",
"status": "ACTIVE",
"providerType": "MICROSOFT"
},
{
"id": "example-id-2",
"createdAt": "2025-09-08T15:33:20.209Z",
"updatedAt": "2025-09-08T15:33:20.209Z",
"deletedAt": null,
"email": "example-email-2@example.com",
"externalId": "",
"authorizedScopes": [
"email",
"profile",
"https://www.googleapis.com/auth/calendar.events",
"https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/userinfo.profile",
"https://www.googleapis.com/auth/userinfo.email",
"openid"
],
"providerAccountId": "example-account-id-2",
"providerId": "example-provider-id-2",
"applicationId": "example-app-id",
"status": "ACTIVE",
"providerType": "GOOGLE"
}
],
"nextPageToken": null
}
Incremental sync (sync tokens)
Event endpoints also support incremental sync, so that after an initial read you can fetch only the events that have changed (created, updated, or deleted) rather than re-reading the whole calendar.
The flow is:
- Read the calendar and page through the results using
pageToken/nextPageTokenas above. - On the final page, the response includes a
nextSyncToken. - Later, call the same endpoint with
syncTokenset to that value. The response contains only the events that changed since, with deleted events returned asisCancelled: true, and a freshnextSyncTokenfor the next round.
Tokens are opaque and provider-specific. Always pass nextPageToken and nextSyncToken back unchanged — do not construct, decode, or modify them.
Provider differences
Google Calendar returns a nextSyncToken on the final page automatically.
Microsoft Outlook can only produce a sync token over a bounded time window. To start an Outlook sync, provide both startDateTime and endDateTime — this puts the read into sync mode and a nextSyncToken is returned on the final page. Sync mode returns events non-expanded (recurring series are returned as a single event, the same shape as a normal list — recurring instances are not expanded). Because it uses the Microsoft Graph delta API, sync mode does not apply expandRecurrences, metadataFilters, orderBy, or search, and custom metadata (privateExtendedProperties) is not included on sync results; if you pass any of those options, the read stays a plain listing and no nextSyncToken is returned.
Start an Outlook incremental sync
curl -G "https://api.apiroc.com/api/v1/events/:endUserAccountId/:calendarId" \
--data-urlencode "startDateTime=2026-07-01T00:00:00Z" \
--data-urlencode "endDateTime=2026-08-01T00:00:00Z" \
-H "x-api-key: {API KEY}"