# General Translation Platform: Генерация контекста проекта
URL: https://generaltranslation.com/ru/docs/platform/openapi/reference/translation/generate-project-context.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Ставит в очередь генерацию глоссариев и инструкций по переводу на основе переданных исходных файлов. Требуется разрешение project:context:write.

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

## Endpoint

`POST https://api.gtx.dev/v2/projects/{projectId}/context/generate`

**Operation ID:** `generateProjectContext`

**Tags:** `Translation`

**Summary:** Generate project context

Queue generation of glossaries and translation instructions from the supplied source files. Requires `project:context: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):
- `files` (object[], required)
  - `branchId` (string)
  - `fileId` (string, required)
  - `versionId` (string, required)
- `locales` (string[])
- `force` (boolean) Default: `false`.

### Responses

**200**: The project's context is already current and `force` is not set, so nothing was queued and `job` is `null`.
Response body (`application/json`, object):
- `job` (object | null, required): The queued context generation job; `null` when the project's context is already current and nothing was queued.
  - `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.

**202**: Queued context generation job. The target locales are added to the project's current locales. Poll the job with `GET /v2/projects/{projectId}/jobs/{jobId}`.
Response body (`application/json`, object):
- `job` (object | null, required): The queued context generation job; `null` when the project's context is already current and nothing was queued.
  - `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):

**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 supplied file does not exist in the project. 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.
