> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

# Get Recent Queries

GET https://fai.buildwithfern.com/queries/{domain}

Reference: https://fern.docs.buildwithfern.com/learn/docs/ai-features/ask-fern/api-reference/query/get-recent-queries

## Authentication

- `Authorization` header (bearer token, required)

## Servers

- `https://fai.buildwithfern.com` (Production, default)
- `https://fai-dev.buildwithfern.com` (Development)
- `http://localhost:8080` (Local)

## Request

### Path parameters

- `domain` (string, required)

### Query parameters

- `page` (integer, optional, nullable) — The page number for pagination
- `limit` (integer, optional, nullable) — The number of queries per page
- `cutoff_time` (datetime, optional, nullable) — Only return queries after this time
- `include_assistant` (boolean, optional, nullable) — Whether to include assistant responses in the results
- `start_date` (datetime, optional, nullable) — The start date of the period to retrieve analytics for
- `end_date` (datetime, optional, nullable) — The end date of the period to retrieve analytics for

## Response

### 200

Successful Response

- `queries` (list of object, required) — List of queries matching the request criteria
  - `query_id` (string, required)
  - `conversation_id` (string, required)
  - `domain` (string, required)
  - `text` (string, required)
  - `role` (string, required)
  - `source` (string, required)
  - `created_at` (datetime, required)
  - `time_to_first_token` (double, optional, nullable)
  - `subqueries` (list of string, optional, nullable)
  - `status` (enum, optional, nullable)
    - Allowed values: `guardrail_blocked`
- `pagination` (object, required) — Pagination information
  - `total` (integer, required)
  - `page` (integer, required)
  - `limit` (integer, required)

## Examples

**Response**

```json
{
  "queries": [
    {
      "query_id": "string",
      "conversation_id": "string",
      "domain": "string",
      "text": "string",
      "role": "string",
      "source": "string",
      "created_at": "2024-01-15T09:30:00Z",
      "time_to_first_token": 1.1,
      "subqueries": [
        "string"
      ],
      "status": "guardrail_blocked"
    }
  ],
  "pagination": {
    "total": 1,
    "page": 1,
    "limit": 1
  }
}
```