> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gp.scale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Knowledge Base

> ### Description
Deletes a knowledge base.

### Details
This API can be used to delete a knowledge base by ID. To use this API, pass in the         `knowledge_base_id` that was returned from your [Create Knowledge Base API](         https://scale-egp.readme.io/reference/create_knowledge_base_v2) call as a path parameter.

#### Backwards Compatibility
V2 and V1 Knowledge Bases are entirely separate and not backwards compatible. Users who         have existing V1 knowledge bases will need to migrate their data to V2 knowledge bases.



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/sgp/openapi.yml delete /v4/knowledge-bases/{knowledge_base_id}
openapi: 3.1.0
info:
  title: EGP API V4
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
tags:
  - name: Models
    description: Model API.
paths:
  /v4/knowledge-bases/{knowledge_base_id}:
    delete:
      tags:
        - Knowledge Bases
      summary: Delete Knowledge Base
      description: >-
        ### Description

        Deletes a knowledge base.


        ### Details

        This API can be used to delete a knowledge base by ID. To use this API,
        pass in the         `knowledge_base_id` that was returned from your
        [Create Knowledge Base API](        
        https://scale-egp.readme.io/reference/create_knowledge_base_v2) call as
        a path parameter.


        #### Backwards Compatibility

        V2 and V1 Knowledge Bases are entirely separate and not backwards
        compatible. Users who         have existing V1 knowledge bases will need
        to migrate their data to V2 knowledge bases.
      operationId: DELETE-V4-/v2/knowledge-bases/{knowledge_base_id}
      parameters:
        - name: knowledge_base_id
          in: path
          required: true
          schema:
            type: string
            title: Knowledge Base Id
        - name: x-selected-account-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account ID Header
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteKnowledgeBaseResponseV2'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from scale_gp import SGPClient

            client = SGPClient(
                api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
            )
            delete_knowledge_base_response = client.knowledge_bases.delete(
                "knowledge_base_id",
            )
            print(delete_knowledge_base_response.knowledge_base_id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/sgp-go\"\n\t\"github.com/stainless-sdks/sgp-go/option\"\n)\n\nfunc main() {\n\tclient := sgp.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tdeleteKnowledgeBaseResponse, err := client.KnowledgeBases.Delete(context.TODO(), \"knowledge_base_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", deleteKnowledgeBaseResponse.KnowledgeBaseID)\n}\n"
components:
  schemas:
    DeleteKnowledgeBaseResponseV2:
      properties:
        deleted:
          type: boolean
          title: Deleted
          description: Whether or not the knowledge base was successfully deleted
        knowledge_base_id:
          type: string
          title: Knowledge Base Id
          description: The ID of the knowledge base that was deleted
      type: object
      required:
        - deleted
        - knowledge_base_id
      title: DeleteKnowledgeBaseResponseV2
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````