> If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.
>
> GET https://buildwithfern.com/learn/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiI2YzljY2IwMy00M2Y5LTQ0YmItYTY2NS0yMmE5Yjc1MDc2MWMiLCJleHAiOjE3ODQ4NjYxNzQsImlhdCI6MTc4NDg2NTg3NH0.Q7GE1fatwj35X3HWBDxKrX7CyGHfr-r_g8ynOQRziw4
>
> 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/scribe-api/query/get-recent-queries

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: fai
  version: 1.0.0
paths:
  /queries/{domain}:
    get:
      operationId: get_recent_queries
      summary: Get Recent Queries
      tags:
        - query
      parameters:
        - name: domain
          in: path
          required: true
          schema:
            type: string
        - name: page
          in: query
          description: The page number for pagination
          required: false
          schema:
            type:
              - integer
              - 'null'
        - name: limit
          in: query
          description: The number of queries per page
          required: false
          schema:
            type:
              - integer
              - 'null'
        - name: cutoff_time
          in: query
          description: Only return queries after this time
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: include_assistant
          in: query
          description: Whether to include assistant responses in the results
          required: false
          schema:
            type:
              - boolean
              - 'null'
        - name: start_date
          in: query
          description: The start date of the period to retrieve analytics for
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: end_date
          in: query
          description: The end date of the period to retrieve analytics for
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetQueriesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
servers:
  - url: https://fai.buildwithfern.com
    description: Production
  - url: https://fai-dev.buildwithfern.com
    description: Development
  - url: http://localhost:8080
    description: Local
components:
  schemas:
    QueryStatus:
      type: string
      enum:
        - guardrail_blocked
      title: QueryStatus
    Query:
      type: object
      properties:
        query_id:
          type: string
        conversation_id:
          type: string
        domain:
          type: string
        text:
          type: string
        role:
          type: string
        source:
          type: string
        created_at:
          type: string
          format: date-time
        time_to_first_token:
          type:
            - number
            - 'null'
          format: double
        subqueries:
          type:
            - array
            - 'null'
          items:
            type: string
        status:
          oneOf:
            - $ref: '#/components/schemas/QueryStatus'
            - type: 'null'
      required:
        - query_id
        - conversation_id
        - domain
        - text
        - role
        - source
        - created_at
      title: Query
    PaginationResponse:
      type: object
      properties:
        total:
          type: integer
        page:
          type: integer
        limit:
          type: integer
      required:
        - total
        - page
        - limit
      title: PaginationResponse
    GetQueriesResponse:
      type: object
      properties:
        queries:
          type: array
          items:
            $ref: '#/components/schemas/Query'
          description: List of queries matching the request criteria
        pagination:
          $ref: '#/components/schemas/PaginationResponse'
          description: Pagination information
      required:
        - queries
        - pagination
      title: GetQueriesResponse
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## 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
  }
}
```