---
title: "Delete an uploaded file"
method: DELETE
path: "/workspaces/{workspaceId}/consultations/{consultationId}/uploaded-files/{fileName}"
tags: ["uploaded-files"]
---

# Delete an uploaded file

`DELETE /workspaces/{workspaceId}/consultations/{consultationId}/uploaded-files/{fileName}`

## Request

- Base URL: `https://vetnio.com/api/v2`
- URL: `https://vetnio.com/api/v2/workspaces/{workspaceId}/consultations/{consultationId}/uploaded-files/{fileName}`
- Auth: HTTP bearer

Removes the file and its extracted analysis text from S3, then deletes the database row. Idempotent — deleting a file that no longer exists still returns `ok: true`. If any S3 object fails to delete, the call returns `500` and the database row is preserved so the delete can be retried without leaking orphaned storage.

## Path parameters

- `workspaceId` string, required: Opaque identifier of the Vetnio workspace (veterinary clinic) that owns the resource. Scopes every request — callers can only access files under workspaces they are a member of.
- `consultationId` string, required: Identifier of the consultation (a single veterinary visit) the file is attached to. The consultation must belong to the same workspace as the authenticated caller.
- `fileName` string, required: Stable internal identifier for the file — a server-generated UUID returned by `initUpload`. Used in every subsequent endpoint (finalize, download, delete). Not intended for display; use `originalFileName` for that.

## Response `200`

File and its analysis were removed (or were already gone).

- OkResponse: Generic success envelope returned by mutations that do not produce a resource body.
  - `ok` boolean, required: Always `true` on success.

## Other responses

- `400`: Invalid input data
- `401`: Authorization not provided
- `403`: Insufficient access
- `404`: Not found
- `500`: Internal server error

---

[API](https://skmtc.dev/vetnio/apis/vetnio-api.md) - [All operations](https://skmtc.dev/vetnio/apis/vetnio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/vetnio/apis/vetnio-api/revisions/d004afd5617d?raw)
