> For the complete documentation index, see [llms.txt](https://developerdocs.instructure.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developerdocs.instructure.com/services/journey/api/pagination.md). Agents can also search and read this documentation through its [MCP server](https://developerdocs.instructure.com/~gitbook/mcp).

# Pagination

Journey paginates exclusively at the GraphQL layer. REST endpoints under `https://journey-server-prod.us-east-1.core.inseng.io/api/v1` generally do not support `limit`, `offset`, `page`, `per_page`, or `cursor` query parameters, and they do not emit a `Link` header. List-style queries that need pagination live on the GraphQL schema at `/graphql`.

## GraphQL cursor pagination

Most paginated queries use an opaque cursor and return a `pageInfo` of type `CursorPaginationInfo`.

Input fields (canonical shape):

* `cursor: String` — opaque id of the last item from the previous page; omit for the first page.
* `limit: Int` — page size. Per-query default varies (4–20); max is `100`.
* `forward: Boolean` — `true` for next page, `false` for previous. Defaults to `true`.

Response `pageInfo` carries `nextCursor`, `previousCursor`, `hasNextPage`, `hasPreviousPage`, an optional `totalCount` (populated only when cheap to compute), and an optional `pageCursors` array for jump-to-page UIs. Treat cursors as opaque and pass them back unchanged.

```graphql
query {
  learningLibraryCollections(
    accountId: "1234"
    input: { limit: 20, cursor: "8f1c…", forward: true }
  ) {
    collections { id name }
    pageInfo { nextCursor hasNextPage totalCount }
  }
}
```

Cursor-paginated queries include `learningLibraryCollections`, `learningLibraryCollectionsWithCounts`, `learningLibraryCollectionItems`, and `learnItems`.

## Page-number variants

A few queries use 1-indexed page numbers instead:

* `people` — input takes `page: Int`; response includes `pagination: PaginationInfo { currentPage, totalPages, hasNextPage, hasPreviousPage }`.
* `nonContentLibraryCoursesForAccount` — proxies Canvas's `Link`-header pagination and surfaces it as `CanvasPaginationInfo { page, perPage, totalPages, hasNextPage, hasPreviousPage }`. `totalCount` is always `null` because Canvas does not return it.

## Unpaginated endpoints

Many list-returning GraphQL queries and every REST list-style endpoint return the full result set unbounded — for example `GET /api/v1/prism/conversations` and most `metadata`, `skill-space`, and `program` queries. Expect the entire collection in one response and apply client-side limits if needed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developerdocs.instructure.com/services/journey/api/pagination.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
