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

# Create knowledge base

> Creates a knowledge base in your WotNot account and returns its `id`.



## OpenAPI

````yaml POST /v1/ai/knowledge-base
openapi: 3.1.0
info:
  title: WotNot API
  version: 1.0.0
  description: 'WotNot API: Create knowledge base.'
servers:
  - url: https://api.wotnot.io
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/ai/knowledge-base:
    post:
      summary: Create knowledge base
      description: Creates a knowledge base in your WotNot account and returns its `id`.
      operationId: createKnowledgeBase
      requestBody:
        required: true
        description: The details of the new knowledge base.
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  description: >-
                    The name for the new knowledge base. In the example,
                    `KNOWLEDGE_BASE_NAME` stands in for the name you choose.
                  example: KNOWLEDGE_BASE_NAME
            example:
              name: KNOWLEDGE_BASE_NAME
      responses:
        '200':
          description: Returns `ok` set to `true` and the new knowledge base's `id`.
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                  - id
                  - message
                  - code
                properties:
                  ok:
                    type: boolean
                    description: '`true` when the request worked. Errors return `false`.'
                    example: true
                  id:
                    type: integer
                    description: >-
                      The new knowledge base's ID. Use it as `knowledge_base_id`
                      when you add data sources to it.
                    example: 2451
                  message:
                    type: string
                    description: A short confirmation, in plain words.
                    example: Knowledge base has been created.
                  code:
                    type: string
                    description: >-
                      A code for the result.
                      `CREATE_KNOWLEDGE_BASE_SUCCESS_MESSAGE` when the knowledge
                      base was created.
                    example: CREATE_KNOWLEDGE_BASE_SUCCESS_MESSAGE
              example:
                ok: true
                id: 2451
                message: Knowledge base has been created.
                code: CREATE_KNOWLEDGE_BASE_SUCCESS_MESSAGE
        '400':
          description: >-
            The knowledge base couldn't be created. Either your account has
            reached the maximum number of knowledge bases, or this feature isn't
            available on your account. Check `error` to see which.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodedError'
              examples:
                limit_reached:
                  summary: Maximum knowledge bases reached
                  value:
                    ok: false
                    message: >-
                      You have reached the maximum number of knowledge bases.
                      Upgrade your plan to create more knowledge bases.
                    error: MAX_KNOWLEDGE_BASE_COUNT_EXCEEDED
                    code: MAX_KNOWLEDGE_BASE_COUNT_EXCEEDED
                feature_not_available:
                  summary: Feature not available
                  value:
                    ok: false
                    message: Please reach out to support to use this feature
                    error: UNAUTHORIZED_FEATURE
                    code: UNAUTHORIZED_FEATURE
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
  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.