Files

Get file content

Changed on

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

get/v2/projects/{projectId}/files/{fileId}/content

Request

  • Base URL
    https://api.gtx.dev
  • Auth
    HTTP bearer

Path parameters

projectIdstring required
fileIdstring required

File ID.

Query parameters

branchIdstring

Branch ID. Defaults to the project default branch.

versionIdstring

Source version ID. Defaults to the branch head.

localestring

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

API contract version. Must be 2026-10-08.v1 or later; requests without it or with an older version return 400.

Response

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.

status'ready' | 'pending' required

pending when the translation is stored but not completed yet, for example during a layout pass; request it again later.

branchIdstring required
fileIdstring required
versionIdstring required
localestring

The selector's locale, as requested; present only for translations.

fileNamestring

Present when status is ready. For a translation, its source file's name.

datastring 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.

downloadUrlstring

Signed URL that serves the raw file for 15 minutes; present when status is ready and data is null, and for media files.

metadataJsonObject

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.

Changes

    • warning

      added the new invalid_content_encoding enum value to the //// response property for the response status

    • warning

      added the new invalid_content_encoding enum value to the //// response property for the response status

    • warning

      added the new invalid_content_encoding enum value to the //// response property for the response status

    • warning

      added the new invalid_content_encoding enum value to the //// response property for the response status

    • warning

      added the new invalid_content_encoding enum value to the //// response property for the response status

    • warning

      added the new invalid_content_encoding enum value to the //// response property for the response status

    • warning

      added the new unsupported_content_encoding enum value to the //// response property for the response status

    • warning

      added the new unsupported_content_encoding enum value to the //// response property for the response status

    • warning

      added the new unsupported_content_encoding enum value to the //// response property for the response status

    • warning

      added the new unsupported_content_encoding enum value to the //// response property for the response status

    • warning

      added the new unsupported_content_encoding enum value to the //// response property for the response status

    • warning

      added the new unsupported_content_encoding enum value to the //// response property for the response status

    • warning

      added the new integration_managed_file enum value to the //// response property for the response status

    • warning

      added the new integration_managed_file enum value to the //// response property for the response status

    • warning

      added the new integration_managed_file enum value to the //// response property for the response status

    • warning

      added the new integration_managed_file enum value to the //// response property for the response status

    • warning

      added the new integration_managed_file enum value to the //// response property for the response status

    • warning

      added the new integration_managed_file enum value to the //// response property for the response status