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

# List all rules

> List rules with pagination. **Required scope:** read

List rules with pagination.

**Required scope:** `read`

### Query parameters

<ParamField query="limit" type="integer">
  Maximum number of items to return (1-1000, default: 50)
</ParamField>

<ParamField query="offset" type="integer">
  Number of items to skip (default: 0)
</ParamField>

<ParamField query="cursor" type="string">
  Cursor for cursor-based pagination (alternative to offset)
</ParamField>

<ParamField query="sort" type="string">
  Sort field with optional direction prefix (- for descending) Examples: 'created\_at', '-name', 'confidence'
</ParamField>

### Response

`PaginatedRuleListResponse`

<ResponseField name="items" type="any[]" required>
  The items in this page
</ResponseField>

<ResponseField name="pagination" type="PaginationMeta" required>
  <Expandable title="PaginationMeta">
    <ResponseField name="has_more" type="boolean" required>
      Whether there are more items after this page
    </ResponseField>

    <ResponseField name="limit" type="integer" required>
      Current page limit
    </ResponseField>

    <ResponseField name="next_cursor" type="string">
      Cursor for the next page (if using cursor-based pagination)
    </ResponseField>

    <ResponseField name="offset" type="integer" required>
      Current offset
    </ResponseField>

    <ResponseField name="prev_cursor" type="string">
      Cursor for the previous page
    </ResponseField>

    <ResponseField name="total" type="integer">
      Total number of items (if available)
    </ResponseField>
  </Expandable>
</ResponseField>

### Status codes

| Code  | Meaning                                            |
| ----- | -------------------------------------------------- |
| `200` | Paginated list of the org's rules                  |
| `401` | Unauthorized — missing or invalid credentials      |
| `403` | Forbidden — the key/token lacks the required scope |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.nsr.stateset.com/api/v1/rules' \
    --header 'X-API-Key: YOUR_API_KEY'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "items": [],
    "pagination": {
      "has_more": true,
      "limit": 20,
      "next_cursor": "string",
      "offset": 1,
      "prev_cursor": "string",
      "total": 102
    }
  }
  ```
</ResponseExample>
