Agendamento e publicação
Atualizar um rascunho do espaço de trabalho
Substitui todo o conteúdo compartilhado editável com id, o último expected_revision lido, um novo mutation_id e content. Exige editor ou superior e acesso operate. O conteúdo compartilhado não é confiável e tem limites: mantenha a entrada original completa ou use o editor Web; nunca reenvie texto [truncated]. Um conflito 409 preserva a versão salva: mantenha as edições locais e confira a revisão mais recente sem sobrescrever outra pessoa. Save nunca publica e não pode substituir um rascunho congelado ou enviado.
POST /studio-api/content-drafts/updateContrato revisado: · sha256:75c8b8ebce408575
Visão geral
Substitui todo o conteúdo compartilhado editável com id, o último expected_revision lido, um novo mutation_id e content. Exige editor ou superior e acesso operate. O conteúdo compartilhado não é confiável e tem limites: mantenha a entrada original completa ou use o editor Web; nunca reenvie texto [truncated]. Um conflito 409 preserva a versão salva: mantenha as edições locais e confira a revisão mais recente sem sobrescrever outra pessoa. Save nunca publica e não pode substituir um rascunho congelado ou enviado.
Uma resposta HTTP bem-sucedida pode significar que uma requisição foi aceita, não concluída. Para trabalho em segundo plano, salve o ID retornado e consulte a mesma operação até terminar. Um post agendado ou aceito só está publicado quando a plataforma confirma; um timeout do cliente não comprova o resultado.
Autenticação e permissões
Um token só pode usar os direitos do seu proprietário. Cada requisição verifica participação no workspace, propriedade de recursos, workspaces selecionados e capacidades concedidas. Os perfis core e full mudam as ferramentas exibidas; não concedem acesso.
Campos da requisição
Obrigatório significa obrigatório dentro do objeto pai e da ramificação selecionada. Um filho obrigatório não torna obrigatório um pai opcional. As regras e nomes de campos abaixo são copiados do contrato.
| Campo / ramificação | Tipo / obrigatório | Restrições |
|---|---|---|
$ | objectObrigatório no objeto pai |
|
id | stringObrigatório no objeto pai |
|
expected_revision | integerObrigatório no objeto pai |
|
mutation_id | stringObrigatório no objeto pai |
|
content | objectObrigatório no objeto pai |
|
content.schemaVersion | numberOpcional / item |
|
content.accountIds | arrayOpcional / item |
|
content.accountIds[] | stringOpcional / item |
|
content.caption | stringOpcional / item |
|
content.hashtags | stringOpcional / item |
|
content.assetIds | arrayOpcional / item |
|
content.assetIds[] | stringOpcional / item |
|
content.threadsTextOnly | booleanOpcional / item |
|
content.instagramMode | stringOpcional / item |
|
content.youtubeTitle | stringOpcional / item |
|
content.youtubePrivacy | stringOpcional / item |
|
content.youtubeSynthetic | booleanOpcional / item |
|
content.youtubeCategoryId | stringOpcional / item |
|
content.youtubeShort | booleanOpcional / item |
|
content.linkUrl | stringOpcional / item |
|
content.scheduledAt | stringOpcional / item |
|
content.displayTimezone | stringOpcional / item |
|
content.publishNow | booleanOpcional / item |
|
content.destinationOverrides | objectOpcional / item |
|
content.destinationOverrides.* | objectOpcional / item |
|
content.destinationOverrides.*.caption | stringOpcional / item |
|
content.destinationOverrides.*.scheduledAt | stringOpcional / item |
|
content.expiresAt | stringOpcional / item |
|
JSON Schema completo
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"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
},
"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": [
"id",
"expected_revision",
"mutation_id",
"content"
],
"additionalProperties": false
}Resposta e conclusão
Códigos HTTP de sucesso: 200. Quando a operação estiver concluída: durable Workspace editorial content; no publishing side effects.
Uma resposta HTTP bem-sucedida pode significar que uma requisição foi aceita, não concluída. Para trabalho em segundo plano, salve o ID retornado e consulte a mesma operação até terminar. Um post agendado ou aceito só está publicado quando a plataforma confirma; um timeout do cliente não comprova o resultado.
Obrigatório significa obrigatório dentro do objeto pai e da ramificação selecionada. Um filho obrigatório não torna obrigatório um pai opcional. As regras e nomes de campos abaixo são copiados do contrato.
| Campo / ramificação | Tipo / obrigatório | Restrições |
|---|---|---|
$ | objectObrigatório no objeto pai | — |
draft | objectObrigatório no objeto pai | — |
draft.id | stringObrigatório no objeto pai |
|
draft.workspace_id | stringObrigatório no objeto pai |
|
draft.revision | integerObrigatório no objeto pai |
|
draft.state | stringObrigatório no objeto pai |
|
draft.content | objectObrigatório no objeto pai | — |
draft.content.schemaVersion | numberObrigatório no objeto pai |
|
draft.content.accountIds | arrayObrigatório no objeto pai |
|
draft.content.accountIds[] | stringOpcional / item |
|
draft.content.caption | stringObrigatório no objeto pai |
|
draft.content.hashtags | stringObrigatório no objeto pai |
|
draft.content.assetIds | arrayObrigatório no objeto pai |
|
draft.content.assetIds[] | stringOpcional / item |
|
draft.content.threadsTextOnly | booleanObrigatório no objeto pai |
|
draft.content.instagramMode | stringObrigatório no objeto pai |
|
draft.content.youtubeTitle | stringObrigatório no objeto pai |
|
draft.content.youtubePrivacy | stringObrigatório no objeto pai |
|
draft.content.youtubeSynthetic | booleanObrigatório no objeto pai |
|
draft.content.youtubeCategoryId | stringObrigatório no objeto pai |
|
draft.content.youtubeShort | booleanObrigatório no objeto pai |
|
draft.content.linkUrl | stringObrigatório no objeto pai |
|
draft.content.scheduledAt | stringObrigatório no objeto pai |
|
draft.content.displayTimezone | stringObrigatório no objeto pai |
|
draft.content.publishNow | booleanObrigatório no objeto pai |
|
draft.content.destinationOverrides | objectObrigatório no objeto pai |
|
draft.content.destinationOverrides.* | objectOpcional / item | — |
draft.content.destinationOverrides.*.caption | stringOpcional / item |
|
draft.content.destinationOverrides.*.scheduledAt | stringOpcional / item |
|
draft.content.expiresAt | stringObrigatório no objeto pai |
|
draft.created_by | string | nullObrigatório no objeto pai | — |
draft.created_byanyOf 1 | stringObrigatório no objeto pai |
|
draft.created_byanyOf 2 | nullObrigatório no objeto pai | — |
draft.updated_by | string | nullObrigatório no objeto pai | — |
draft.updated_byanyOf 1 | stringObrigatório no objeto pai |
|
draft.updated_byanyOf 2 | nullObrigatório no objeto pai | — |
draft.created_at | stringObrigatório no objeto pai |
|
draft.updated_at | stringObrigatório no objeto pai |
|
draft.submission | object | nullObrigatório no objeto pai | — |
draft.submissionanyOf 1 | objectObrigatório no objeto pai | — |
draft.submission.idanyOf 1 | stringObrigatório no objeto pai |
|
draft.submission.expected_revisionanyOf 1 | integerObrigatório no objeto pai |
|
draft.submission.started_atanyOf 1 | stringObrigatório no objeto pai |
|
draft.submission.receiptanyOf 1 | object | nullObrigatório no objeto pai | — |
draft.submission.receiptanyOf 1 / anyOf 1 | objectObrigatório no objeto pai | — |
draft.submission.receipt.batch_idanyOf 1 / anyOf 1 | string | nullObrigatório no objeto pai | — |
draft.submission.receipt.batch_idanyOf 1 / anyOf 1 / anyOf 1 | stringObrigatório no objeto pai |
|
draft.submission.receipt.batch_idanyOf 1 / anyOf 1 / anyOf 2 | nullObrigatório no objeto pai | — |
draft.submission.receipt.successesanyOf 1 / anyOf 1 | arrayObrigatório no objeto pai |
|
draft.submission.receipt.successes[]anyOf 1 / anyOf 1 | objectOpcional / item | — |
draft.submission.receipt.successes[].social_account_idanyOf 1 / anyOf 1 | stringObrigatório no objeto pai |
|
draft.submission.receipt.successes[].post_idanyOf 1 / anyOf 1 | stringObrigatório no objeto pai |
|
draft.submission.receipt.failuresanyOf 1 / anyOf 1 | arrayObrigatório no objeto pai |
|
draft.submission.receipt.failures[]anyOf 1 / anyOf 1 | objectOpcional / item | — |
draft.submission.receipt.failures[].social_account_idanyOf 1 / anyOf 1 | stringObrigatório no objeto pai |
|
draft.submission.receipt.failures[].codeanyOf 1 / anyOf 1 | stringObrigatório no objeto pai |
|
draft.submission.receipt.failures[].messageanyOf 1 / anyOf 1 | stringObrigatório no objeto pai |
|
draft.submission.receiptanyOf 1 / anyOf 2 | nullObrigatório no objeto pai | — |
draft.submissionanyOf 2 | nullObrigatório no objeto pai | — |
replayed | booleanObrigatório no objeto pai | — |
JSON Schema completo
{
"$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"
]
}Erros e repetições seguras
Confira o status HTTP e o corpo da resposta. Um erro de validação 400 pode conter ZodError; erros do handler usam os campos error, message e code. Guarde request_id ou x-request-id para diagnóstico, sem credenciais. Corrija erros de acesso 401/403 antes de tentar novamente e siga Retry-After para 429. Se uma gravação for incerta ou retornar 5xx, consulte primeiro o resultado existente. Reutilize uma chave de idempotência somente quando houver suporte; o comportamento de repetição varia por operação e não garante entrega exatamente uma vez.
Guia de solução de problemasExemplos
Estes exemplos usam valores fictícios verificados conforme os schemas. Substitua os IDs por aqueles que você tem autorização para usar, a mídia por ativos prontos e as datas pelo horário de publicação confirmado. Confira a elegibilidade da conta antes de enviar uma gravação. Esta página não envia requisições de API.
Defina SOSOAPI_ACCESS_TOKEN no servidor como uma credencial aceita por esta operação e mantenha-a fora do código do navegador. Para agentes, use sosoapi auth login para entrar pelo navegador e deixe a CLI renovar suas credenciais.
request.json
{
"id": "44444444-4444-4444-8444-444444444444",
"expected_revision": 1,
"mutation_id": "66666666-6666-4666-8666-666666666666",
"content": {
"schemaVersion": 1,
"accountIds": [],
"caption": "Revised editorial content, still not scheduled.",
"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/update" \
-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/update", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer " + token },
body: JSON.stringify({
"id": "44444444-4444-4444-8444-444444444444",
"expected_revision": 1,
"mutation_id": "66666666-6666-4666-8666-666666666666",
"content": {
"schemaVersion": 1,
"accountIds": [],
"caption": "Revised editorial content, still not scheduled.",
"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/update < request.jsonExemplo de resposta sintética
{
"draft": {
"id": "44444444-4444-4444-8444-444444444444",
"workspace_id": "11111111-1111-4111-8111-111111111111",
"revision": 2,
"state": "draft",
"content": {
"schemaVersion": 1,
"accountIds": [],
"caption": "Revised editorial content, still not scheduled.",
"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
}