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:

  1. Read the calendar and page through the results using pageToken / nextPageToken as above.
  2. On the final page, the response includes a nextSyncToken.
  3. Later, call the same endpoint with syncToken set to that value. The response contains only the events that changed since, with deleted events returned as isCancelled: true, and a fresh nextSyncToken for 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

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}"

Was this page helpful?