---
title: "Delete the document"
url: "https://nov18-dev.movespot.fyi/apis/internal-documenthub-admin-api-0/versions/eaee49c0-67ee-4e12-b121-f29cae48c1a7/operations/deleteDocument"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/internal-documenthub-admin-api-0/versions/eaee49c0-67ee-4e12-b121-f29cae48c1a7.md

# Delete the document

`DELETE` `/{resourceKind}/{resourceId}/documents/{documentId}`

Operation ID: `deleteDocument`

Delete the document and all its associated revisions including the saved files in the datastore. This is a hard delete, files are not recoverable. Returns 404 if the document cannot be found, 409 if deleting the document would result in other orphaned documents.

## Path parameters

- `resourceKind` (string, required) - Kind of the Konnect resource
- `resourceId` (string, uuid, required) - Id of the Konnect resource
- `documentId` (string, uuid, required) - Targeted document

## Responses

- `204` - The document has been deleted
- `404` - Not Found
- `409` - Conflict

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: Internal DocumentHub admin Api
  version: 0.0.1
servers:
  - url: http://documenthub.documenthub.svc.cluster.local:4400/v0
    description: Konnect cluster
paths:
  /{resourceKind}/{resourceId}/documents/{documentId}:
    delete:
      operationId: deleteDocument
      summary: Delete the document
      description: >
        Delete the document and all its associated revisions including the saved

        files in the datastore. This is a hard delete, files are not
        recoverable.

        Returns 404 if the document cannot be found, 409 if deleting the
        document would result in other orphaned documents.
      parameters:
        - $ref: "#/components/parameters/resourceKind"
        - $ref: "#/components/parameters/resourceId"
        - $ref: "#/components/parameters/documentId"
      responses:
        "204":
          description: The document has been deleted
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      tags:
        - Customization
security:
  - bearerAuth: []
components:
  parameters:
    resourceKind:
      name: resourceKind
      in: path
      required: true
      description: Kind of the Konnect resource
      example: services
      schema:
        type: string
        enum:
          - services
    resourceId:
      name: resourceId
      in: path
      required: true
      description: Id of the Konnect resource
      example: bf138ba2-c9b1-4229-b268-04d9d8a6410b
      schema:
        type: string
        format: uuid
    documentId:
      name: documentId
      in: path
      required: true
      description: Targeted document
      example: bb84c46a-432d-4314-81e4-478614a52dcb
      schema:
        type: string
        format: uuid
  responses:
    NotFound:
      description: Not Found
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/NotFoundError"
          examples:
            NotFoundExample:
              $ref: "#/components/examples/NotFoundExample"
    Conflict:
      description: Conflict
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ConflictError"
  schemas:
    NotFoundError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 404
            title:
              example: Not Found
            type:
              example: https://httpstatuses.com/404
            instance:
              example: kong:trace:1234567890
            detail:
              example: Not found
    ConflictError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 409
            title:
              example: Conflict
            type:
              example: https://httpstatuses.com/409
            instance:
              example: kong:trace:1234567890
            detail:
              example: Conflict
    BaseError:
      description: standard error
      type: object
      properties:
        status:
          description: >
            The HTTP status code of the error. Useful when passing the response

            body to child properties in a frontend UI. Must be returned as an
            integer.
          type: integer
          readOnly: true
        title:
          description: |
            A short, human-readable summary of the problem. It should not
            change between occurences of a problem, except for localization.
            Should be provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
        type:
          description: The error type.
          type: string
          readOnly: true
        instance:
          description: |
            Used to return the correlation ID back to the user, in the format
            kong:trace:<correlation_id>. This helps us find the relevant logs
            when a customer reports an issue.
          type: string
          readOnly: true
        detail:
          description: >
            A human readable explanation specific to this occurence of the
            problem.

            This field may contain request/entity data to help the user
            understand

            what went wrong. Enclose variable values in square brackets. Should
            be

            provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
      required:
        - status
        - title
        - instance
        - detail
      title: Error
  examples:
    NotFoundExample:
      value:
        status: 404
        title: Not Found
        instance: kong:trace:6816496025408232265
        detail: Not Found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
```
