TokenLab

Files & Batches

Delete File

Delete an uploaded file from the current Workspace.

DELETE
/v1/files/{file_id}

Overview

Delete a file created through /v1/files. A successful response includes deleted: true.

With Anthropic Files headers, the same API deletes an Anthropic-format file from the current Workspace.

Notes

  • Deleting a file does not cancel batch jobs that already reference it.
  • Missing or inaccessible file IDs return a not-found error.
  • Delete image reference files only after no pending image edit request needs them.

Example

Request

cURL
curl -X DELETE "https://api.tokenlab.sh/v1/files/file_abc123" \
  -H "Authorization: Bearer sk-your-api-key"
{  "id": "string",  "object": "file",  "deleted": true}

Authorization

BearerAuth
AuthorizationBearer <token>

API Key authentication. Create or manage API keys in Dashboard > API > API Keys.

In: header

Path Parameters

file_id*string

File ID returned by the Files API.

Headers

anthropic-beta?string

Include files-api-2025-04-14 to use Anthropic Files API mode.

Response

application/json

application/json

application/json