# General Translation Platform: 更新项目
URL: https://generaltranslation.com/zh/docs/platform/openapi/reference/projects/update-project.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: 更新项目的默认区域设置或 CDN 分发设置，并返回更新后的项目。需要 project:write 权限。

{/* 此文件由 Fumadocs 生成。请勿直接编辑此文件。如需修改，请重新运行生成命令。 */}

## Endpoint

`PATCH https://api.gtx.dev/v2/projects/{projectId}`

**Operation ID:** `updateProject`

**Tags:** `Projects`

**Summary:** Update a Project

Update a project's default locale or CDN delivery setting and return the updated project. Requires `project: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): Omitted settings remain unchanged.
- `defaultLocale` (string): Source locale for the project.
- `cdnEnabled` (boolean): Enable or disable CDN publishing for subsequent operations. Changing this setting does not publish or unpublish existing files.

### Responses

**200**: Updated project
Response body (`application/json`, object):
- `id` (string, required)
- `name` (string, required)
- `orgId` (string, required)
- `defaultLocale` (string, required)
- `currentLocales` (string[], required)
- `autoApprove` (boolean, required)
- `cdnEnabled` (boolean, required)

**400**: The request is malformed or failed validation.
Response body (`application/json`, object):
- `error` (string, required)
- `code` ("invalid_request" | "invalid_content_encoding" | "api_version_unsupported" | "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_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):

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.
