---
title: "Move a file"
method: PATCH
path: "/files/{id}"
tags: ["Files"]
---

# Move a file

`PATCH /files/{id}`

## Request

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

Move a file to a different folder by updating its `folder_id`. Org-scoped keys can move non-access-controlled files to non-access-controlled destination folders.

## Path parameters

- `id` string, uuid, required: The file ID

## Request body

- UpdateFileRequest
  - `folder_id` string, uuid, nullable, required: Target folder ID to move the file to. Pass null to move to the root.

## Response `200`

File moved successfully

- FileResponse
  - `id` string, uuid, required: Unique file identifier
  - `name` string, required: Original filename
  - `size` number, required: File size in bytes
  - `content_type` string, required: MIME type of the file
  - `status` 'extracting' | 'embedding' | 'ready' | 'failed', required: Current processing status of the file
  - `created_at` string, required: ISO 8601 creation timestamp
  - `folder_id` string, uuid, nullable: Folder the file belongs to
  - `extraction_error` string: Error message if extraction failed
  - `project_id` string, uuid: Project the file is linked to, if uploaded with project_id
  - `warning` string: Present when the file was uploaded successfully but a secondary operation (e.g. project linking) failed

## Other responses

- `400`: Invalid request body
- `401`: Missing or malformed API key
- `403`: Destination folder access denied
- `404`: File not found or access denied
- `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)
