---
title: "Detach a file from a chat"
method: DELETE
path: "/chats/{id}/files/{fileId}"
tags: ["Chats"]
---

# Detach a file from a chat

`DELETE /chats/{id}/files/{fileId}`

## Request

- Base URL: `https://app.gc.ai/api/external/v1`
- URL: `https://app.gc.ai/api/external/v1/chats/{id}/files/{fileId}`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/gc-ai/apis/gc-ai-external-api/docs/chats/:id/files/:fileId/delete.ts> (a function with typed inputs; its response is checked against the schema)

Detach a file from a chat. The file is NOT deleted from the organization — only the chat association is removed.

## Path parameters

- `id` string, uuid, required: The chat ID
- `fileId` string, uuid, required: The file ID to detach

## Response `204`

File detached

## Other responses

- `400`: Invalid chat or file ID
- `401`: Missing or malformed API key
- `403`: Invalid API key
- `404`: Chat or file attachment not found
- `429`: Rate limit exceeded. See [Rate Limits](https://docs.gc.ai/api-reference/concepts/rate-limits) for the tiers, limits, and how to back off.
- `500`: Internal server error
- `503`: Service temporarily unavailable

---

[API](https://skmtc.dev/gc-ai/apis/gc-ai-external-api.md) - [All operations](https://skmtc.dev/gc-ai/apis/gc-ai-external-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gc-ai/apis/gc-ai-external-api/revisions/2bbdfddf7107?raw)
