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

# List captured query parameters

> One row per query parameter of every matching page view, newest first: e.g.

```ts TypeScript wrap theme={"dark"}
import { createSiteClient } from '@fetchski/attract-cms-sdk';

const site = createSiteClient();
const requestLogParamPage = await site.requestLog().listRequestLogParams();
```

```json 200 wrap theme={"dark"}
{
  "params": [
    {
      "requestId": "clx8m2k4p0000a1b2c3d4e5f6",
      "createdAt": "2026-10-24T09:30:00.000Z",
      "key": "Example key",
      "value": "Example value",
      "group": "Example group",
      "path": "Example path",
      "url": "https://acme.example/example",
      "visitorId": "clx8m2k4p0000a1b2c3d4e5f6",
      "country": "Example country",
      "referrer": "Example referrer"
    }
  ],
  "total": 1,
  "page": 1,
  "perPage": 20,
  "totalPages": 1
}
```

## In your app

A function makes the call on the client it is given, so your code passes the real one and a test passes a fake.

**1. Add the function**

```ts src/attract/list-request-log-params.ts theme={"dark"}
import type { SiteClient } from '@fetchski/attract-cms-sdk';

export async function listRequestLogParams(site: SiteClient) {
  return site.requestLog().listRequestLogParams();
}
```

**2. Call it**

A script makes the client once and calls the function:

```ts scripts/list-request-log-params.ts theme={"dark"}
import { createSiteClient } from '@fetchski/attract-cms-sdk';
import { listRequestLogParams } from '../src/attract/list-request-log-params.ts';

const site = createSiteClient();
console.log(await listRequestLogParams(site));
```

```bash Terminal theme={"dark"}
node --env-file=.env scripts/list-request-log-params.ts
```

A route handler, a job or a queue worker calls it the same way.

`?key=gclid&from=2026-07-01` lists every Google click ID with its visitor.

The same filters as the page-view list; `key` and `group` apply to each parameter.

> [accordion] Optional parameters
>
> One object, e.g. `listRequestLogParams({ from })`; leave out the optional fields.
>
> **from** `Date | string | null | undefined`
>
> **Optional.** Leave it out (or pass `null`) and it isn’t sent: the site’s default applies. Captured at or after this ISO 8601 date or date-time. Format: an ISO 8601 date and time.
>
> **to** `Date | string | null | undefined`
>
> **Optional.** Leave it out (or pass `null`) and it isn’t sent: the site’s default applies. Captured at or before this ISO 8601 date or date-time. Format: an ISO 8601 date and time.
>
> **pathPrefix** `string | null | undefined`
>
> **Optional.** Leave it out (or pass `null`) and it isn’t sent: the site’s default applies. Only paths starting with this, e.g. `/blog`.
>
> **visitorId** `string | null | undefined`
>
> **Optional.** Leave it out (or pass `null`) and it isn’t sent: the site’s default applies. Only this visitor (the `fetchski_vid` UUID).
>
> **country** `string | null | undefined`
>
> **Optional.** Leave it out (or pass `null`) and it isn’t sent: the site’s default applies. Only this two-letter country code, e.g. `US`. Matches `^[A-Za-z]{2}$`.
>
> **status** `number | null | undefined`
>
> **Optional.** Leave it out (or pass `null`) and it isn’t sent: the site’s default applies. Only this HTTP status, e.g. `404`. At least 100.
>
> **notFound** `boolean | null | undefined`
>
> **Optional.** Leave it out (or pass `null`) and it isn’t sent: the site’s default applies. Only page views that did (`true`) or did not (`false`) find a page.
>
> **group** `string | null | undefined`
>
> **Optional.** Leave it out (or pass `null`) and it isn’t sent: the site’s default applies. Only rows with a parameter in this group, e.g. `ads` or `utm`.
>
> **key** `string | null | undefined`
>
> **Optional.** Leave it out (or pass `null`) and it isn’t sent: the site’s default applies. Only rows with this query parameter (case-insensitive), e.g. `gclid`.
>
> **paramKey** `string | null | undefined`
>
> **Optional.** Leave it out (or pass `null`) and it isn’t sent: the site’s default applies. The same as `key` (`paramKey` wins when both are sent).
>
> **page** `number | null | undefined`
>
> **Optional.** Leave it out and the site uses `1`. Page number, from 1 (a page past the end answers the last page).
>
> **perPage** `number | null | undefined`
>
> **Optional.** Leave it out and the site uses `25`. Rows per page. 1 to 100.

