---
title: "Delete a file by ID. After this returns, the file no longer appears in
`GET /v1/files`, content download returns 404, and the ID can no longer
be referenced in chat attachments."
method: DELETE
path: "/v1/files/{file_id}"
tags: ["v1"]
---

# Delete a file by ID. After this returns, the file no longer appears in
`GET /v1/files`, content download returns 404, and the ID can no longer
be referenced in chat attachments.

`DELETE /v1/files/{file_id}`

## Path parameters

- `file_id` string, required

## Response `200`

Success

- DeleteFileResponse
  - `deleted` boolean, required — Whether the file was deleted.
  - `id` string, required — The ID of the file.
  - `object` string, required — The object type, which is always "file". Only included for compatibility.

## Other responses

- `404` — File not found or already deleted.

---

[API](https://skmtc.net/x/apis/xai-s-rest-api.md) · [All operations](https://skmtc.net/x/apis/xai-s-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/x/xai-s-rest-api/versions/8f6014272113/schema)
