Delete uploaded case files (internal)

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://docs.usehearsay.com/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "integrations MCP server": {
    "url": "https://docs.usehearsay.com/mcp"
  }
}

Close
POST /admin/case-files/{caseId}/delete

Soft-deletes files uploaded to the case through the portal or by custodians, either the ids in caseFileIds or all of them with all; documents synced from a legal integration are not touched. Deleted files leave every case view and the files data source counts go down. Returns how many files matched, already deleted ones included, and how many this call deleted, so a retry deletes nothing. Returns 404 for an unknown case or when any id is not an uploaded file on the case. Super admin only.

Path parameters

  • caseId string Required

    Id of the case the files were uploaded to

application/json

Body Required

  • caseFileIds array[string]

    CaseFile ids to delete (max 1000). Every id must be an uploaded file on the case (not a CMP-synced legal document). Omit when sending all.

  • all boolean

    Delete every uploaded case file on the case. Omit when sending caseFileIds.

    Value is true.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • data object Required
      Hide data attributes Show data attributes object
      • matched number Required

        Case files in scope, including ones already deleted

      • deleted number Required

        Case files soft-deleted by this call (0 on a retry)

    • statusCode number Required
    • timestamp string(date-time) Required
POST /admin/case-files/{caseId}/delete
curl \
 --request POST 'http://api.example.com/admin/case-files/{caseId}/delete' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{
  "caseFileIds": [
    "string"
  ],
  "all": true
}'
Request examples
{
  "caseFileIds": [
    "string"
  ],
  "all": true
}
Response examples (200)
{
  "data": {
    "matched": 4,
    "deleted": 4
  },
  "statusCode": 200,
  "timestamp": "2026-01-15T10:15:00.000Z"
}