> [accordion] Returns
>
> A `RequestLogParamPage`. A page of query parameters. Read its properties (`requestLogParamPage.params`): each says whether the site always sends it.
>
> **params** `readonly RequestLogParamRow[]`
>
> **Always sent.** A list of `RequestLogParamRow`.
>
> **RequestLogParamRow**
>
> One query parameter of one captured page view.
>
> **requestId** `string`
>
> **Always sent.** The page view’s `_id`.
>
> **createdAt** `Date`
>
> **Always sent.** Format: an ISO 8601 date and time.
>
> **key** `string`
>
> **Always sent.**
>
> **value** `string`
>
> **Always sent.**
>
> **group** `string | null`
>
> **Always sent, can be `null`.** The group a classification rule put it in.
>
> **path** `string`
>
> **Always sent.**
>
> **url** `string`
>
> **Always sent.**
>
> **visitorId** `string | null`
>
> **Always sent, can be `null`.** Set only with Analytics or Marketing consent.
>
> **country** `string | null`
>
> **Always sent, can be `null`.** Two-letter country code.
>
> **referrer** `string | null`
>
> **Always sent, can be `null`.** Origin + path with consent, origin only without.
>
> **total** `number`
>
> **Always sent.** Every match, across all pages.
>
> **page** `number`
>
> **Always sent.**
>
> **perPage** `number`
>
> **Always sent.**
>
> **totalPages** `number`
>
> **Always sent.** At least 1.

