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

# Add domain data source

> Adds a website domain, such as `https://wotnot.io`, to an existing knowledge base as a data source. To add specific pages instead, use Add URL data sources.



## OpenAPI

````yaml POST /v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain
openapi: 3.1.0
info:
  title: WotNot API
  version: 1.0.0
  description: 'WotNot API: Add domain data source.'
servers:
  - url: https://api.wotnot.io
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/ai/knowledge-base/{knowledge_base_id}/data-sources/domain:
    post:
      summary: Add domain data source
      description: >-
        Adds a website domain, such as `https://wotnot.io`, to an existing
        knowledge base as a data source. To add specific pages instead, use Add
        URL data sources.
      operationId: addDomainDataSource
      parameters:
        - name: knowledge_base_id
          in: path
          required: true
          description: The ID of the knowledge base to add the domain to.
          schema:
            type: string
      requestBody:
        required: true
        description: The domain to add and how to handle it.
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - url
                - exclude_urls
                - refresh_frequency
              properties:
                type:
                  type: string
                  description: The kind of data source. Set it to `domain`.
                  example: domain
                url:
                  type: string
                  format: uri
                  description: >-
                    The website to add. It must be a valid web address, for
                    example `https://wotnot.io`.
                  example: https://wotnot.io
                exclude_urls:
                  type: string
                  description: >-
                    Pages on the domain to leave out. The example sends an empty
                    value (`""`).
                  example: ''
                refresh_frequency:
                  type:
                    - string
                    - 'null'
                  description: >-
                    How often the data source is refreshed. The example sends
                    `null`.
                  example: null
            example:
              type: domain
              url: https://wotnot.io
              exclude_urls: ''
              refresh_frequency: null
      responses:
        '200':
          description: Returns `ok` set to `true` with a `domain_id` and a `request_id`.
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                  - domain_id
                  - request_id
                properties:
                  ok:
                    type: boolean
                    description: '`true` when the request worked. Errors return `false`.'
                    example: true
                  domain_id:
                    type: integer
                    description: The ID of the domain you added.
                    example: 8
                  request_id:
                    type: string
                    description: An ID for this request.
                    example: 3QWuobWJE3jF065037422196qAdTZ2Ct
              example:
                ok: true
                domain_id: 8
                request_id: 3QWuobWJE3jF065037422196qAdTZ2Ct
        '400':
          description: >-
            The domain couldn't be added. The `message` says why, for example a
            URL limit was reached or `url` isn't a valid web address.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/CodedError'
                    title: Error with code
                  - $ref: '#/components/schemas/ValidationError'
                    title: Validation error
              examples:
                url_limit:
                  summary: URL limit reached
                  value:
                    message: Maximum urls allowed 4
                    ok: false
                    error: BAD_REQUEST
                    code: BAD_REQUEST
                    status: 400
                invalid_url:
                  summary: Invalid URL
                  value:
                    error: BAD_REQUEST
                    ok: false
                    status: 400
                    message:
                      - message: '"url" must be a valid uri'
                        path:
                          - url
        '401':
          $ref: '#/components/responses/FeatureNotAvailable'
components:
  schemas:
    CodedError:
      type: object
      description: An error with a short code that says what went wrong.
      required:
        - ok
        - message
        - error
        - code
      properties:
        ok:
          type: boolean
          description: Always `false` when something went wrong.
          example: false
        message:
          type: string
          description: What went wrong, in plain words.
          example: Please reach out to support to use this feature
        error:
          type: string
          description: >-
            A short error code in capital letters, for example
            `UNAUTHORIZED_FEATURE`. Check this in your code to tell errors
            apart.
          example: UNAUTHORIZED_FEATURE
        code:
          type: string
          description: A code for the result. In these examples it matches `error`.
          example: UNAUTHORIZED_FEATURE
        status:
          type: integer
          description: >-
            The HTTP status code, repeated in the body. Not every error includes
            it.
          example: 401
    ValidationError:
      type: object
      description: Returned when one or more fields in the request body are invalid.
      required:
        - error
        - ok
        - status
        - message
      properties:
        error:
          type: string
          description: '`BAD_REQUEST` for this kind of error.'
          example: BAD_REQUEST
        ok:
          type: boolean
          description: Always `false` when something went wrong.
          example: false
        status:
          type: integer
          description: The HTTP status code, repeated in the body.
          example: 400
        message:
          type: array
          description: A list of problems with the request, one item per problem.
          items:
            type: object
            required:
              - message
              - path
            properties:
              message:
                type: string
                description: >-
                  What is wrong with this field, for example `"url" must be a
                  valid uri`.
                example: '"url" must be a valid uri'
              path:
                type: array
                description: >-
                  Where the problem is in your request body. For example,
                  `["urls", 0]` means the first item in `urls`.
                items:
                  type:
                    - string
                    - integer
  responses:
    FeatureNotAvailable:
      description: >-
        This feature isn't available on your account. Contact WotNot support to
        use it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CodedError'
          example:
            message: Please reach out to support to use this feature
            ok: false
            error: UNAUTHORIZED_FEATURE
            code: UNAUTHORIZED_FEATURE
            status: 401
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        All of WotNot's APIs use Bearer token authentication. Send your account
        token as `Bearer <token>`. You can find it in Settings > Account
        Settings > Developer. Keep it on your server: anyone who has it can call
        the API as your account.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.