> ## 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.

# Delete data sources

> Deletes one or more data sources from an existing knowledge base.



## OpenAPI

````yaml DELETE /v1/ai/knowledge-bases/{knowledge_base_id}/data-sources
openapi: 3.1.0
info:
  title: WotNot API
  version: 1.0.0
  description: 'WotNot API: Delete data sources.'
servers:
  - url: https://api.wotnot.io
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/ai/knowledge-bases/{knowledge_base_id}/data-sources:
    delete:
      summary: Delete data sources
      description: Deletes one or more data sources from an existing knowledge base.
      operationId: deleteDataSources
      parameters:
        - name: knowledge_base_id
          in: path
          required: true
          description: The ID of the knowledge base to delete the data sources from.
          schema:
            type: string
      requestBody:
        required: true
        description: The data sources to delete.
        content:
          application/json:
            schema:
              type: object
              required:
                - data_sources
              properties:
                data_sources:
                  type: array
                  description: >-
                    The IDs of the data sources to delete. Each is the `id` you
                    got back when the data source was added.
                  items:
                    type: integer
            example:
              data_sources:
                - 1335
                - 1336
      responses:
        '200':
          description: The data sources were deleted. Returns `ok` set to `true`.
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                properties:
                  ok:
                    type: boolean
                    description: '`true` when the request worked. Errors return `false`.'
                    example: true
              example:
                ok: true
        '400':
          description: >-
            The body is invalid, for example `data_sources` is missing. 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: '"data_sources" is required'
                    path:
                      - data_sources
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: >-
            Something in the request wasn't found, such as the knowledge base or
            a data source. Check the IDs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodedError'
              example:
                message: Resource not found
                ok: false
                error: RESOURCE_NOT_FOUND
                code: RESOURCE_NOT_FOUND
                status: 404
components:
  schemas:
    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
    Error:
      type: object
      description: Returned whenever a request fails.
      required:
        - error
        - ok
        - status
        - message
      properties:
        error:
          type: string
          description: >-
            A short error code in capital letters, for example `UNAUTHORIZED`.
            Check this in your code to tell errors apart.
          example: UNAUTHORIZED
        ok:
          type: boolean
          description: Always `false` when something went wrong.
          example: false
        status:
          type: integer
          description: The HTTP status code, repeated in the body, for example `401`.
          example: 401
        message:
          type: string
          description: What went wrong and how to fix it, in plain words.
          example: Invalid token. Provide the valid account token.
  responses:
    Unauthorized:
      description: >-
        The token is missing or wrong. Check that the `Authorization` header is
        `Bearer` followed by your account token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: UNAUTHORIZED
            ok: false
            status: 401
            message: Invalid token. Provide the valid account token.
  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.