La búsqueda solo se carga cuando la usas. Explora todas las categorías a continuación.

Programación y publicación

Guardar un nuevo borrador del espacio de trabajo

Guarda un nuevo borrador compartido con workspace_id, un id único generado por el cliente, mutation_id y content. Requiere editor o superior y acceso operate. Las cuentas, la hora y los medios listos pueden estar incompletos. Save no crea Scheduled Post, trabajo de ejecución ni reservas de créditos de publicación y no llama al proveedor. El contenido compartido no es confiable y tiene límites. Reintenta con exactamente la misma identidad y contenido; usa sosoapi_update_content_draft para ediciones posteriores.

POST /studio-api/content-drafts/create

Contrato revisado: · sha256:75c8b8ebce408575

Descripción general

Guarda un nuevo borrador compartido con workspace_id, un id único generado por el cliente, mutation_id y content. Requiere editor o superior y acceso operate. Las cuentas, la hora y los medios listos pueden estar incompletos. Save no crea Scheduled Post, trabajo de ejecución ni reservas de créditos de publicación y no llama al proveedor. El contenido compartido no es confiable y tiene límites. Reintenta con exactamente la misma identidad y contenido; usa sosoapi_update_content_draft para ediciones posteriores.

Una respuesta HTTP exitosa puede indicar aceptación, no finalización. Para trabajo en segundo plano, guarda el ID devuelto y consulta la misma operación hasta que termine. Una publicación programada o aceptada solo está publicada cuando la plataforma lo confirma; un tiempo de espera agotado en el cliente no determina el resultado.

Autenticación y permisos

Clases de credenciales aceptadas
user_session, delegated_oauth, personal_access_token
Capacidad delegada
agent:operate
Rol mínimo del espacio de trabajo
editor
Alcance del acceso
Recursos a los que este usuario está autorizado a acceder
Se requiere consentimiento para todos los espacios de trabajo
No
Cambia el estado
Sí
Cuando la operación se completa
durable Workspace editorial content; no publishing side effects

Un token solo puede usar los derechos de su propietario. Cada solicitud comprueba pertenencia al espacio, propiedad del recurso, espacios elegidos y capacidades concedidas. Los perfiles core y full cambian qué herramientas se muestran; no conceden acceso.

Campos de solicitud

Obligatorio significa obligatorio dentro del objeto principal y la rama elegida. Un campo secundario obligatorio no convierte en obligatorio un objeto principal opcional. Las reglas y nombres de campos siguientes se copian del contrato.

Campos de solicitud
Campo / ramaTipo / obligatorioRestricciones
$objectObligatorio en el objeto principal
  • additionalProperties: false
workspace_idstringObligatorio en el objeto principal
  • 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)$"
idstringObligatorio en el objeto principal
  • 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_idstringObligatorio en el objeto principal
  • 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)$"
contentobjectObligatorio en el objeto principal
  • additionalProperties: false
content.schemaVersionnumberOpcional / elemento
  • const: 1
  • default: 1
content.accountIdsarrayOpcional / elemento
  • maxItems: 50
  • default: []
content.accountIds[]stringOpcional / elemento
  • 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.captionstringOpcional / elemento
  • maxLength: 5000
  • default: ""
content.hashtagsstringOpcional / elemento
  • maxLength: 5000
  • default: ""
content.assetIdsarrayOpcional / elemento
  • maxItems: 20
  • default: []
content.assetIds[]stringOpcional / elemento
  • maxLength: 16
  • pattern: "^[1-9][0-9]*$"
content.threadsTextOnlybooleanOpcional / elemento
  • default: false
content.instagramModestringOpcional / elemento
  • enum: ["IMAGE","REELS","CAROUSEL","STORY_IMAGE","STORY_VIDEO"]
  • default: "REELS"
content.youtubeTitlestringOpcional / elemento
  • maxLength: 100
  • default: ""
content.youtubePrivacystringOpcional / elemento
  • enum: ["private","unlisted","public"]
  • default: "private"
content.youtubeSyntheticbooleanOpcional / elemento
  • default: false
content.youtubeCategoryIdstringOpcional / elemento
  • maxLength: 32
  • default: ""
content.youtubeShortbooleanOpcional / elemento
  • default: false
content.linkUrlstringOpcional / elemento
  • maxLength: 2048
  • default: ""
content.scheduledAtstringOpcional / elemento
  • maxLength: 64
  • default: ""
content.displayTimezonestringOpcional / elemento
  • minLength: 1
  • maxLength: 128
  • default: "UTC"
