profound-logoProfound CMS
⌘K
Admin
Theme
DocsTutorialBlogPhilosophy
DocsTutorialBlogPhilosophy

Hybrid

Collection of Pages with ComponentsTypes of ComponentsSetup server sent events (SSE) content refetchInstall Profound CMS as a proxyCEL Scripting in Template BuilderProject ScaffoldingMedia Library

Headless

Quick startJSON 与 Claude 代码组件 Zod 拉取

REST API

REST API 概览get连接网站 APIgetGET /routesgetGET /routegetGET /blocksget获取带有 CEL 缓存的区块getGET /blocks/generatedgetGET /componentsgetGET /components/{name}getGET /dataset/{schema_name}get获取内容变更 SSEpatchPATCH /dataset/{schema_name}postPOST /translationpatchPATCH /translationsgetGET /usagepostPOST /csvpatch修补 CSV
All Systems Operational
Powered Byprofound-logo
Theme

PATCH /translations

手动替换单个现有翻译的存储内容。

手动替换现有翻译的存储内容。当需要在不重新翻译整个文档的情况下修正机器生成的输出时使用此功能。

端点: PATCH /translations 认证: Bearer JWT(WorkOS)

请求正文

{
  "document_id": "<uuid>",
  "language": "fr",
  "content": {
    "title": "Bonjour",
    "body": "..."
  }
}
字段类型必填说明
document_iduuidyes与该翻译关联的源文档。
languagestringyes要更新的翻译的语言代码。
contentobjectyes替换的翻译内容。必须是一个 JSON 对象。

document_id 与 language 的组合用于定位翻译记录。

响应

{
  "document_id": "<uuid>",
  "language": "fr",
  "updated": true
}

源哈希行为

手动更新翻译不会更改其 source_hash。

因此:

  • 如果源文档未发生变化,则后续的 POST /translation 会跳过翻译并保留手动更正的内容
  • 如果源文档发生变化,其哈希将不再匹配,后续的翻译任务可能会重新生成并覆盖手动更正的内容

示例

curl -X PATCH '{TRANSLATION_API_URL}/translations' \
  -H 'Authorization: Bearer <workos-jwt>' \
  -H 'Content-Type: application/json' \
  -d '{
    "document_id": "<uuid>",
    "language": "fr",
    "content": {
      "title": "Bonjour",
      "body": "Contenu corrigé."
    }
  }'

错误

  • 400 Bad Request — content 不是 JSON 对象
  • 401 Unauthorized — 持有者令牌缺失或无效
  • 404 Not Found — 对于提供的 document_id 和 language 不存在翻译
  • 500 Internal Server Error — 由于数据库或服务错误,无法更新翻译
Continue Reading
Previous‹POST /translationNextGET /usage›