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 /dataset/{schema_name}

按文档 ID 对自定义组件的文档变体执行插入或更新。

针对自定义组件的某个变体(一行 documents),按文档 id 作为键执行插入或更新。提供 id 时会更新现有变体;省略则插入新的变体。也可通过 /schemas/{schema_name} 使用。本内容会根据组件的架构进行验证。

认证: API 密钥——始终必需,且该密钥必须具有 content_write 权限。

路径参数

参数类型必填说明
schema_namestringyes自定义组件名称。

查询参数

参数类型必填说明
websiteIduuidno目标网站;回退到 Host 标头/配置。
api_keystringno作为 x-api-key 标头的替代方案。

请求正文

{
  "id": "<uuid>",
  "title": "我的变体",
  "content": { "title": "你好", "body": "..." }
}
字段类型必填说明
iduuidno存在时更新匹配的变体;缺失或未找到时插入。
titlestringno显示标题。插入时默认为 "Untitled";更新时若省略则保持不变。
contentobjectyes字段值,会根据组件的架构进行验证。必须是 JSON 对象。

响应

{
  "id": "...",
  "schema_name": "post",
  "title": "我的变体",
  "status": "草稿",
  "version": 2,
  "created": true
}

created 在插入时为 true(HTTP 201),在更新时为 false(HTTP 200)。

示例

curl -X PATCH '{CMS_API_URL}/dataset/post?websiteId=<uuid>' \
  -H 'x-api-key: <key>' \
  -H 'Content-Type: application/json' \
  -d '{"content":{"title":"你好"}}'

错误

  • 400 — 无效的 websiteId、content 不是对象、组件未知或已归档,或验证失败
  • 401 — 缺失或无效的 API 密钥
  • 403 — 密钥缺少 content_write 权限
  • 404 — 提供了 id 但没有匹配的变体
Continue Reading
Previous‹获取内容变更 SSENextPOST /translation›