# Update File [View original](https://ittybit.com/api/files/update) `PATCH /files/{id}` Update a file's `filename`, `folder`, `ref`, or `metadata`. Only the specified fields will be updated. ### Parameters ```json [ { "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": { "customKey2": "a different custom value" } } ``` ### Responses #### 200 - Success **Example:** ```json { "meta": { "request_id": "req_abcdefghij1234567890", "org_id": "org_abcdefgh1234", "project_id": "prj_abcdefgh1234", "version": "2025-01-01", "type": "object" }, "data": { "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": { "customKey2": "a different custom value" }, "created": "2025-01-01T01:23:45Z", "updated": "2025-01-02T01:23:45Z", "status": "ready" }, "error": null, "links": { "self": "https://api.ittybit.com/files/file_abcdefgh1234", "parent": "https://api.ittybit.com/files" } } ```