Pagination

API calls that return lists of items may have a large number of results, such as when fetching the murals in a workspace. Instead of returning all the results at once, we return a single page of results and information on how to retrieve the next page. This strategy is called pagination.

Calling a paginated endpoint

When calling a paginated endpoint the response contains a list of items in the value field and a token to get the next page of items in the next field.

For example, calling Get murals for a workspace returns data like:

{
    "value": [
        {
            "id": "1",
            "name": "Workspace 1"
        },
        ...
        {
            "id": "100",
            "name": "Workspace 100"
        }
    ],
    "next": "<token>"
}

To retrieve the next page, pass the value of next as a query parameter:

GET /api/public/v1/workspaces?next=<token>

When no more pages are available, the next field does not appear in the response.

Page size

Each resource type has its own default page size of 100 or fewer, but you can limit the number of results returned per page with the limit query parameter:

GET /api/public/v1/workspaces?limit=10

Each subsequent request to retrieve the remaining pages must specify the same value for limit:

GET /api/public/v1/workspaces?limit=10&next=<token>