# General Translation Platform: 上传项目资源 URL: https://generaltranslation.com/zh/docs/platform/openapi/reference/project/upload-assets.mdx --- title: "上传项目资源" description: "通过项目上传 OpenType 或 TrueType 字体,供所属组织内的 Lottie 翻译工作流程使用。每种字体均由基于其字体系列、字重和斜体样式生成的标准化标识唯一确定(该标识来自提供的 family 和 style,或字体元数据和文件名)。重新上传具有相同标识的字体会覆盖现有资源,因此在收到 500 响应后可以安全地完整重试。上传项目资源的 API 参考。" method: POST full: true _openapi: method: POST route: /v2/project/assets toc: [] structuredData: headings: [] contents: - content: > 通过项目上传 OpenType 或 TrueType 字体,供所属组织内的 Lottie 翻译工作流程使用。每种字体均由基于其字体系列、字重和斜体样式生成的标准化标识唯一确定(该标识来自提供的 `family` 和 `style`,或字体元数据和文件名)。重新上传具有相同标识的字体会覆盖现有资源,因此在收到 `500` 响应后可以安全地完整重试。 --- ## `POST https://api.gtx.dev/v2/project/assets` Upload OpenType or TrueType fonts through a Project and make them available to Lottie translation workflows across its Organization. Each font is keyed by a normalized identity derived from its family, weight, and italic style (from the supplied `family` and `style`, or from the font metadata and file name). Re-uploading the same identity overwrites the existing asset, so complete retries after a `500` response are safe. Authentication: send an API key as a bearer token in the `Authorization: Bearer ` header. ### Parameters - `gt-api-version` (header, "2025-01-01.v0" | "2025-11-03.v1" | "2026-02-18.v1" | "2026-03-06.v1", optional): API version. Defaults to the earliest supported version. Latest is `2026-03-06.v1`. - `gt-project-id` (header, string, optional): Target project ID. Required when authenticating with an organization API key. ### Request body Body (`application/json`, object): - `assets` (object[], required) - `assetType` ("FONT", required): Asset type. Only `FONT` is supported. - `content` (string, required): Base64-encoded font content, up to 20MB after decoding. - `fileName` (string, required): Font file name ending in `.ttf` or `.otf`. - `family` (string): Font family name used by the Lottie file. When omitted, the server derives it from the font metadata or file name. - `style` (string): Style or weight used with `family`, such as `Bold`, `350`, or `Bold Italic`. Defaults to Regular (`400`) when `family` is set. ### Responses **201**: Uploaded font assets. Response body (`application/json`, object): - `assets` (object[], required) - `id` (string): Stored organization asset ID. - `assetKey` (string): Normalized identity in the form `-[-i]`. - `fileName` (string) - `count` (number, required): Number of uploaded assets. **400**: Invalid request body, invalid base64, an empty asset, an unsupported file extension, an asset larger than 20MB, or a font family that cannot be determined. Response body (`application/json`, object): - `error` (string): Human-readable error message. **401**: Missing or invalid API key. Response body (`application/json`, object): - `error` (string): Human-readable error message. **403**: The API key lacks the required permission, or the action is not allowed on the current plan. Response body (`application/json`, object): - `error` (string): Human-readable error message. **404**: The requested resource was not found. Response body (`application/json`, object): - `error` (string): Human-readable error message. **413**: The JSON request body exceeds 100MB. Response body (`application/json`, object): - `error` (string): Human-readable error message. **429**: Rate limit or quota exceeded. Response body (`application/json`, object): - `error` (string): Human-readable error message. **500**: An asset could not be stored. Retry the complete request; each font identity is upserted. Response body (`application/json`, object): - `error` (string): Human-readable error message. The complete OpenAPI 3.1 spec is available at https://generaltranslation.com/openapi.yaml.