---
title: "Pagination and filtering"
description: "How listing works per endpoint group, and how to filter and sort data objects."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination and filtering

Pagination is **not uniform** across the API. Each group paginates the way that fits its data. Data objects have the richest filtering and sorting. This page covers both.

## Pagination by group

#### Files

`?limit` (default 50, max 200). **No cursor**. You get a single most-recent page.

```bash
curl "https://api.cloudraker.com/spaces/{spaceId}/files?limit=50" \
  -H "Authorization: Bearer $RAKERONE_API_KEY"
```


#### Objects

`?limit` (1–200, default 50) + `?offset` (default 0). The response is `{ objects, nextOffset }`. `nextOffset` is `null` when the list is exhausted.

```bash
curl "https://api.cloudraker.com/spaces/{spaceId}/objects/{definitionId}?limit=50&offset=0" \
  -H "Authorization: Bearer $RAKERONE_API_KEY"
```


#### Playbook runs

`?limit` (1–100) + `?starting_after` (a cursor).

```bash
curl "https://api.cloudraker.com/spaces/{spaceId}/playbook-runs?limit=25&starting_after=<runId>" \
  -H "Authorization: Bearer $RAKERONE_API_KEY"
```

## Filtering data objects

`GET /spaces/{spaceId}/objects/{definitionId}` accepts three query parameters that shape the result set:

- **`filter`** — a JSON array of entries `{ fieldKey, subField?, operand, value }`.
- **`sort`** — a JSON array of `{ fieldKey, direction }`. `direction` is `"asc"` or `"desc"`. The default sort is `createdAt` descending.
- **`view`** — a saved-view id. Its stored filters and sorts apply instead. It is **mutually exclusive** with `filter`/`sort`. Both together return `400 invalid_request`. An unknown or wrong-scope view returns `404 view_not_found`.

`subField` targets a nested field of a composite, for example a `city` inside an address.

> **Warning**
>
> An unknown or archived field in `filter`/`sort` returns `422`. A `$`-injection attempt also returns `422`.

### Operands

There are 14 filter operands:

| Operand | Meaning |
|---|---|
| `is` | Equals |
| `is_not` | Not equal |
| `is_empty` | Field has no value |
| `is_not_empty` | Field has a value |
| `contains` | Substring match |
| `does_not_contain` | Negated substring match |
| `gt` | Greater than |
| `gte` | Greater than or equal |
| `lt` | Less than |
| `lte` | Less than or equal |
| `is_before` | Date before |
| `is_after` | Date after |
| `is_any_of` | Value in a list |
| `includes` | List field includes value(s) |

### Example

Filter to unpaid Acme invoices, newest first:

```bash
curl -G "https://api.cloudraker.com/spaces/{spaceId}/objects/{definitionId}" \
  -H "Authorization: Bearer $RAKERONE_API_KEY" \
  --data-urlencode 'filter=[{"fieldKey":"vendor","operand":"is","value":"Acme"},{"fieldKey":"status","operand":"is_not","value":"paid"}]' \
  --data-urlencode 'sort=[{"fieldKey":"invoiceDate","direction":"desc"}]'
```

### Returned objects

Each object in the response carries its inline `data` and `fieldMeta`. When present, it also carries:

- **`provenance`** / **`review`** — for AI-imported values (source citations and approval state).
- **`origin`** — `{ actionRunId?, playbookRunId? }` for values produced by an action or playbook run.

## Where to go next

[**Errors**](https://docs.cloudraker.com/paperwork/developers/errors)

Status codes and error codes across the API.


[**API reference**](https://docs.cloudraker.com/paperwork/api)

Full request and response schemas for every list endpoint.

Source: https://docs.cloudraker.com/paperwork/developers/pagination-filtering/index.mdx
