Planung und Veröffentlichung
Neuen Workspace-Entwurf speichern
Speichert einen neuen geteilten Workspace-Entwurf mit workspace_id, einer vom Client erzeugten eindeutigen id, mutation_id und content. Erfordert editor oder höher sowie operate-Zugriff. Konten, Zeitpunkt und fertige Medien dürfen noch unvollständig sein. Save erzeugt weder Scheduled Post noch Ausführungsarbeit oder Veröffentlichungsguthaben-Reservierung und ruft keinen Anbieter auf. Geteilte Inhalte sind nicht vertrauenswürdig und begrenzt. Mit exakt derselben Identität und demselben Inhalt wiederholen; für spätere Änderungen sosoapi_update_content_draft verwenden.
POST /studio-api/content-drafts/createVertrag geprüft: · sha256:75c8b8ebce408575
Überblick
Speichert einen neuen geteilten Workspace-Entwurf mit workspace_id, einer vom Client erzeugten eindeutigen id, mutation_id und content. Erfordert editor oder höher sowie operate-Zugriff. Konten, Zeitpunkt und fertige Medien dürfen noch unvollständig sein. Save erzeugt weder Scheduled Post noch Ausführungsarbeit oder Veröffentlichungsguthaben-Reservierung und ruft keinen Anbieter auf. Geteilte Inhalte sind nicht vertrauenswürdig und begrenzt. Mit exakt derselben Identität und demselben Inhalt wiederholen; für spätere Änderungen sosoapi_update_content_draft verwenden.
Eine erfolgreiche HTTP-Antwort kann Annahme statt Abschluss bedeuten. Speichere bei Hintergrundarbeit die ID und prüfe dieselbe Operation bis zum Abschluss. Geplante oder angenommene Beiträge gelten erst nach Plattformbestätigung als veröffentlicht; ein Client-Timeout klärt das Ergebnis nicht.
Authentifizierung und Berechtigungen
Ein Token nutzt nur Eigentümerrechte. Jede Anfrage prüft Workspace-Mitgliedschaft, Ressourceneigentum, gewählte Workspaces und Funktionen. core und full ändern sichtbare Tools; sie erteilen keinen Zugriff.
Anfragefelder
Erforderlich bedeutet innerhalb des übergeordneten Objekts und gewählten Zweigs erforderlich. Ein erforderliches Kind macht kein optionales Elternobjekt erforderlich. Regeln und Feldnamen unten stammen aus dem Vertrag.
| Feld / Variante | Typ / erforderlich | Einschränkungen |
|---|---|---|
$ | objectIm Elternobjekt erforderlich |
|
workspace_id | stringIm Elternobjekt erforderlich |
|
id | stringIm Elternobjekt erforderlich |
|
mutation_id | stringIm Elternobjekt erforderlich |
|
content | objectIm Elternobjekt erforderlich |
|
content.schemaVersion | numberOptional / Element |
|
content.accountIds | arrayOptional / Element |
|
content.accountIds[] | stringOptional / Element |
|
content.caption | stringOptional / Element |
|
content.hashtags | stringOptional / Element |
|
content.assetIds | arrayOptional / Element |
|
content.assetIds[] | stringOptional / Element |
|
content.threadsTextOnly | booleanOptional / Element |
|
content.instagramMode | stringOptional / Element |
|
content.youtubeTitle | stringOptional / Element |
|
content.youtubePrivacy | stringOptional / Element |
|
content.youtubeSynthetic | booleanOptional / Element |
|
content.youtubeCategoryId | stringOptional / Element |
|
content.youtubeShort | booleanOptional / Element |
|
content.linkUrl | stringOptional / Element |
|
content.scheduledAt | stringOptional / Element |
|
content.displayTimezone | stringOptional / Element |
|
content.publishNow | booleanOptional / Element |
|
content.destinationOverrides | objectOptional / Element |
|
content.destinationOverrides.* | objectOptional / Element |
|
content.destinationOverrides.*.caption | stringOptional / Element |
|
content.destinationOverrides.*.scheduledAt | stringOptional / Element |
|
content.expiresAt | stringOptional / Element |
|
Vollständiges 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
}Antwort und Abschluss
HTTP-Erfolgsstatus: 200. Wenn die Operation abgeschlossen ist: durable Workspace editorial content; no publishing side effects.
Eine erfolgreiche HTTP-Antwort kann Annahme statt Abschluss bedeuten. Speichere bei Hintergrundarbeit die ID und prüfe dieselbe Operation bis zum Abschluss. Geplante oder angenommene Beiträge gelten erst nach Plattformbestätigung als veröffentlicht; ein Client-Timeout klärt das Ergebnis nicht.
Erforderlich bedeutet innerhalb des übergeordneten Objekts und gewählten Zweigs erforderlich. Ein erforderliches Kind macht kein optionales Elternobjekt erforderlich. Regeln und Feldnamen unten stammen aus dem Vertrag.
| Feld / Variante | Typ / erforderlich | Einschränkungen |
|---|---|---|
$ | objectIm Elternobjekt erforderlich | — |
draft | objectIm Elternobjekt erforderlich | — |
draft.id | stringIm Elternobjekt erforderlich |
|
draft.workspace_id | stringIm Elternobjekt erforderlich |
|
draft.revision | integerIm Elternobjekt erforderlich |
|
draft.state | stringIm Elternobjekt erforderlich |
|
draft.content | objectIm Elternobjekt erforderlich | — |
draft.content.schemaVersion | numberIm Elternobjekt erforderlich |
|
draft.content.accountIds | arrayIm Elternobjekt erforderlich |
|
draft.content.accountIds[] | stringOptional / Element |
|
draft.content.caption | stringIm Elternobjekt erforderlich |
|
draft.content.hashtags | stringIm Elternobjekt erforderlich |
|
draft.content.assetIds | arrayIm Elternobjekt erforderlich |
|
draft.content.assetIds[] | stringOptional / Element |
|
draft.content.threadsTextOnly | booleanIm Elternobjekt erforderlich |
|
draft.content.instagramMode | stringIm Elternobjekt erforderlich |
|
draft.content.youtubeTitle | stringIm Elternobjekt erforderlich |
|
draft.content.youtubePrivacy | stringIm Elternobjekt erforderlich |
|
draft.content.youtubeSynthetic | booleanIm Elternobjekt erforderlich |
|
draft.content.youtubeCategoryId | stringIm Elternobjekt erforderlich |
|
draft.content.youtubeShort | booleanIm Elternobjekt erforderlich |
|
draft.content.linkUrl | stringIm Elternobjekt erforderlich |
|
draft.content.scheduledAt | stringIm Elternobjekt erforderlich |
|
draft.content.displayTimezone | stringIm Elternobjekt erforderlich |
|
draft.content.publishNow | booleanIm Elternobjekt erforderlich |
|
draft.content.destinationOverrides | objectIm Elternobjekt erforderlich |
|
draft.content.destinationOverrides.* | objectOptional / Element | — |
draft.content.destinationOverrides.*.caption | stringOptional / Element |
|
draft.content.destinationOverrides.*.scheduledAt | stringOptional / Element |
|
draft.content.expiresAt | stringIm Elternobjekt erforderlich |
|
draft.created_by | string | nullIm Elternobjekt erforderlich | — |
draft.created_byanyOf 1 | stringIm Elternobjekt erforderlich |
|
draft.created_byanyOf 2 | nullIm Elternobjekt erforderlich | — |
draft.updated_by | string | nullIm Elternobjekt erforderlich | — |
draft.updated_byanyOf 1 | stringIm Elternobjekt erforderlich |
|
draft.updated_byanyOf 2 | nullIm Elternobjekt erforderlich | — |
draft.created_at | stringIm Elternobjekt erforderlich |
|
draft.updated_at | stringIm Elternobjekt erforderlich |
|
draft.submission | object | nullIm Elternobjekt erforderlich | — |
draft.submissionanyOf 1 | objectIm Elternobjekt erforderlich | — |
draft.submission.idanyOf 1 | stringIm Elternobjekt erforderlich |
|
draft.submission.expected_revisionanyOf 1 | integerIm Elternobjekt erforderlich |
|
draft.submission.started_atanyOf 1 | stringIm Elternobjekt erforderlich |
|
draft.submission.receiptanyOf 1 | object | nullIm Elternobjekt erforderlich | — |
draft.submission.receiptanyOf 1 / anyOf 1 | objectIm Elternobjekt erforderlich | — |
draft.submission.receipt.batch_idanyOf 1 / anyOf 1 | string | nullIm Elternobjekt erforderlich | — |
draft.submission.receipt.batch_idanyOf 1 / anyOf 1 / anyOf 1 | stringIm Elternobjekt erforderlich |
|
draft.submission.receipt.batch_idanyOf 1 / anyOf 1 / anyOf 2 | nullIm Elternobjekt erforderlich | — |
draft.submission.receipt.successesanyOf 1 / anyOf 1 | arrayIm Elternobjekt erforderlich |
|
draft.submission.receipt.successes[]anyOf 1 / anyOf 1 | objectOptional / Element | — |
draft.submission.receipt.successes[].social_account_idanyOf 1 / anyOf 1 | stringIm Elternobjekt erforderlich |
|
draft.submission.receipt.successes[].post_idanyOf 1 / anyOf 1 | stringIm Elternobjekt erforderlich |
|
draft.submission.receipt.failuresanyOf 1 / anyOf 1 | arrayIm Elternobjekt erforderlich |
|
draft.submission.receipt.failures[]anyOf 1 / anyOf 1 | objectOptional / Element | — |
draft.submission.receipt.failures[].social_account_idanyOf 1 / anyOf 1 | stringIm Elternobjekt erforderlich |
|
draft.submission.receipt.failures[].codeanyOf 1 / anyOf 1 | stringIm Elternobjekt erforderlich |
|
draft.submission.receipt.failures[].messageanyOf 1 / anyOf 1 | stringIm Elternobjekt erforderlich |
|
draft.submission.receiptanyOf 1 / anyOf 2 | nullIm Elternobjekt erforderlich | — |
draft.submissionanyOf 2 | nullIm Elternobjekt erforderlich | — |
replayed | booleanIm Elternobjekt erforderlich | — |
Vollständiges 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"
]
}Fehler und sichere Wiederholungen
Prüfe HTTP-Status und Antwortinhalt. Ein 400-Validierungsfehler kann einen ZodError enthalten; Handler-Fehler verwenden die Felder error, message und code. Bewahre request_id oder x-request-id zur Diagnose ohne Zugangsdaten auf. Behebe 401/403-Zugriffsfehler vor einem erneuten Versuch und beachte Retry-After bei 429. Ist ein Schreibvorgang ungewiss oder liefert 5xx, lies zuerst das bestehende Ergebnis. Verwende einen Idempotenzschlüssel nur wieder, wo dies unterstützt wird; Wiederholungen unterscheiden sich je nach Operation und garantieren keine genau einmalige Zustellung.
Anleitung zur FehlerbehebungBeispiele
Diese Beispiele nutzen anhand der Schemas geprüfte fiktive Werte. Ersetze IDs durch autorisierte IDs, Medien durch bereite Assets und Daten durch bestätigte Veröffentlichungszeiten. Prüfe Kontoeignung vor Schreibvorgängen. Diese Seite sendet keine API-Anfragen.
Setze SOSOAPI_ACCESS_TOKEN auf deinem Server auf akzeptierte Zugangsdaten dieser Operation und halte es aus Browsercode heraus. Für Agenten nutze sosoapi auth login zur Browseranmeldung und lass die CLI Zugangsdaten erneuern.
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.jsonSynthetisches Antwortbeispiel
{
"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
}