> ## 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 URL data sources

> Adds one or more web pages to an existing knowledge base. Each URL you send becomes its own data source.



## OpenAPI

````yaml POST /v1/ai/knowledge-base/{knowledge_base_id}/data-sources/webpages
openapi: 3.1.0
info:
  title: WotNot API
  version: 1.0.0
  description: 'WotNot API: Add URL data sources.'
servers:
  - url: https://api.wotnot.io
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/ai/knowledge-base/{knowledge_base_id}/data-sources/webpages:
    post:
      summary: Add URL data sources
      description: >-
        Adds one or more web pages to an existing knowledge base. Each URL you
        send becomes its own data source.
      operationId: addUrlDataSources
      parameters:
        - name: knowledge_base_id
          in: path
          required: true
          description: The ID of the knowledge base to add the URLs to.
          schema:
            type: string
      requestBody:
        required: true
        description: The web pages to add.
        content:
          application/json:
            schema:
              type: object
              required:
                - urls
              properties:
                urls:
                  type: array
                  minItems: 1
                  description: >-
                    The web pages to add, at least one. Each must be a valid web
                    address, for example `https://wotnot.io/pricing`.
                  items:
                    type: string
                    format: uri
            example:
              urls:
                - https://wotnot.io
                - https://wotnot.io/pricing
      responses:
        '200':
          description: >-
            Returns `ok` set to `true` and a `data_sources` list with one entry
            for each URL you sent. Each one starts with `status` set to
            `in-progress`.
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                  - data_sources
                properties:
                  ok:
                    type: boolean
                    description: '`true` when the request worked. Errors return `false`.'
                    example: true
                  data_sources:
                    type: array
                    description: The new data sources, one for each URL you sent.
                    items:
                      $ref: '#/components/schemas/DataSource'
              example:
                ok: true
                data_sources:
                  - knowledge_base_id: '29'
                    id: 1335
                    name: https://wotnot.io
                    source_type: url
                    token: 0
                    refresh_frequency: null
                    last_trained_at: null
                    status: in-progress
                    type: url
                    created_at: '2025-07-07 05:09:34.218507'
                    created_by:
                      id: 2
                      name: System
                  - knowledge_base_id: '29'
                    id: 1336
                    name: https://wotnot.io/pricing
                    source_type: url
                    token: 0
                    refresh_frequency: null
                    last_trained_at: null
                    status: in-progress
                    type: url
                    created_at: '2025-07-07 05:09:34.218507'
                    created_by:
                      id: 2
                      name: System
        '400':
          description: >-
            Something in the body is invalid, for example a URL isn't a valid
            web address or `urls` is empty. Each item in `message` points to one
            problem.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              example:
                error: BAD_REQUEST
                ok: false
                status: 400
                message:
                  - message: '"urls[0]" must be a valid uri'
                    path:
                      - urls
                      - 0
                  - message: '"urls" does not contain 1 required value(s)'
                    path:
                      - urls
        '401':
          $ref: '#/components/responses/FeatureNotAvailable'
components:
  schemas:
    DataSource:
      type: object
      description: One data source in a knowledge base.
      required:
        - knowledge_base_id
        - id
        - name
        - source_type
        - token
        - refresh_frequency
        - last_trained_at
        - status
        - type
        - created_at
        - created_by
      properties:
        knowledge_base_id:
          type: string
          description: >-
            The ID of the knowledge base this data source belongs to. It comes
            back as text, for example `"29"`.
          example: '29'
        id:
          type: integer
          description: The data source's unique ID.
          example: 1335
        name:
          type: string
          description: >-
            The data source's name. For a URL data source, this is the URL
            itself.
          example: https://wotnot.io
        source_type:
          type: string
          description: What kind of source this is, for example `url`.
          example: url
        token:
          type: integer
          description: >-
            The number of tokens the data source uses. `0` right after it's
            added.
          example: 0
        refresh_frequency:
          type:
            - string
            - 'null'
          description: >-
            How often the data source is refreshed. `null` right after it's
            added.
          example: null
        last_trained_at:
          type:
            - string
            - 'null'
          description: >-
            When the data source was last trained. `null` when it hasn't been
            trained yet.
          example: null
        status:
          type: string
          description: >-
            Where the data source is in training: `in-progress`, `trained` or
            `failed`. It starts as `in-progress`. Use Get training status to
            follow it.
          example: in-progress
        type:
          type: string
          description: The data source type, for example `url`.
          example: url
        created_at:
          type: string
          description: >-
            When the data source was added, in the format `YYYY-MM-DD
            HH:MM:SS.ffffff`, for example `2025-07-07 05:09:34.218507`.
          example: '2025-07-07 05:09:34.218507'
        created_by:
          type: object
          description: Who added the data source.
          required:
            - id
            - name
          properties:
            id:
              type: integer
              description: Their user ID, for example `2` for `System`.
              example: 2
            name:
              type: string
              description: Their name, for example `System`.
              example: System
    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
    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
  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.