版本:202601
创建主题文件
POST/openapi/2026-01/themes/:theme_id/doc
在指定主题中创建新文件。
请求
Path参数
theme_id string必填
主题 ID
- application/json
- 请求体
- 示例
请求体必填
doc object必填
要创建的文件,包含文件类型、路径和内容
typestring必填
文件类型:layout、templates、sections、snippets、assets、config、locales、blocks
locationstring必填
位置信息
contentstring
内容。不传时创建空文件
json
{
"doc": {
"type": "string",
"location": "string",
"content": "string"
}
}
响应
- 200
OK
- application/json
- 数据结构
- 示例
数据结构
codestring
错误码
messagestring
错误信息
data object
object
json
{
"code": "string",
"message": "string",
"data": {}
}