# List your requests

> The calls your API keys made in `[start, end)`, newest first.

`GET https://api.refabric.com/v1/account/requests`

**Expansions**

- `payloads` — each call's request and response body (masked, cut at 32 KiB; `*_truncated` says so). Without it a row has no body fields.

**Filters and sorting**

- `status` takes a class (`4xx`) or one status (`429`); `path` matches the start of the path; `api_key_id` one of your keys.

**Authentication.** A key with `account:read`: the log shows your keys' calls and their bodies.

**Key features**

- Pages of 20 rows by default, 100 at most; newest first.
- Calls are kept 30 days; a window of 90 days at most.

**Common use cases**

- Find why a call failed: its status, error and body.
- Quote a call's `request_id` to support.

**See also**

- `GET /v1/account/metrics`
- `GET /v1/errors`

Authentication: `Authorization: Key $REFABRIC_API_KEY`, scope `account:read`.

## Query parameters

- `limit` (integer, _optional_, default: `20`, 1 to 100) — Items per page: default 20, at most 100.
- `cursor` (string | null, _optional_) — The previous page's `next_cursor`, copied back as it came, for the next page. Never build one.
- `start` (string | null, _optional_, format: date-time) — Inclusive, ISO-8601 (`2026-09-01T00:00:00Z`; no zone means UTC). Default: 30 days before `end`. The window is at most 90 days.
- `end` (string | null, _optional_, format: date-time) — Exclusive, ISO-8601 (no zone means UTC). Default: now.
- `api_key_id` (string | null, _optional_) — Only calls made with this key of yours (`key_…`).
- `status` (string | null, _optional_) — A status class (`4xx`) or one status (`429`).
- `path` (string | null, _optional_) — Only calls whose path starts with this (`/v1/tasks`).
- `expand` (array<string> | null, _optional_) — `payloads`: add each call's request and response body (masked, cut at the kept size; `*_truncated` says so). Without it a row carries no body fields.
  Values: `payloads` (Each call's request and response body, masked and cut at the kept size.)

## Header parameters

- `Refabric-Version` (string, _optional_, format: date) — The contract version you wrote against (a date). Absent: the current version.
- `X-Request-ID` (string, _optional_, max length 128) — Your own id for this request; we answer it back under X-Client-Request-ID.

## Response 200

Done: the answer is in the body.

- `items` (array<object>, _required_) — This page's items, in the listing's order.
  - `id` (string, _required_) — The row's id.
    Example: `rl_01`
  - `at` (string, _required_) — When the call arrived (UTC).
    Example: `2026-09-30T10:00:00Z`
  - `method` (string, _required_) — The HTTP method.
    Example: `POST`
  - `path` (string, _required_) — The path called, without its query string.
    Example: `/v1/tasks/image.generate`
  - `status` (integer, _required_) — The HTTP status we answered.
    Example: `422`
  - `error` (object | null, _required_) — The error the call was answered with, or `null`.
    Example: `{"code":"invalid_option","field":"aspect_ratio"}`
    - `code` (string, _required_) — The public error code.
      Example: `invalid_option`
    - `field` (string | null, _required_) — The field the error names, or `null`.
      Example: `aspect_ratio`
  - `request_id` (string | null, _required_) — The call's `X-Request-ID` — quote it to support.
    Example: `req_01`
  - `api_key` (object, _required_) — The key the call was made with.
    Example: `{"id":"key_8f3a","last4":"Q2x9","name":"production"}`
    - `id` (string, _required_) — The key's id.
      Example: `key_8f3a`
    - `name` (string, _required_) — The key's current name.
      Example: `production`
    - `last4` (string, _required_) — The last four characters of the secret.
      Example: `Q2x9`
  - `job_id` (string | null, _required_) — The job this call started, or `null`.
  - `duration_ms` (integer, _required_) — How long we took to answer.
    Example: `41`
  - `ip` (string | null, _required_) — The address the call came from.
    Example: `203.0.113.9`
  - `idempotency_key` (string | null, _required_) — The `Idempotency-Key` you sent, or `null`.
    Example: `order-1234`
  - `request_body` (string | null, _optional_) — The request body as JSON text, masked and cut at the kept size; `null` when there was none. Only with `expand=payloads`.
    Example: `{"prompt": "A linen dress"}`
  - `request_body_truncated` (boolean | null, _optional_) — Whether the request body was cut. Only with `expand=payloads`.
    Example: `false`
  - `response_body` (string | null, _optional_) — The answer's body as JSON text, masked and cut at the kept size; `null` when there was none. Only with `expand=payloads`.
    Example: `{"job_id": "j_01"}`
  - `response_body_truncated` (boolean | null, _optional_) — Whether the answer's body was cut. Only with `expand=payloads`.
    Example: `false`
- `has_more` (boolean, _required_) — Whether another page follows this one.
  Example: `false`
- `as_of` (string, _required_) — The moment these figures were read (UTC, ISO-8601).
  Example: `2026-10-01T00:00:00Z`
- `start` (string, _required_) — The window's first instant, inclusive (UTC).
  Example: `2026-09-01T00:00:00Z`
- `end` (string, _required_) — The window's end, exclusive (UTC); without `end` sent, `as_of`.
  Example: `2026-10-01T00:00:00Z`
- `next_cursor` (string | null, _optional_) — Send it back as `cursor` for the next page. Absent on the last page. Opaque: never build or edit one.
  Example: `eyJsIjoiY2hhbmdlbG9nIn0`

```json
{
  "items": [],
  "next_cursor": "eyJsIjoiY2hhbmdlbG9nIn0",
  "has_more": false,
  "as_of": "2026-10-01T00:00:00Z",
  "start": "2026-09-01T00:00:00Z",
  "end": "2026-10-01T00:00:00Z"
}
```

## Response 400

The request cannot be read as it was sent (a header, the URL or the body's form).

```json
{
  "error": {
    "code": "string",
    "type": "invalid_request",
    "message": "string",
    "field": "string",
    "retryable": true,
    "docs": "string",
    "request_id": "string",
    "ctx": {
      "required": 0,
      "balance": 0,
      "retry_after": 0
    },
    "input": null,
    "job_id": "string",
    "required": 0,
    "balance": 0
  }
}
```

## Response 401

No valid API key was sent.

```json
{
  "error": {
    "code": "string",
    "type": "invalid_request",
    "message": "string",
    "field": "string",
    "retryable": true,
    "docs": "string",
    "request_id": "string",
    "ctx": {
      "required": 0,
      "balance": 0,
      "retry_after": 0
    },
    "input": null,
    "job_id": "string",
    "required": 0,
    "balance": 0
  }
}
```

## Response 403

Your key or your plan does not allow this.

```json
{
  "error": {
    "code": "string",
    "type": "invalid_request",
    "message": "string",
    "field": "string",
    "retryable": true,
    "docs": "string",
    "request_id": "string",
    "ctx": {
      "required": 0,
      "balance": 0,
      "retry_after": 0
    },
    "input": null,
    "job_id": "string",
    "required": 0,
    "balance": 0
  }
}
```

## Response 422

A field is missing or has a value this operation cannot use.

```json
{
  "error": {
    "code": "string",
    "type": "invalid_request",
    "message": "string",
    "field": "string",
    "retryable": true,
    "docs": "string",
    "request_id": "string",
    "ctx": {
      "required": 0,
      "balance": 0,
      "retry_after": 0
    },
    "input": null,
    "job_id": "string",
    "required": 0,
    "balance": 0
  }
}
```

## Response 429

Too many requests: wait for the number of seconds in the Retry-After header.

```json
{
  "error": {
    "code": "string",
    "type": "invalid_request",
    "message": "string",
    "field": "string",
    "retryable": true,
    "docs": "string",
    "request_id": "string",
    "ctx": {
      "required": 0,
      "balance": 0,
      "retry_after": 0
    },
    "input": null,
    "job_id": "string",
    "required": 0,
    "balance": 0
  }
}
```

## Response 500

Something went wrong on our side; retry, and quote the request id if it keeps happening.

```json
{
  "error": {
    "code": "string",
    "type": "invalid_request",
    "message": "string",
    "field": "string",
    "retryable": true,
    "docs": "string",
    "request_id": "string",
    "ctx": {
      "required": 0,
      "balance": 0,
      "retry_after": 0
    },
    "input": null,
    "job_id": "string",
    "required": 0,
    "balance": 0
  }
}
```

## Request

```python
import os
import requests

url = "https://api.refabric.com/v1/account/requests"

headers = {"Authorization": f"Key {os.environ['REFABRIC_API_KEY']}"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.refabric.com/v1/account/requests';
const options = {method: 'GET', headers: {Authorization: `Key ${process.env.REFABRIC_API_KEY}`}};

try {
    const response = await fetch(url, options);
    const data = await response.json();
    console.log(data);
} catch (error) {
    console.error(error);
}
```

```bash
curl --request GET \
    --url https://api.refabric.com/v1/account/requests \
    --header "Authorization: Key $REFABRIC_API_KEY"
```
