排程与发布
保存新的工作空间草稿
使用 workspace_id、客户端生成的唯一 id、mutation_id 和 content 保存新的共享工作空间草稿。需要 editor 或更高角色及 operate 权限。账户、时间及就绪媒体可以尚未完整。Save 不会创建 Scheduled Post、执行工作或发布额度预留,也不会调用提供方。共享编辑内容不可信且有长度限制。重试时保持完全相同的身份和内容;之后的编辑使用 sosoapi_update_content_draft。
POST /studio-api/content-drafts/create契约审核日期: · sha256:75c8b8ebce408575
概览
使用 workspace_id、客户端生成的唯一 id、mutation_id 和 content 保存新的共享工作空间草稿。需要 editor 或更高角色及 operate 权限。账户、时间及就绪媒体可以尚未完整。Save 不会创建 Scheduled Post、执行工作或发布额度预留,也不会调用提供方。共享编辑内容不可信且有长度限制。重试时保持完全相同的身份和内容;之后的编辑使用 sosoapi_update_content_draft。
成功 HTTP 响应可能表示请求已接受,并非已完成。背景工作请存储返回 ID,持续检查同一操作直到完成。已排程或已接受的帖子,只有平台确认后才算已发布;客户端逾时无法证明结果。
验证与权限
令牌只能使用其所有者持有的权利。每次请求会检查工作区成员资格、资源拥有权、所选工作区及已授予能力。core 与 full 配置只变更显示的工具,不会授予访问权限。
请求字段
「必填」是指在其父对象及所选分支内必填。必填子字段不会使可选父对象变成必填。下列规则与字段名称均复制自契约。
| 字段 / 分支 | 类型 / 必填 | 约束 |
|---|---|---|
$ | object在父对象中必填 |
|
workspace_id | string在父对象中必填 |
|
id | string在父对象中必填 |
|
mutation_id | string在父对象中必填 |
|
content | object在父对象中必填 |
|
content.schemaVersion | number可选/项目 |
|
content.accountIds | array可选/项目 |
|
content.accountIds[] | string可选/项目 |
|
content.caption | string可选/项目 |
|
content.hashtags | string可选/项目 |
|
content.assetIds | array可选/项目 |
|
content.assetIds[] | string可选/项目 |
|
content.threadsTextOnly | boolean可选/项目 |
|
content.instagramMode | string可选/项目 |
|
content.youtubeTitle | string可选/项目 |
|
content.youtubePrivacy | string可选/项目 |
|
content.youtubeSynthetic | boolean可选/项目 |
|
content.youtubeCategoryId | string可选/项目 |
|
content.youtubeShort | boolean可选/项目 |
|
content.linkUrl | string可选/项目 |
|
content.scheduledAt | string可选/项目 |
|
content.displayTimezone | string可选/项目 |
|
content.publishNow | boolean可选/项目 |
|
content.destinationOverrides | object可选/项目 |
|
content.destinationOverrides.* | object可选/项目 |
|
content.destinationOverrides.*.caption | string可选/项目 |
|
content.destinationOverrides.*.scheduledAt | string可选/项目 |
|
content.expiresAt | string可选/项目 |
|
完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"workspace_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"mutation_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"content": {
"type": "object",
"properties": {
"schemaVersion": {
"default": 1,
"type": "number",
"const": 1
},
"accountIds": {
"default": [],
"maxItems": 50,
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"caption": {
"default": "",
"type": "string",
"maxLength": 5000
},
"hashtags": {
"default": "",
"type": "string",
"maxLength": 5000
},
"assetIds": {
"default": [],
"maxItems": 20,
"type": "array",
"items": {
"type": "string",
"maxLength": 16,
"pattern": "^[1-9][0-9]*$"
}
},
"threadsTextOnly": {
"default": false,
"type": "boolean"
},
"instagramMode": {
"default": "REELS",
"type": "string",
"enum": [
"IMAGE",
"REELS",
"CAROUSEL",
"STORY_IMAGE",
"STORY_VIDEO"
]
},
"youtubeTitle": {
"default": "",
"type": "string",
"maxLength": 100
},
"youtubePrivacy": {
"default": "private",
"type": "string",
"enum": [
"private",
"unlisted",
"public"
]
},
"youtubeSynthetic": {
"default": false,
"type": "boolean"
},
"youtubeCategoryId": {
"default": "",
"type": "string",
"maxLength": 32
},
"youtubeShort": {
"default": false,
"type": "boolean"
},
"linkUrl": {
"default": "",
"type": "string",
"maxLength": 2048
},
"scheduledAt": {
"default": "",
"type": "string",
"maxLength": 64
},
"displayTimezone": {
"default": "UTC",
"type": "string",
"minLength": 1,
"maxLength": 128
},
"publishNow": {
"default": false,
"type": "boolean"
},
"destinationOverrides": {
"default": {},
"type": "object",
"propertyNames": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"additionalProperties": {
"type": "object",
"properties": {
"caption": {
"type": "string",
"maxLength": 5000
},
"scheduledAt": {
"type": "string",
"maxLength": 64
}
},
"additionalProperties": false
}
},
"expiresAt": {
"default": "",
"type": "string",
"maxLength": 64
}
},
"additionalProperties": false
}
},
"required": [
"workspace_id",
"id",
"mutation_id",
"content"
],
"additionalProperties": false
}响应与完成
成功 HTTP 状态:200。操作完成时: durable Workspace editorial content; no publishing side effects.
成功 HTTP 响应可能表示请求已接受,并非已完成。背景工作请存储返回 ID,持续检查同一操作直到完成。已排程或已接受的帖子,只有平台确认后才算已发布;客户端逾时无法证明结果。
「必填」是指在其父对象及所选分支内必填。必填子字段不会使可选父对象变成必填。下列规则与字段名称均复制自契约。
| 字段 / 分支 | 类型 / 必填 | 约束 |
|---|---|---|
$ | object在父对象中必填 | — |
draft | object在父对象中必填 | — |
draft.id | string在父对象中必填 |
|
draft.workspace_id | string在父对象中必填 |
|
draft.revision | integer在父对象中必填 |
|
draft.state | string在父对象中必填 |
|
draft.content | object在父对象中必填 | — |
draft.content.schemaVersion | number在父对象中必填 |
|
draft.content.accountIds | array在父对象中必填 |
|
draft.content.accountIds[] | string可选/项目 |
|
draft.content.caption | string在父对象中必填 |
|
draft.content.hashtags | string在父对象中必填 |
|
draft.content.assetIds | array在父对象中必填 |
|
draft.content.assetIds[] | string可选/项目 |
|
draft.content.threadsTextOnly | boolean在父对象中必填 |
|
draft.content.instagramMode | string在父对象中必填 |
|
draft.content.youtubeTitle | string在父对象中必填 |
|
draft.content.youtubePrivacy | string在父对象中必填 |
|
draft.content.youtubeSynthetic | boolean在父对象中必填 |
|
draft.content.youtubeCategoryId | string在父对象中必填 |
|
draft.content.youtubeShort | boolean在父对象中必填 |
|
draft.content.linkUrl | string在父对象中必填 |
|
draft.content.scheduledAt | string在父对象中必填 |
|
draft.content.displayTimezone | string在父对象中必填 |
|
draft.content.publishNow | boolean在父对象中必填 |
|
draft.content.destinationOverrides | object在父对象中必填 |
|
draft.content.destinationOverrides.* | object可选/项目 | — |
draft.content.destinationOverrides.*.caption | string可选/项目 |
|
draft.content.destinationOverrides.*.scheduledAt | string可选/项目 |
|
draft.content.expiresAt | string在父对象中必填 |
|
draft.created_by | string | null在父对象中必填 | — |
draft.created_byanyOf 1 | string在父对象中必填 |
|
draft.created_byanyOf 2 | null在父对象中必填 | — |
draft.updated_by | string | null在父对象中必填 | — |
draft.updated_byanyOf 1 | string在父对象中必填 |
|
draft.updated_byanyOf 2 | null在父对象中必填 | — |
draft.created_at | string在父对象中必填 |
|
draft.updated_at | string在父对象中必填 |
|
draft.submission | object | null在父对象中必填 | — |
draft.submissionanyOf 1 | object在父对象中必填 | — |
draft.submission.idanyOf 1 | string在父对象中必填 |
|
draft.submission.expected_revisionanyOf 1 | integer在父对象中必填 |
|
draft.submission.started_atanyOf 1 | string在父对象中必填 |
|
draft.submission.receiptanyOf 1 | object | null在父对象中必填 | — |
draft.submission.receiptanyOf 1 / anyOf 1 | object在父对象中必填 | — |
draft.submission.receipt.batch_idanyOf 1 / anyOf 1 | string | null在父对象中必填 | — |
draft.submission.receipt.batch_idanyOf 1 / anyOf 1 / anyOf 1 | string在父对象中必填 |
|
draft.submission.receipt.batch_idanyOf 1 / anyOf 1 / anyOf 2 | null在父对象中必填 | — |
draft.submission.receipt.successesanyOf 1 / anyOf 1 | array在父对象中必填 |
|
draft.submission.receipt.successes[]anyOf 1 / anyOf 1 | object可选/项目 | — |
draft.submission.receipt.successes[].social_account_idanyOf 1 / anyOf 1 | string在父对象中必填 |
|
draft.submission.receipt.successes[].post_idanyOf 1 / anyOf 1 | string在父对象中必填 |
|
draft.submission.receipt.failuresanyOf 1 / anyOf 1 | array在父对象中必填 |
|
draft.submission.receipt.failures[]anyOf 1 / anyOf 1 | object可选/项目 | — |
draft.submission.receipt.failures[].social_account_idanyOf 1 / anyOf 1 | string在父对象中必填 |
|
draft.submission.receipt.failures[].codeanyOf 1 / anyOf 1 | string在父对象中必填 |
|
draft.submission.receipt.failures[].messageanyOf 1 / anyOf 1 | string在父对象中必填 |
|
draft.submission.receiptanyOf 1 / anyOf 2 | null在父对象中必填 | — |
draft.submissionanyOf 2 | null在父对象中必填 | — |
replayed | boolean在父对象中必填 | — |
完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"draft": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"workspace_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"revision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"state": {
"type": "string",
"enum": [
"draft",
"submitting",
"submitted"
]
},
"content": {
"type": "object",
"properties": {
"schemaVersion": {
"default": 1,
"type": "number",
"const": 1
},
"accountIds": {
"default": [],
"maxItems": 50,
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"caption": {
"default": "",
"type": "string",
"maxLength": 5000
},
"hashtags": {
"default": "",
"type": "string",
"maxLength": 5000
},
"assetIds": {
"default": [],
"maxItems": 20,
"type": "array",
"items": {
"type": "string",
"maxLength": 16,
"pattern": "^[1-9][0-9]*$"
}
},
"threadsTextOnly": {
"default": false,
"type": "boolean"
},
"instagramMode": {
"default": "REELS",
"type": "string",
"enum": [
"IMAGE",
"REELS",
"CAROUSEL",
"STORY_IMAGE",
"STORY_VIDEO"
]
},
"youtubeTitle": {
"default": "",
"type": "string",
"maxLength": 100
},
"youtubePrivacy": {
"default": "private",
"type": "string",
"enum": [
"private",
"unlisted",
"public"
]
},
"youtubeSynthetic": {
"default": false,
"type": "boolean"
},
"youtubeCategoryId": {
"default": "",
"type": "string",
"maxLength": 32
},
"youtubeShort": {
"default": false,
"type": "boolean"
},
"linkUrl": {
"default": "",
"type": "string",
"maxLength": 2048
},
"scheduledAt": {
"default": "",
"type": "string",
"maxLength": 64
},
"displayTimezone": {
"default": "UTC",
"type": "string",
"minLength": 1,
"maxLength": 128
},
"publishNow": {
"default": false,
"type": "boolean"
},
"destinationOverrides": {
"default": {},
"type": "object",
"propertyNames": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"additionalProperties": {
"type": "object",
"properties": {
"caption": {
"type": "string",
"maxLength": 5000
},
"scheduledAt": {
"type": "string",
"maxLength": 64
}
}
}
},
"expiresAt": {
"default": "",
"type": "string",
"maxLength": 64
}
},
"required": [
"schemaVersion",
"accountIds",
"caption",
"hashtags",
"assetIds",
"threadsTextOnly",
"instagramMode",
"youtubeTitle",
"youtubePrivacy",
"youtubeSynthetic",
"youtubeCategoryId",
"youtubeShort",
"linkUrl",
"scheduledAt",
"displayTimezone",
"publishNow",
"destinationOverrides",
"expiresAt"
]
},
"created_by": {
"anyOf": [
{
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
{
"type": "null"
}
]
},
"updated_by": {
"anyOf": [
{
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
{
"type": "null"
}
]
},
"created_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
},
"updated_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
},
"submission": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"expected_revision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"started_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
},
"receipt": {
"anyOf": [
{
"type": "object",
"properties": {
"batch_id": {
"anyOf": [
{
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
{
"type": "null"
}
]
},
"successes": {
"maxItems": 50,
"type": "array",
"items": {
"type": "object",
"properties": {
"social_account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"post_id": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
}
},
"required": [
"social_account_id",
"post_id"
]
}
},
"failures": {
"maxItems": 50,
"type": "array",
"items": {
"type": "object",
"properties": {
"social_account_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"code": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"message": {
"type": "string",
"maxLength": 2000
}
},
"required": [
"social_account_id",
"code",
"message"
]
}
}
},
"required": [
"batch_id",
"successes",
"failures"
]
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"expected_revision",
"started_at",
"receipt"
]
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"workspace_id",
"revision",
"state",
"content",
"created_by",
"updated_by",
"created_at",
"updated_at",
"submission"
]
},
"replayed": {
"type": "boolean"
}
},
"required": [
"draft",
"replayed"
]
}错误与安全重试
检查 HTTP 状态和响应正文。400 验证错误可能包含 ZodError;处理程序错误使用 error、message 和 code 字段。保留 request_id 或 x-request-id 以便诊断,但不要保留凭证。先解决 401/403 访问错误再重试,并在收到 429 时遵循 Retry-After。如写入结果不确定或返回 5xx,先读取现有结果。仅在支持时复用幂等键;重试行为因操作而异,并不保证恰好交付一次。
故障排查指南示例
这些示例使用已依schema检查的虚构值。请将 ID 替换为你有权使用的 ID、将媒体替换为已就绪素材,并将日期替换为已确认的发布时间。提交写入前,请检查账号资格。本页不会发送 API 请求。
在服务器上将 SOSOAPI_ACCESS_TOKEN 设为此操作接受的凭证,且不要放入浏览器代码。agent 请使用 sosoapi auth login 通过浏览器登录,并由 CLI 更新凭证。
request.json
{
"workspace_id": "11111111-1111-4111-8111-111111111111",
"id": "44444444-4444-4444-8444-444444444444",
"mutation_id": "55555555-5555-4555-8555-555555555555",
"content": {
"schemaVersion": 1,
"accountIds": [],
"caption": "An unfinished announcement for team review.",
"hashtags": "",
"assetIds": [],
"threadsTextOnly": false,
"instagramMode": "REELS",
"youtubeTitle": "",
"youtubePrivacy": "private",
"youtubeSynthetic": false,
"youtubeCategoryId": "",
"youtubeShort": false,
"linkUrl": "",
"scheduledAt": "",
"displayTimezone": "UTC",
"publishNow": false,
"destinationOverrides": {},
"expiresAt": ""
}
}cURL
curl --request POST \
"https://gqeshlawtcexsapabaui.supabase.co/functions/v1/studio-api/content-drafts/create" \
-H "Authorization: Bearer $SOSOAPI_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @request.jsonJavaScript
// Server-side JavaScript. Do not print tokens or credential-bearing responses.
const token = process.env.SOSOAPI_ACCESS_TOKEN;
if (!token) throw new Error("Set an accepted credential for this operation");
const response = await fetch("https://gqeshlawtcexsapabaui.supabase.co/functions/v1/studio-api/content-drafts/create", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer " + token },
body: JSON.stringify({
"workspace_id": "11111111-1111-4111-8111-111111111111",
"id": "44444444-4444-4444-8444-444444444444",
"mutation_id": "55555555-5555-4555-8555-555555555555",
"content": {
"schemaVersion": 1,
"accountIds": [],
"caption": "An unfinished announcement for team review.",
"hashtags": "",
"assetIds": [],
"threadsTextOnly": false,
"instagramMode": "REELS",
"youtubeTitle": "",
"youtubePrivacy": "private",
"youtubeSynthetic": false,
"youtubeCategoryId": "",
"youtubeShort": false,
"linkUrl": "",
"scheduledAt": "",
"displayTimezone": "UTC",
"publishNow": false,
"destinationOverrides": {},
"expiresAt": ""
}
})
});
const result = await response.json();
// Check response.ok, the operation-specific body and completion state before continuing.CLI
npx sosoapi api post /studio-api/content-drafts/create < request.json合成响应示例
{
"draft": {
"id": "44444444-4444-4444-8444-444444444444",
"workspace_id": "11111111-1111-4111-8111-111111111111",
"revision": 1,
"state": "draft",
"content": {
"schemaVersion": 1,
"accountIds": [],
"caption": "An unfinished announcement for team review.",
"hashtags": "",
"assetIds": [],
"threadsTextOnly": false,
"instagramMode": "REELS",
"youtubeTitle": "",
"youtubePrivacy": "private",
"youtubeSynthetic": false,
"youtubeCategoryId": "",
"youtubeShort": false,
"linkUrl": "",
"scheduledAt": "",
"displayTimezone": "UTC",
"publishNow": false,
"destinationOverrides": {},
"expiresAt": ""
},
"created_by": null,
"updated_by": null,
"created_at": "2099-01-15T08:00:00Z",
"updated_at": "2099-01-15T08:30:00Z",
"submission": null
},
"replayed": false
}