> [accordion] Errors
>
> Nothing to catch: the SDK retries what is safe, and throws the rest as the classes below; catch only what you want to react to (see [Errors and testing](https://docs.fetchski-attract.com/typescript/errors.md)).
>
> **AuthenticationFailed** `401`
>
> The API key is missing, malformed, unknown, disabled, expired or archived, or a request its signing mode requires to be signed is not.
>
> **Retried first:** No. **Read:** `siteMessage`, `errorName`, `data`.
>
> **Forbidden** `403`
>
> The API key lacks the scope this route needs (the message names it) or is used from outside its allowlist; or, on a route that answers 403 to everyone it refuses, the caller may not use it.
>
> **Retried first:** No. **Read:** `siteMessage`, `errorName`, `data`.
>
> **NotFound** `404`
>
> Nothing matches the identifier, or the caller may not use this route at all (it is not advertised).
>
> **Retried first:** No. **Read:** `siteMessage`, `errorName`, `data`.
>
> **RateLimited** `429`
>
> The key used up its per-minute limit. Still, after the client’s own waits and retries.
>
> **Retried first:** Yes: the client waits `Retry-After` (1 s when absent; over 60 s it gives up at once) and retries, up to `retries` times (2 by default). **Read:** `retryAfter` (seconds, or null), `siteMessage`.
>
> **SiteError** `5xx`
>
> The site failed (or something in front of it did). Its logs say why.
>
> **Retried first:** A 502, 503 or 504: yes, after 0.5 s then 1 s. A 500: no. **Read:** `siteMessage`, `errorName`, `data`.
>
> **SiteUnreachable** `no answer`
>
> No answer: DNS, a refused connection, TLS, or the timeout (15 s per attempt by default).
>
> **Retried first:** Yes, after 0.5 s then 1 s. **Read:** `reason`, `neverConnected`.
>
> **RequestNotSent** `not sent`
>
> The client refused to send it (e.g. a path segment of `..`); the site never saw it.
>
> **Retried first:** No. **Read:** `reason` (what to change).
>
> **SiteRequestFailed** `any other`
>
> Any other status, or a success whose JSON doesn’t match this SDK version’s types (update the SDK).
>
> **Retried first:** No. **Read:** `reason`, `status`.
>
> **UnknownSite** `setup`
>
> `sites.forSite('acme')` named a slug your sites (`createSiteClients()`) don’t have.
>
> **Retried first:** No: nothing was sent. **Read:** `message`, `slug`.
>
> **SiteConfigurationError** `setup`
>
> The client’s settings are wrong: no `FETCHSKI_ATTRACT_URL` (or `baseUrl`), or a malformed API key.
>
> **Retried first:** No: nothing was sent. **Read:** `message` (what to fix).

## Behavior

* **Access:** an API key with `request-log:params:read`, or `ads:all`, or `admin:all`, or a signed-in user holding the `request-log:view` permission. Other callers get 404.
* **Rate limit:** the key’s own reads-per-minute limit, set when the key is created (default 600); over it, 429 with `Retry-After`. The client waits and retries for you; you see `RateLimited` only if that runs out.
* **Retries:** a read is safe to repeat: the client retries it on no answer, a 502/503/504 and a 429.
* **Timeout:** 15 s per attempt by default; raise `timeout` (milliseconds) on the client for longer.
* **Paging:** one page per call. To walk them all, use `listRequestLogParamsAll()` (see More examples): it asks for the next page as you iterate, and stops after page `totalPages`.

## More examples

`listRequestLogParamsAll()` takes `listRequestLogParams()`’s arguments except `page`.

```ts Every page wrap theme={"dark"}
import { createSiteClient } from '@fetchski/attract-cms-sdk';

const site = createSiteClient();
for await (const requestLogParamRow of site.requestLog().listRequestLogParamsAll()) {
  console.log(requestLogParamRow); // the next page is fetched as you iterate
}
```

## Test it

It calls the function above with a fake client: the fake answers every call with a valid example, so nothing leaves your machine and no settings or key are needed. Run it with `node --test`.

```ts tests/requestLog-listRequestLogParams.test.ts theme={"dark"}
import { test } from 'node:test';
import { fakeSite } from '@fetchski/attract-cms-sdk/testing';
import { listRequestLogParams } from '../src/attract/list-request-log-params.ts';

test('requestLog.listRequestLogParams', async () => {
  const site = fakeSite();
  await listRequestLogParams(site);
  site.assertCalled('requestLog.listRequestLogParams');
});
```

**Answer with your own values:** fake `requestLog.listRequestLogParams` with a `sequence()` of pages, each `factories.RequestLogParamPage({...})`, and walk `listRequestLogParamsAll()`.

```ts tests/requestLog-listRequestLogParams-answer.test.ts theme={"dark"}
import assert from 'node:assert/strict';
import { test } from 'node:test';
import { factories, fakeSite, sequence } from '@fetchski/attract-cms-sdk/testing';

test('requestLog.listRequestLogParams answers your values', async () => {
  const site = fakeSite({
    'requestLog.listRequestLogParams': sequence(
      factories.RequestLogParamPage({ page: 1, totalPages: 2 }),
      factories.RequestLogParamPage({ page: 2, totalPages: 2 })
    )
  });
  const walked: unknown[] = [];
  for await (const requestLogParamRow of site.requestLog().listRequestLogParamsAll()) {
    walked.push(requestLogParamRow);
  }
  assert.equal(walked.length, 2);
});
```

To fake `listRequestLogParamsAll()`, answer `requestLog.listRequestLogParams` (the walk calls it page by page): a `sequence()` of answers for several pages.

## Related

> [card] [List captured page views](https://docs.fetchski-attract.com/typescript/reference/request-log/list-request-log-entries.md)
>
> `site.requestLog().listRequestLogEntries()`

> [card] [GET /request-log/params](https://docs.fetchski-attract.com/api-reference/request-log/list-captured-query-parameters.md)
>
> The endpoint this calls, in the API reference: the HTTP request and answer, and every rule the site checks.


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