> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenlab.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Hapus File

> Menghapus file batch, binding file gambar/referensi, atau file mode Anthropic.

## Ikhtisar

Menghapus file yang dibuat melalui `/v1/files`. Tanpa header Anthropic, route ini menghapus file batch TokenLab atau binding file gambar/referensi. Dengan `anthropic-beta: files-api-2025-04-14`, route memakai mode Anthropic Files API untuk workspace yang terikat.

## Catatan

* Penghapusan file batch menghapus record file yang tersimpan dan mencegah job batch berikutnya memakai file ID tersebut.
* Penghapusan file gambar/referensi meminta provider yang dipilih menghapus file, lalu menghapus binding file TokenLab setelah provider menerima penghapusan.
* Mode Anthropic Files API memerlukan header native Anthropic yang sama seperti saat upload dan retrieve.

## Contoh

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.tokenlab.sh/v1/files/file_abc123" \
    -H "Authorization: Bearer sk-your-api-key"
  ```
</RequestExample>

## Request / Response

Gunakan panel OpenAPI interaktif di atas untuk schema yang tepat.

## Contoh response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": "file_abc123",
    "object": "file",
    "deleted": true
  }
  ```
</ResponseExample>

## Field penting

<ResponseField name="id" type="string">Identifier file yang dihapus.</ResponseField>
<ResponseField name="deleted" type="boolean">Apakah request penghapusan berhasil.</ResponseField>
