> 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.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiJjNDMxZDM1OC01OTdlLTQyZjItYWNmZS0wMWI1ZTUyMzg5ODYiLCJleHAiOjE3NzgzMzUyODIsImlhdCI6MTc3ODMzNDk4Mn0.bjPXJyiYaI83bngUegkkp_GirUHfuxi8avruwWKMdY4
>
> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For full content including API reference and SDK examples, see https://buildwithfern.com/learn/llms-full.txt.

# Index Website

POST https://fai.buildwithfern.com/sources/website/{domain}/index
Content-Type: application/json

Start crawling and indexing a website.
Returns a job_id to track the crawling progress.

Reference: https://buildwithfern.com/learn/docs/ai-features/ask-fern/api-reference/website/index-website

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: fai
  version: 1.0.0
paths:
  /sources/website/{domain}/index:
    post:
      operationId: index-website
      summary: Index Website
      description: |-
        Start crawling and indexing a website.
        Returns a job_id to track the crawling progress.
      tags:
        - subpackage_website
      parameters:
        - name: domain
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexWebsiteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IndexWebsiteRequest'
servers:
  - url: https://fai.buildwithfern.com
  - url: https://fai-dev.buildwithfern.com
  - url: http://localhost:8080
components:
  schemas:
    IndexWebsiteRequest:
      type: object
      properties:
        base_url:
          type: string
          description: >-
            The base URL to start indexing from (e.g.,
            'https://docs.example.com')
        domain_filter:
          type:
            - string
            - 'null'
          description: >-
            Domain to filter crawling (e.g., 'docs.example.com'). Defaults to
            base_url domain.
        path_filter:
          type:
            - string
            - 'null'
          description: >-
            Path prefix to restrict crawling (e.g., '/docs'). Only URLs starting
            with this will be crawled.
        url_pattern:
          type:
            - string
            - 'null'
          description: >-
            Regex pattern to filter URLs (e.g.,
            `https://example\.com/(docs|api)/.*`).
        chunk_size:
          type:
            - integer
            - 'null'
          default: 1000
          description: Size of text chunks for splitting documents
        chunk_overlap:
          type:
            - integer
            - 'null'
          default: 200
          description: Overlap between consecutive chunks
        min_content_length:
          type:
            - integer
            - 'null'
          default: 100
          description: Minimum content length to index a page
        max_pages:
          type:
            - integer
            - 'null'
          description: Maximum number of pages to crawl. None means unlimited.
        delay:
          type:
            - number
            - 'null'
          format: double
          default: 1
          description: Delay in seconds between requests
        version:
          type:
            - string
            - 'null'
          description: Version to tag all indexed pages with
        product:
          type:
            - string
            - 'null'
          description: Product to tag all indexed pages with
        authed:
          type:
            - boolean
            - 'null'
          description: Whether indexed pages should be auth-gated
      required:
        - base_url
      title: IndexWebsiteRequest
    IndexWebsiteResponse:
      type: object
      properties:
        job_id:
          type: string
          description: ID to track the indexing job status
        base_url:
          type: string
          description: The base URL being indexed
      required:
        - job_id
        - base_url
      title: IndexWebsiteResponse
    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

```