# Update File [View original](https://ittybit.cloud/api/files/update) `PATCH /files/{id}` Update a file's `filename`, `folder`, `ref`, or `metadata`. Only the specified fields will be updated. ### Parameters ```json [ { "$ref": "#/components/parameters/AcceptVersionHeader" }, { "in": "path", "name": "id", "required": true, "schema": { "type": "string", "example": "file_abcdefgh1234" } } ] ``` ### Request Body The request body should contain a properly formatted JSON object. Optional properties are listed below. See [File Object](/docs/files) for more details. **Schema:** ```json { "type": "object", "properties": { "folder": { "type": "string" }, "filename": { "type": "string" }, "ref": { "type": "string" }, "metadata": { "type": "object" } } } ``` **Example:** ```json { "folder": "updated/folder", "filename": "new_filename.mp4", "metadata": { "customKey": "a different custom value" } } ``` ### Responses #### 200 - Success **Example:** ```json { "id": "file_abcdefgh1234", "media_id": "med_abcdefgh1234", "object": "source", "kind": "video", "type": "video/mp4", "width": 1920, "height": 1080, "duration": 123.45, "filesize": 12345678, "folder": "updated/folder", "filename": "new_filename.mp4", "url": "https://you.ittybit.net/updated/folder/new_filename.mp4", "metadata": { "customKey": "a different custom value" }, "created": "2025-01-01T01:23:45Z", "updated": "2025-01-02T01:23:45Z", "status": "ready" } ```