# General Translation Platform: Получение содержимого файла
URL: https://generaltranslation.com/ru/docs/platform/openapi/reference/files/get-file-content.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Скачивает один исходный файл или его перевод, если указана локаль. Требуется разрешение project:files:read.

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

## Endpoint

`GET https://api.gtx.dev/v2/projects/{projectId}/files/{fileId}/content`

**Operation ID:** `getFileContent`

**Tags:** `Files`

**Summary:** Get file content

Download one source file, or its translation when `locale` is given. Requires `project:files:read`.

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

### Parameters

- `projectId` (path, string, required)
- `fileId` (path, string, required): File ID.
- `branchId` (query, string, optional): Branch ID. Defaults to the project default branch.
- `versionId` (query, string, optional): Source version ID. Defaults to the branch head.
- `locale` (query, string, optional): Translation locale. Omit to download the source file.
- `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.

### Responses

**200**: File content, or a pending translation: a result of `POST /v2/projects/{projectId}/files/content/query` with `status: ready` and the content, or, when the translation is stored but not completed yet, for example during a layout pass, `status: pending` with its `fileId`, `branchId`, `versionId` and requested `locale`, and `data: null`. A translation is not found while its translation job has not stored the translation yet, so wait for the job with `GET /v2/projects/{projectId}/jobs/{jobId}` or `POST /v2/projects/{projectId}/jobs/query` before reading it. Without `versionId`, a translation is the newest completed version on the branch, and `pending` only while none is completed; to wait for a specific version, pass its `versionId`.
Response body (`application/json`, object):
- `status` ("ready" | "pending", required): `pending` when the translation is stored but not completed yet, for example during a layout pass; request it again later.
- `branchId` (string, required)
- `fileId` (string, required)
- `versionId` (string, required)
- `locale` (string): The selector's locale, as requested; present only for translations.
- `fileName` (string): Present when `status` is `ready`. For a translation, its source file's name.
- `data` (string | null, required): Base64 file content; `null` exactly when `status` is `pending`.
- `metadata` (object): Present when `status` is `ready`.
  - `<key>` (string | number | boolean | null | string | number | boolean | null | object[] | object | null[] | object, dynamic key)
- `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" & object)

**400**: The request is malformed or failed validation.
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**: The requested resource was not found.
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):

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.
