---
title: "Get file content"
method: GET
path: "/v2/projects/{projectId}/files/{fileId}/content"
tags: ["Files"]
---

# Get file content

`GET /v2/projects/{projectId}/files/{fileId}/content`

## Request

- Base URL: `https://api.gtx.dev`
- URL: `https://api.gtx.dev/v2/projects/{projectId}/files/{fileId}/content`
- Auth: HTTP bearer

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

## Path parameters

- `projectId` string, required
- `fileId` string, required: File ID.

## Query parameters

- `branchId` string: Branch ID. Defaults to the project default branch.
- `versionId` string: Source version ID. Defaults to the branch head.
- `locale` string: Translation locale. Omit to download the source file.

## Headers

- `gt-api-version` '2025-01-01.v0' | '2025-11-03.v1' | '2026-02-18.v1' | '2026-03-06.v1' | '2026-10-08.v1', required

## Response `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`.

- 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, nullable, required: Base64 file content; `null` when `status` is `pending`, or when the file is too large to return inline, in which case fetch it from `downloadUrl`.
  - `downloadUrl` string: Signed URL that serves the raw file for 15 minutes; present when `status` is `ready` and `data` is `null`, and for media files.
  - `metadata` JsonObject: Present when `status` is `ready`.
  - `fileFormat` 'GTJSON' | 'JSON' | 'YAML' | 'MD' | 'MDX' | 'TS' | 'JS' | 'HTML' | 'TXT' | 'PO' | 'POT' | 'TWILIO_CONTENT_JSON' | 'LOTTIE' | 'SVG' | 'XCSTRINGS' | 'DOT_STRINGS' | 'DOT_STRINGSDICT' | 'ANDROID_STRINGS' | 'SRT' | 'RESX' | 'PNG' | 'JPEG' | 'MP4': Present when `status` is `ready`.

## Other responses

- `400`: The request is malformed or failed validation.
- `401`: Authentication is missing or invalid.
- `403`: The caller is authenticated but not allowed to perform this operation or access the requested resource.
- `404`: The requested resource was not found.
- `429`: Too many requests. The rate limit was exceeded.
- `500`: An unexpected server error occurred.

## Changes

- **2026-11-06** `39f0059275f1`: 12 warning
  - added the new `invalid_content_encoding` enum value to the `allOf[#/components/schemas/ErrorResponse]/code` response property for the response status `400`
  - added the new `invalid_content_encoding` enum value to the `allOf[#/components/schemas/ErrorResponse]/code` response property for the response status `401`
  - added the new `invalid_content_encoding` enum value to the `allOf[#/components/schemas/ErrorResponse]/code` response property for the response status `403`
  - added the new `invalid_content_encoding` enum value to the `allOf[#/components/schemas/ErrorResponse]/code` response property for the response status `404`
  - …8 more
- **2026-11-05** `d8e2891005f3`: 6 warning
  - added the new `integration_managed_file` enum value to the `allOf[#/components/schemas/ErrorResponse]/code` response property for the response status `400`
  - added the new `integration_managed_file` enum value to the `allOf[#/components/schemas/ErrorResponse]/code` response property for the response status `401`
  - added the new `integration_managed_file` enum value to the `allOf[#/components/schemas/ErrorResponse]/code` response property for the response status `403`
  - added the new `integration_managed_file` enum value to the `allOf[#/components/schemas/ErrorResponse]/code` response property for the response status `404`
  - …2 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/generaltranslation/apis/general-translation-api/changes/v2/projects/:projectId/files/:fileId/content/get.md)

---

[API](https://skmtc.dev/generaltranslation/apis/general-translation-api.md) - [All operations](https://skmtc.dev/generaltranslation/apis/general-translation-api/llms.txt) - [OpenAPI document](https://skmtc.dev/generaltranslation/apis/general-translation-api/revisions/1ebafb7f823e?raw)
