> ## Documentation Index
> Fetch the complete documentation index at: https://solidroad.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Lists

> Every list endpoint takes the same four parameters and returns the same page shape.

## Parameters

| Parameter | Default | Meaning |
| - | - | - |
| `limit` | `50` | The number of records on a page, from 1 to 100. |
| `cursor` | none | The `nextCursor` value from the previous page. |
| `order` | `desc` | `asc` (oldest first) or `desc` (newest first), on the list's sort time. |
| `filter` | none | A CEL expression over the list's filter fields. Read [Filtering](https://solidroad.mintlify.site/api-reference/v2/filtering.md). |

A list endpoint refuses a query parameter that it does not take, with a `400`. A misspelled parameter does not silently return every record.

## Page shape

```json theme={null}
{
  "data": [],
  "hasMore": true,
  "nextCursor": "eyJhdCI6IjIwMjYtMTAtMjhUMDk6MTQ6MDIuNTExWiIsImtleSI6ImFzZ18wMDAwMDAwMC0wMDAwLTQwMDAtODAwMC0wMDAwMDAwMDAwMDIiLCJzY29wZSI6IlhxM24wYlFrN3NUekx3MlZoWWM5YUEifQ"
}
```

| Field | Type | Meaning |
| - | - | - |
| `data` | array | The records on this page. |
| `hasMore` | boolean | `true` when there is another page. |
| `nextCursor` | string | Only when `hasMore` is `true`. Send it as `cursor` to get the next page. |

## Read every page

1. Send the first request without a `cursor`.
2. If `hasMore` is `false`, stop.
3. Send the same request again, with `cursor` set to `nextCursor`.
4. Go to step 2.

```bash theme={null}
curl --get https://api.solidroad.com/v2/assignments \
  -H "Authorization: Bearer $SOLIDROAD_API_KEY" \
  --data-urlencode "limit=100" \
  --data-urlencode "cursor=$NEXT_CURSOR"
```

Send the same `filter` and `order` with every page. A cursor is tied to the `filter` and `order` of the request that returned it. If you change either one, the API returns `400` with `code` `invalid_request`. To use a different filter, start again without a cursor. You can change `limit` between pages.

A cursor is opaque: do not read it, change it or make your own. Cursors do not expire.

## Sort order

Each list sorts on one field, then on `id` when two records have the same time:

| List | Sorts on |
| - | - |
| `GET /v2/assignments` | `updatedAt` |
| `GET /v2/assignments/{id}/enrollments` | `updatedAt` |
| `GET /v2/enrollments` | `updatedAt` |
| `GET /v2/people` | `createdAt` |
| `GET /v2/groups` | `updatedAt` |
| `GET /v2/groups/{id}/members` | `addedAt` |
| `GET /v2/groups/{id}/leads` | `personId` |

Records that have the same time are not skipped or repeated across pages.

## Filter

The `filter` parameter narrows a list to the records you need, such as the open assignments that are due this month. It is written in a small part of [CEL](https://cel.dev). Each list has its own filter fields, on its endpoint page.

Read [Filtering](https://solidroad.mintlify.site/api-reference/v2/filtering.md) for the syntax, examples and limits.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.