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

# Generate FAQs

> Generate questions and answers from an indexed page.

Generate page-specific questions and answers from content already indexed for a
page. Use the page's canonical URL to identify the content.

<Note>
  Send URL context only. Do not send the full page body from the browser. The
  API returns `not_found` when the page is not available in the selected index.
</Note>

## Format the answers

| Goal                                   | Field                                                                                                   |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| Return between one and six questions   | Set `max_items`. The default is `4`.                                                                    |
| Return prose answers                   | Set `answer_format` to `paragraph`. Use `answer_paragraph_words` to target `50`, `100`, or `150` words. |
| Return list answers                    | Set `answer_format` to `bullets`. Use `answer_max_bullets` to return between one and six list items.    |
| Adjust the writing style               | Set `tone` to `neutral`, `warm`, `professional`, or `concise`.                                          |
| Test unpublished runtime changes       | Set `version` to `unpublished`. Production requests default to `published`.                             |
| Bypass the cache and summary analytics | Set `is_private_session` to `true` or `tracking_consent` to `false`.                                    |

<Note>
  A bullet-formatted answer is one string containing newline-separated list
  items. It is not an array.
</Note>

## Handle the response status

The endpoint returns HTTP `200` for each application-level result.

| Status      | Meaning                                                   |
| ----------- | --------------------------------------------------------- |
| `ready`     | `items` contains the generated question-and-answer pairs. |
| `not_found` | The page is not in the selected index. `items` is empty.  |
| `error`     | The API could not produce usable FAQs.                    |


## OpenAPI

````yaml api-reference/openapi-latest.json POST /api/v1/faqs
openapi: 3.1.0
info:
  title: Webless API
  description: >-
    Reference for the latest Webless API surface. New integrations should use
    the /api/v1 endpoints.
  version: v1
servers:
  - url: https://api.webless.ai
    description: Production API
security: []
paths:
  /api/v1/faqs:
    post:
      tags:
        - Page content API
      summary: Generate FAQs
      description: >-
        Returns questions and answers from content already indexed for the
        supplied page URL. Send URL context, not the full page body.
      operationId: createFaqsV1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V1FaqRequest'
            examples:
              default:
                value:
                  company: YOUR_COMPANY
                  canonical_url: https://example.com/articles/product-launch
                  page_url: https://example.com/articles/product-launch#webless
                  title: Product launch
                  version: published
                  max_items: 2
                  answer_format: paragraph
                  requestId: 1f7c5f74-7b9e-4a0a-9b7d-4e3e2a5e3b60
                  sessionId: a1c2d3e4-1111-2222-3333-444455556666
      responses:
        '200':
          description: FAQ result for the supplied page URL
          headers:
            X-Webless-Requested-Version:
              description: Runtime version requested by the client.
              schema:
                type: string
            X-Webless-Resolved-Version:
              description: Runtime version used for the response.
              schema:
                type: string
            X-Webless-Version-Fallback-Reason:
              description: Reason for a runtime version fallback, when one occurs.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1FaqResponse'
              examples:
                ready:
                  value:
                    status: ready
                    items:
                      - question: What does the product launch introduce?
                        answer: >-
                          The launch introduces a faster setup flow while
                          keeping existing integrations compatible.
                      - question: Who can use the new experience?
                        answer: The new experience is available to all customers.
                    source_url: https://example.com/articles/product-launch
                    title: Product launch
                    cache_status: miss
                    version: published
                    resolved_version: published
                    resolved_corpus_version: 12
                    generated_at: '2026-06-12T19:30:00+00:00'
                not_found:
                  value:
                    status: not_found
                    items: []
                    source_url: https://example.com/articles/product-launch
                    title: Product launch
                    cache_status: miss
                    version: published
                    resolved_version: published
                    resolved_corpus_version: 12
                    generated_at: '2026-06-12T19:30:00+00:00'
        '422':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
components:
  schemas:
    V1FaqRequest:
      type: object
      required:
        - company
        - canonical_url
      properties:
        company:
          type: string
          description: Public company or index identifier.
        canonical_url:
          type: string
          description: Canonical URL of the page used to generate FAQs.
        page_url:
          type: string
          description: >-
            Current browser URL. Optional; fragments and tracking params are
            normalized server-side.
        title:
          type: string
          description: Optional page title for display and prompt context.
        locale:
          type: string
          description: Optional locale or language hint.
        requestId:
          type: string
          description: Caller-generated request identifier.
        sessionId:
          type: string
          description: Caller-generated session identifier.
        is_private_session:
          type: boolean
          default: false
          description: When true, bypasses the cache and summary analytics logging.
        tracking_consent:
          type: boolean
          nullable: true
          description: >-
            Tracking consent for this request. Setting this to false also
            enables private-session behavior.
        model:
          type: string
          default: gpt
          description: Model alias configured for the runtime package.
        version:
          $ref: '#/components/schemas/V1RuntimeVersion'
        max_items:
          type: integer
          minimum: 1
          maximum: 6
          default: 4
          description: Maximum number of question-and-answer pairs to return.
        answer_format:
          type: string
          enum:
            - paragraph
            - bullets
          default: paragraph
          description: Format for each answer.
        answer_max_bullets:
          type: integer
          minimum: 1
          maximum: 6
          default: 3
          description: Maximum list items in each answer when answer_format is bullets.
        answer_paragraph_words:
          type: integer
          enum:
            - 50
            - 100
            - 150
          default: 100
          description: Target word count for each answer when answer_format is paragraph.
        tone:
          type: string
          enum:
            - neutral
            - warm
            - professional
            - concise
          default: neutral
          description: Writing style for generated answers.
    V1FaqResponse:
      type: object
      required:
        - status
        - items
        - cache_status
      properties:
        status:
          $ref: '#/components/schemas/V1FaqStatus'
        items:
          type: array
          items:
            $ref: '#/components/schemas/V1FaqItem'
          description: >-
            Generated question-and-answer pairs. Empty when status is not_found
            or error.
        source_url:
          type: string
          nullable: true
          description: Normalized source URL used for lookup.
        title:
          type: string
          nullable: true
          description: Page title returned by the request or indexed content.
        cache_status:
          $ref: '#/components/schemas/V1FaqCacheStatus'
        version:
          $ref: '#/components/schemas/V1RuntimeVersion'
        resolved_version:
          type: string
          nullable: true
          description: Resolved runtime pointer after fallback handling.
        resolved_corpus_version:
          type: integer
          nullable: true
          description: Resolved indexed corpus version used internally for the response.
        generated_at:
          type: string
          format: date-time
          nullable: true
          description: Server timestamp for the generated response.
    ValidationErrorResponse:
      type: object
      properties:
        detail:
          type: array
          items:
            type: object
            additionalProperties: true
    V1RuntimeVersion:
      type: string
      enum:
        - published
        - unpublished
      default: published
      description: >-
        Runtime package pointer. Omit this field or use `published` for
        production traffic. Use `unpublished` only when testing an unpublished
        runtime package.
    V1FaqStatus:
      type: string
      enum:
        - ready
        - not_found
        - error
      description: FAQ generation status.
    V1FaqItem:
      type: object
      required:
        - question
        - answer
      properties:
        question:
          type: string
          description: Question generated from the indexed page content.
        answer:
          type: string
          description: >-
            Answer generated from the indexed page content. Bullet-formatted
            answers contain newline-separated list items in this string.
    V1FaqCacheStatus:
      type: string
      enum:
        - hit
        - miss
        - bypass
      description: Whether the response came from cache.

````