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

# Delete graph

> Delete a Knowledge Graph.

<Note>
  Knowledge Graphs [deployed to a specific team](https://support.writer.com/article/242-how-to-create-and-manage-a-knowledge-graph#Managing-a-Knowledge-Graph-R4Mg5) aren't accessible via the API or SDK. To use a Knowledge Graph via the API or SDK, configure it with "All Teams" access in [AI Studio](https://app.writer.com/aistudio).
</Note>


## OpenAPI

````yaml delete /v1/graphs/{graph_id}
openapi: 3.0.3
info:
  title: API
  version: '1.0'
servers:
  - url: https://api.writer.com
security:
  - bearerAuth: []
paths:
  /v1/graphs/{graph_id}:
    delete:
      tags:
        - KG API
      summary: Delete graph
      description: Delete a Knowledge Graph.
      operationId: deleteGraph
      parameters:
        - name: graph_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The unique identifier of the Knowledge Graph.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete_graph_response'
              example:
                id: e7392337-1c4e-4bc9-aaf5-b719bf1e938a
                deleted: true
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: cURL
          source: >-
            curl --location --request DELETE
            https://api.writer.com/v1/graphs/{graph_id} \
             --header "Authorization: Bearer <token>"
        - lang: JavaScript
          source: |-
            import Writer from 'writer-sdk';

            const client = new Writer({
              apiKey: process.env['WRITER_API_KEY'], // This is the default and can be omitted
            });

            async function main() {
              const graph = await client.graphs.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

              console.log(graph.id);
            }

            main();
        - lang: Python
          source: |-
            import os
            from writerai import Writer

            client = Writer(
                # This is the default and can be omitted
                api_key=os.environ.get("WRITER_API_KEY"),
            )
            graph = client.graphs.delete(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(graph.id)
components:
  schemas:
    delete_graph_response:
      title: delete_graph_response
      required:
        - id
        - deleted
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: A unique identifier of the deleted Knowledge Graph.
        deleted:
          type: boolean
          description: Indicates whether the Knowledge Graph was successfully deleted.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your [Writer API
        key](https://dev.writer.com/api-reference/api-keys).

````