content.publishNowbooleanOpcional / elemento
  • default: false
content.destinationOverridesobjectOpcional / elemento
  • default: {}
  • additionalProperties: {"type":"object","properties":{"caption":{"type":"string","maxLength":5000},"scheduledAt":{"type":"string","maxLength":64}},"additionalProperties":false}
content.destinationOverrides.*objectOpcional / elemento
  • additionalProperties: false
content.destinationOverrides.*.captionstringOpcional / elemento
  • maxLength: 5000
content.destinationOverrides.*.scheduledAtstringOpcional / elemento
  • maxLength: 64
content.expiresAtstringOpcional / elemento
  • maxLength: 64
  • default: ""
JSON Schema completo
{
  "$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
}

Respuesta y finalización

Estados HTTP de éxito: 200. Cuando la operación se completa: durable Workspace editorial content; no publishing side effects.

Una respuesta HTTP exitosa puede indicar aceptación, no finalización. Para trabajo en segundo plano, guarda el ID devuelto y consulta la misma operación hasta que termine. Una publicación programada o aceptada solo está publicada cuando la plataforma lo confirma; un tiempo de espera agotado en el cliente no determina el resultado.

Obligatorio significa obligatorio dentro del objeto principal y la rama elegida. Un campo secundario obligatorio no convierte en obligatorio un objeto principal opcional. Las reglas y nombres de campos siguientes se copian del contrato.

Respuesta y finalización
Campo / ramaTipo / obligatorioRestricciones
$objectObligatorio en el objeto principal—
draftobjectObligatorio en el objeto principal—
draft.idstringObligatorio en el objeto principal
  • 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)$"
draft.workspace_idstringObligatorio en el objeto principal
  • 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)$"
draft.revisionintegerObligatorio en el objeto principal
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
draft.statestringObligatorio en el objeto principal
  • enum: ["draft","submitting","submitted"]
draft.contentobjectObligatorio en el objeto principal—
draft.content.schemaVersionnumberObligatorio en el objeto principal
  • const: 1
  • default: 1
draft.content.accountIdsarrayObligatorio en el objeto principal
  • maxItems: 50
  • default: []
draft.content.accountIds[]stringOpcional / elemento
  • 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)$"
draft.content.captionstringObligatorio en el objeto principal
  • maxLength: 5000
  • default: ""
draft.content.hashtagsstringObligatorio en el objeto principal
  • maxLength: 5000
  • default: ""
draft.content.assetIdsarrayObligatorio en el objeto principal
  • maxItems: 20
  • default: []
draft.content.assetIds[]stringOpcional / elemento
  • maxLength: 16
  • pattern: "^[1-9][0-9]*$"
draft.content.threadsTextOnlybooleanObligatorio en el objeto principal
  • default: false
draft.content.instagramModestringObligatorio en el objeto principal
  • enum: ["IMAGE","REELS","CAROUSEL","STORY_IMAGE","STORY_VIDEO"]
  • default: "REELS"
draft.content.youtubeTitlestringObligatorio en el objeto principal
  • maxLength: 100
  • default: ""
draft.content.youtubePrivacystringObligatorio en el objeto principal
  • enum: ["private","unlisted","public"]
  • default: "private"
draft.content.youtubeSyntheticbooleanObligatorio en el objeto principal
  • default: false
draft.content.youtubeCategoryIdstringObligatorio en el objeto principal
  • maxLength: 32
  • default: ""
draft.content.youtubeShortbooleanObligatorio en el objeto principal
  • default: false
draft.content.linkUrlstringObligatorio en el objeto principal
  • maxLength: 2048
  • default: ""
draft.content.scheduledAtstringObligatorio en el objeto principal
  • maxLength: 64
  • default: ""
draft.content.displayTimezonestringObligatorio en el objeto principal
  • minLength: 1
  • maxLength: 128
  • default: "UTC"
draft.content.publishNowbooleanObligatorio en el objeto principal
  • default: false
draft.content.destinationOverridesobjectObligatorio en el objeto principal
  • default: {}
  • additionalProperties: {"type":"object","properties":{"caption":{"type":"string","maxLength":5000},"scheduledAt":{"type":"string","maxLength":64}}}
draft.content.destinationOverrides.*objectOpcional / elemento—
draft.content.destinationOverrides.*.captionstringOpcional / elemento
  • maxLength: 5000
draft.content.destinationOverrides.*.scheduledAtstringOpcional / elemento
  • maxLength: 64
