> 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://buildwithfern.com/learn/docs/ai-features/ask-fern/api-reference/query/get-recent-queries ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## 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 - `resolution` (enum, optional) — Only return queries whose conversation was resolved or unresolved. Conversations that have not been scored yet are excluded from both filters. - Allowed values: `all`, `resolved`, `unresolved` ## Response ### 200 Successful Response - `queries` (list of Query, required) — List of queries matching the request criteria - `pagination` (PaginationResponse, required) — Pagination information - `conversation_resolutions` (map from string to boolean, optional) — Whether each conversation in `queries` was resolved. Conversations the resolution job has not scored yet are absent. ## Errors ### 422 Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ## Types ### Query - `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` - `origin_page` (string, optional, nullable) ### PaginationResponse - `total` (integer, required) - `page` (integer, required) - `limit` (integer, required) ### ValidationError - `loc` (list of ValidationErrorLocItems, required) - `msg` (string, required) - `type` (string, required) ### ValidationErrorLocItems ## 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", "origin_page": "string" } ], "pagination": { "total": 1, "page": 1, "limit": 1 }, "conversation_resolutions": {} } ```