# General Translation Platform: Traduire des fichiers
URL: https://generaltranslation.com/fr/docs/platform/openapi/reference/translation/translate-files.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Met en file d’attente les fichiers sources téléversés afin qu’ils soient traduits en arrière-plan dans les locales cibles. Nécessite project:translations:enqueue.

{/* Ce fichier a été généré par Fumadocs. Ne le modifiez pas directement. Pour apporter des modifications, relancez la commande de génération. */}

## Endpoint

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

**Operation ID:** `translateFiles`

**Tags:** `Translation`

**Summary:** Translate files

Queue uploaded source files for background translation into the target locales. Requires `project:translations:enqueue`.

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):
- `files` (object[], required): 1–100 files; each branch, file and version may appear once. Omitting `branchId` selects the default branch.
  - `branchId` (string)
  - `fileId` (string, required)
  - `versionId` (string, required)
  - `fileName` (string)
  - `transformFormat` ("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")
- `targetLocales` (string[]): Locales to translate into; the project's current locales when omitted. They are added to the project's current locales; the project default locale is unchanged.
- `sourceLocale` (string)
- `force` (boolean): Queue files already translated into a locale; without it they get no job for that locale. Default: `false`.
- `modelProvider` ("ANTHROPIC" | "OPENAI" | "XAI" | "GOOGLE" | "HYPERCLOVA")
- `publish` (boolean)

### Responses

**202**: Queued translation jobs, one per file and locale that needs translating, so `jobs` may be empty. Poll jobs with `POST /v2/projects/{projectId}/jobs/query`.
Response body (`application/json`, object):
- `jobs` (object[], required): One job per file and target locale that needs translating; empty when every file is already translated into every target locale.
  - `id` (string, required)
  - `status` ("queued" | "processing" | "completed" | "failed", required): `queued`: accepted and waiting to run. `processing`: running, or waiting to retry after a failed attempt. `completed` and `failed` are final.
  - `subject` (object | object | object, required): What the job works on, by `type`. A file translation names its source file version and target locale.

**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):

**402**: The organization's billing account is blocked, or its plan usage limit, monthly spend limit, or credit balance does not cover this request.
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 file version does not exist on its branch. Nothing is queued.
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):

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.