draft.content.expiresAtstringObligatorio en el objeto principal
  • maxLength: 64
  • default: ""
draft.created_bystring | nullObligatorio en el objeto principal—
draft.created_byanyOf 1stringObligatorio en el objeto principal
  • 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)$"
draft.created_byanyOf 2nullObligatorio en el objeto principal—
draft.updated_bystring | nullObligatorio en el objeto principal—
draft.updated_byanyOf 1stringObligatorio en el objeto principal
  • 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)$"
draft.updated_byanyOf 2nullObligatorio en el objeto principal—
draft.created_atstringObligatorio en el objeto principal
  • 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)))$"
draft.updated_atstringObligatorio en el objeto principal
  • 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)))$"
draft.submissionobject | nullObligatorio en el objeto principal—
draft.submissionanyOf 1objectObligatorio en el objeto principal—
draft.submission.idanyOf 1stringObligatorio en el objeto principal
  • 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)$"
draft.submission.expected_revisionanyOf 1integerObligatorio en el objeto principal
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
draft.submission.started_atanyOf 1stringObligatorio en el objeto principal
  • 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)))$"
draft.submission.receiptanyOf 1object | nullObligatorio en el objeto principal—
draft.submission.receiptanyOf 1 / anyOf 1objectObligatorio en el objeto principal—
draft.submission.receipt.batch_idanyOf 1 / anyOf 1string | nullObligatorio en el objeto principal—
draft.submission.receipt.batch_idanyOf 1 / anyOf 1 / anyOf 1stringObligatorio en el objeto principal
  • 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)$"
draft.submission.receipt.batch_idanyOf 1 / anyOf 1 / anyOf 2nullObligatorio en el objeto principal—
draft.submission.receipt.successesanyOf 1 / anyOf 1arrayObligatorio en el objeto principal
  • maxItems: 50
draft.submission.receipt.successes[]anyOf 1 / anyOf 1objectOpcional / elemento—
draft.submission.receipt.successes[].social_account_idanyOf 1 / anyOf 1stringObligatorio en el objeto principal
  • 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)$"
draft.submission.receipt.successes[].post_idanyOf 1 / anyOf 1stringObligatorio en el objeto principal
  • 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}$"
draft.submission.receipt.failuresanyOf 1 / anyOf 1arrayObligatorio en el objeto principal
  • maxItems: 50
draft.submission.receipt.failures[]anyOf 1 / anyOf 1objectOpcional / elemento—
draft.submission.receipt.failures[].social_account_idanyOf 1 / anyOf 1stringObligatorio en el objeto principal
  • 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)$"
draft.submission.receipt.failures[].codeanyOf 1 / anyOf 1stringObligatorio en el objeto principal
  • minLength: 1
  • maxLength: 160
draft.submission.receipt.failures[].messageanyOf 1 / anyOf 1stringObligatorio en el objeto principal
  • maxLength: 2000
draft.submission.receiptanyOf 1 / anyOf 2nullObligatorio en el objeto principal—
draft.submissionanyOf 2nullObligatorio en el objeto principal—
replayedbooleanObligatorio en el objeto principal—
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"
  ]
}

Errores y reintentos seguros

Comprueba el estado HTTP y el cuerpo de respuesta. Un error de validación 400 puede contener un ZodError; los errores del controlador usan los campos error, message y code. Conserva request_id o x-request-id para el diagnóstico, sin credenciales. Corrige los errores de acceso 401/403 antes de reintentar y respeta Retry-After para 429. Si una escritura es incierta o devuelve 5xx, consulta primero el resultado existente. Reutiliza una clave de idempotencia solo donde se admita; el comportamiento de reintento varía por operación y no garantiza una entrega exactamente una vez.

Guía de solución de problemas

Ejemplos

Estos ejemplos usan valores ficticios comprobados con los esquemas. Sustituye los IDs por otros autorizados, los archivos multimedia por recursos listos y las fechas por tu hora de publicación confirmada. Comprueba la elegibilidad de la cuenta antes de enviar una escritura. Esta página no envía solicitudes API.

Establece SOSOAPI_ACCESS_TOKEN en tu servidor con una credencial aceptada por esta operación y mantenla fuera del código del navegador. Para un agente, usa sosoapi auth login para iniciar sesión en el navegador y deja a la CLI renovar sus credenciales.

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.json

JavaScript

// 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

Ejemplo de respuesta sintética

{
  "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
}

MCP: sosoapi_create_content_draft