CumulusDocs
Open Studio
On this page

Delete a knowledge document

Delete a knowledge document and inspect the storage and provider deletion receipts.

Operation ID: documents.delete.

Request

DELETE /api/v1/documents/{document_id}

  • TypeScript SDK: client.documents.delete (path arguments use path).
  • MCP tool: sdk_client_call with operationId: "documents.delete" (path arguments use input.path). Legacy alias: documents_delete. Connect to your authenticated /mcp endpoint with an API key for the same environment.
  • Minimum API key role: member.
  • Idempotency: No header required; the resource or revision identifies the change.

Read resource IDs from earlier responses and use a key for the same environment.

Request example

Set each path variable to an ID returned by an earlier API request.

Set CUMULUS_BASE_URL to your workspace API URL and CUMULUS_API_KEY to a key for that environment. Example values are synthetic.

cURL

curl
curl --fail-with-body -sS -X DELETE "${CUMULUS_BASE_URL%/}/api/v1/documents/${DOCUMENT_ID}" \
  -H "Authorization: Bearer $CUMULUS_API_KEY"

TypeScript

typescript
import { Cumulus } from "@cumulus/sdk";

const baseUrl = process.env.CUMULUS_BASE_URL;
const apiKey = process.env.CUMULUS_API_KEY;
if (!baseUrl || !apiKey) throw new Error("Set CUMULUS_BASE_URL and CUMULUS_API_KEY");
const client = new Cumulus({ baseUrl, apiKey });

const response = await client.documents.delete({
  "path": {
    "document_id": "<document_id>"
  }
});

Input schema

Path, query and header parameters

document_id

path parameter · Required.

Type: string (uuid). pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$.

JSON request body

This operation has no JSON request body.

Complete OpenAPI schema
OpenAPI JSON
{
  "parameters": [
    {
      "name": "document_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
      }
    }
  ],
  "requestBody": null
}

Responses

HTTP 200

Delete a document and return storage/provider deletion receipts

application/json

FieldType or valuesRequiredDescription and limits
document_idstring (uuid)Requiredpattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$.
receiptsarray of objectRequired—
receipts[].receipt_idstring (uuid)Requiredpattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$.
receipts[].artifact_idstring (uuid)Requiredpattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$.
receipts[].store"s3" · "postgres"Required—
receipts[].locatorobjectRequired—
receipts[].locator.bucketstring or nullRequired—
receipts[].locator.keystring or nullRequired—
receipts[].locator.version_idsarray of stringOptionalDefault: [].
receipts[].request_idstring or nullRequired—
receipts[].deleted_sha256string or nullRequiredpattern: ^[a-f0-9]{64}$.
receipts[].provider_copies"none" · "declared_provider_retention"Required—
receipts[].purged_atstring (date-time)Requiredpattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$.

Error responses

HTTPDescription
4XXTyped error (ApiError)
5XXTyped error (ApiError)

Errors use the shared error envelope. Inspect error.code, retryable, outcome and details before retrying.

Complete OpenAPI schema
OpenAPI JSON
{
  "200": {
    "description": "Delete a document and return storage/provider deletion receipts",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/DocumentsDeleteResponse200"
        }
      }
    }
  },
  "4XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  },
  "5XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  }
}

Referenced schemas

Expand the complete OpenAPI definitions for integrations that generate their own clients.

Complete OpenAPI schema
OpenAPI JSON
{
  "components": {
    "schemas": {
      "DocumentsDeleteResponse200": {
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "receipts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeletionReceipt"
            }
          }
        },
        "required": [
          "document_id",
          "receipts"
        ],
        "additionalProperties": false
      },
      "DeletionReceipt": {
        "type": "object",
        "properties": {
          "receipt_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "artifact_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
          },
          "store": {
            "type": "string",
            "enum": [
              "s3",
              "postgres"
            ]
          },
          "locator": {
            "type": "object",
            "properties": {
              "bucket": {
                "nullable": true,
                "type": "string"
              },
              "key": {
                "nullable": true,
                "type": "string"
              },
              "version_ids": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "bucket",
              "key"
            ],
            "additionalProperties": false
          },
          "request_id": {
            "nullable": true,
            "type": "string"
          },
          "deleted_sha256": {
            "nullable": true,
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "provider_copies": {
            "type": "string",
            "enum": [
              "none",
              "declared_provider_retention"
            ]
          },
          "purged_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "receipt_id",
          "artifact_id",
          "store",
          "locator",
          "request_id",
          "deleted_sha256",
          "provider_copies",
          "purged_at"
        ],
        "additionalProperties": false
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "unauthenticated",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "invalid_request",
                  "idempotency_conflict",
                  "policy_denied",
                  "capability_unavailable",
                  "provider_unavailable",
                  "knowledge_unavailable",
                  "publication_invalid",
                  "run_not_active",
                  "rate_limited",
                  "outcome_unknown",
                  "internal"
                ]
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              },
              "outcome": {
                "type": "string",
                "enum": [
                  "none",
                  "unknown"
                ]
              },
              "details": {
                "type": "object",
                "additionalProperties": {}
              }
            },
            "required": [
              "code",
              "message",
              "retryable",
              "outcome"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    }
  }
}

Errors and recovery

See API error handling and Troubleshooting.

Content version bae1e532Customer SDKMarkdown source
Delete a knowledge document · Cumulus developer docs