# General Translation Platform: Update files
URL: https://generaltranslation.com/en-US/docs/platform/openapi/reference/files/update-files.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Update 1–100 source files or translations in one atomic batch. Requires project:files:write.

## Endpoint

`PATCH https://api.gtx.dev/v2/projects/{projectId}/files`

**Operation ID:** `updateFiles`

**Tags:** `Files`

**Summary:** Update files

Update 1–100 source files or translations in one atomic batch. Requires `project:files:write`.

Authentication: required. Send an API key in the `Authorization: Bearer <key>` header when authenticating.

### Parameters

- `projectId` (path, string, required)
- `gt-api-version` (header, "2026-10-08.v1", optional): API contract version. Defaults to the oldest supported version.

### Request body (required)

Body (`application/json`, object): An absent field keeps its stored value. `null` clears a nullable field or removes a map entry; other fields reject `null`. In batches and imports, items match stored items by natural key, stored items absent from the batch are untouched, and nothing else is deleted. A blank CSV cell counts as absent.
- `files` (object[], required): 1–100 source files or translations; each branch, file, version and locale may appear once.
  - `fileId` (string, required)
  - `branchId` (string): Branch ID. Defaults to the project default branch.
  - `versionId` (string, required): Source version ID.
  - `locale` (string): Translation locale. Omit to update the source file.
  - `metadata` (object, required)
    - `previewUrl` (string | null (uri)): Page that shows this version of the file.

### Responses

**200**: Each file after the update, in request order. Repeating a request is safe.
Response body (`application/json`, object):
- `files` (object[], required): Each file after the update, in request order.
  - `branchId` (string, required)
  - `fileId` (string, required)
  - `versionId` (string, required)
  - `locale` (string): Translation locale as stored. Absent for a source file.
  - `metadata` (object, required)
    - `previewUrl` (string | null (uri)): Page that shows this version of the file.

**400**: The request is malformed or failed validation.
Response body (`application/json`, object):
- `error` (string, required)
- `code` ("invalid_request" | "api_version_unsupported", required)

Response body (`text/html`, string):

**401**: Authentication is missing or invalid.
Response body (`application/json`, object):
- `error` (string, required)
- `code` ("unauthenticated" | "api_key_invalid", required)

Response body (`text/html`, string):

**403**: The caller is authenticated but not allowed to perform this operation or access the requested resource.
Response body (`application/json`, object):
- `error` (string, required)
- `code` ("ip_not_allowed" | "permission_missing" | "target_inaccessible", required)

Response body (`text/html`, string):

**404**: A translation does not exist. Nothing is written.
Response body (`application/json`, object):
- `error` (string, required)
- `code` ("source_file_not_found" | "not_found", required)

Response body (`text/html`, string):

**409**: A source file version belongs to an integration, which owns its metadata. Nothing is written.
Response body (`application/json`, object):
- `error` (string, required)
- `code` ("integration_managed_file", required)

Response body (`text/html`, string):

**413**: The request, or the data it would return, exceeds a size or item limit.
Response body (`application/json`, object):
- `error` (string, required)
- `code` ("payload_too_large", required)

Response body (`text/html`, string):

**415**: The request body's Content-Type is missing or not supported. Send the body as application/json.
Response body (`application/json`, object):
- `error` (string, required)
- `code` ("unsupported_media_type", required)

Response body (`text/html`, string):

**429**: Too many requests. The rate limit was exceeded.
Response body (`application/json`, object):
- `error` (string, required)
- `code` ("rate_limited", required)

Response body (`text/html`, string):

**500**: An unexpected server error occurred.
Response body (`application/json`, object):
- `error` (string, required)
- `code` ("internal_error", required)

Response body (`text/html`, string):

Complete OpenAPI 3.1 specification: https://generaltranslation.com/openapi.yaml

OpenAPI schema: [openapi.json](https://generaltranslation.com/openapi.json)

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
