# General Translation Platform: Téléverser des fichiers sources
URL: https://generaltranslation.com/fr/docs/platform/openapi/reference/files/upload-source-files.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Téléverse de 1 à 100 fichiers sources dans le projet. Nécessite project:files:write.

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

## 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 & object | object, required)
- `sourceLocale` (string): Default locale for files in this request; each file's own locale takes precedence. Defaults to the project's default locale, which the upload does not change.

### Responses

**200**: One result per file, in request order, even when every file fails; one failure does not affect the other files. `invalid_request`: content that is not valid base64 or does not parse as its `fileFormat`, or an upload that is missing or another format. `file_too_large`: larger than the API reads per file. `branch_not_found`: `branchId`, `checkedOutBranchId` or `incomingBranchId` names no branch. 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 | object[], required): One result per uploaded source file, in request order.

**400**: The request is malformed or failed validation, or its uploaded non-media files are together too large to read (`file_too_large`). Nothing is saved.
Response body (`application/json`, object):
- `error` (string, required)
- `code` ("invalid_request" | "invalid_content_encoding" | "api_version_unsupported" | "file_too_large" | "api_version_too_old", required)

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

**401**: Authentication is missing or invalid.
Response body (`application/json`, object):
- `error` (string, required)
- `code` ("unauthenticated" | "api_key_invalid", 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)
- `code` ("ip_not_allowed" | "permission_denied" | "permission_missing" | "target_inaccessible", required)

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

**404**: The requested resource was not found.
Response body (`application/json`, object):
- `error` (string, required)
- `code` ("not_found", 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)
- `code` ("payload_too_large", required)

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

**415**: The request body's Content-Type is missing or not supported, or its Content-Encoding is not supported. Send the body as application/json, uncompressed or gzip-encoded.
Response body (`application/json`, object):
- `error` (string, required)
- `code` ("unsupported_media_type" | "unsupported_content_encoding", required)

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

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

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

**500**: An unexpected server error occurred.
Response body (`application/json`, object):
- `error` (string, required)
- `code` ("internal_error", 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)
- `code` ("unavailable", 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.
