# General Translation Platform: Загрузка исходных файлов
URL: https://generaltranslation.com/ru/docs/platform/openapi/reference/files/upload-source-files.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Загружает в проект от 1 до 100 исходных файлов. Требуется разрешение project:files:write.

{/* Этот файл автоматически создан с помощью Fumadocs. Не редактируйте его напрямую. Для внесения изменений повторно выполните команду генерации. */}

## Endpoint

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

**Operation ID:** `uploadSourceFiles`

**Tags:** `Files`

**Summary:** Upload source files

Upload 1–100 source files to the project. 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", required): API contract version. Must be `2026-10-08.v1` or later; requests without it or with an older version return 400.

### Request body (required)

Body (`application/json`, object):
- `data` (object[], required): 1–100 source files; each branch and file may appear once.
  - `source` (object, required)
    - `content` (string, required): Base64-encoded file content.
    - `fileName` (string, required)
    - `fileFormat` ("GTJSON" | "MDX" | "JSON" | "YAML" | "MD" | "TS" | "JS" | "HTML" | "TXT" | "PO" | "POT" | "TWILIO_CONTENT_JSON" | "LOTTIE" | "SVG" | "XCSTRINGS" | "DOT_STRINGS" | "DOT_STRINGSDICT" | "ANDROID_STRINGS" | "SRT" | "RESX", required)
    - `dataFormat` (string)
    - `locale` (string, required)
    - `fileId` (string)
    - `versionId` (string)
    - `branchId` (string)
    - `checkedOutBranchId` (string)
    - `incomingBranchId` (string)
    - `formatMetadata` (object)
      - `<key>` (object, dynamic key)
- `sourceLocale` (string): Locale of the uploaded files. Defaults to the project's default locale, which the upload does not change.

### Responses

**200**: Upload result for each source file, in request order, even when every file fails to save: a failed file has `status: "failed"` and an `error` while the other files are saved. Retrying with the same content and identifiers is safe.
Response body (`application/json`, object):
- `summary` (object, required): Number of `results` in total and by `status`.
  - `total` (integer, required)
  - `succeeded` (integer, required)
  - `failed` (integer, required)
- `results` (object[], required): One result per uploaded source file, in request order.
  - `branchId` (string, required)
  - `fileId` (string, required)
  - `versionId` (string, required)
  - `fileName` (string, required)
  - `fileFormat` ("GTJSON" | "MDX" | "JSON" | "YAML" | "MD" | "TS" | "JS" | "HTML" | "TXT" | "PO" | "POT" | "TWILIO_CONTENT_JSON" | "LOTTIE" | "SVG" | "XCSTRINGS" | "DOT_STRINGS" | "DOT_STRINGSDICT" | "ANDROID_STRINGS" | "SRT" | "RESX", required)
  - `dataFormat` ("JSX" | "ICU" | "I18NEXT" | "STRING")
  - `status` ("succeeded" | "failed", required)
  - `error` (string): Why the item failed.

**400**: The request is malformed or failed validation, including a file whose content is not valid base64 or does not parse in its `fileFormat`. Nothing is saved, and the error names each such file by its index and fileName.
Response body (`application/json`, object):
- `error` (string, required)

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

**401**: Authentication is missing or invalid.
Response body (`application/json`, object):
- `error` (string, 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)

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

**404**: A named branch does not exist. Nothing is saved.
Response body (`application/json`, object):
- `error` (string, 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)

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)

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

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

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

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

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

**503**: The server is too busy to process the uploaded files. Retry later.
Response body (`application/json`, object):
- `error` (string, 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.
