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

Programación y publicación

Cancelar hilo ordenado de X

Cancela solo la parte final no enviada de un hilo de X existente, usando sus últimas acciones permitidas y las expected_versions completas. Los Posts publicados permanecen en su lugar.

POST /studio-api/x-post-threads/cancel

Contrato revisado: · sha256:304f090f3c014931

Descripción general

Cancela solo la parte final no enviada de un hilo de X existente, usando sus últimas acciones permitidas y las expected_versions completas. Los Posts publicados permanecen en su lugar.

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:publish
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
canonical per-Post terminal publication outcomes; thread acceptance is not publication

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)$"
expected_versionsobjectObligatorio en el objeto principal
  • additionalProperties: {"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}
expected_versions.*integerOpcional / elemento
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
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)$"
    },
    "expected_versions": {
      "type": "object",
      "propertyNames": {
        "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}$"
      },
      "additionalProperties": {
        "type": "integer",
        "exclusiveMinimum": 0,
        "maximum": 9007199254740991
      }
    }
  },
  "required": [
    "workspace_id",
    "id",
    "expected_versions"
  ],
  "additionalProperties": false
}

Respuesta y finalización

Estados HTTP de éxito: 200. Cuando la operación se completa: canonical per-Post terminal publication outcomes; thread acceptance is not publication.

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—
threadobjectObligatorio en el objeto principal—
thread.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)$"
thread.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)$"
thread.social_account_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)$"
thread.idempotency_keystringObligatorio en el objeto principal
  • minLength: 1
  • maxLength: 128
thread.item_countintegerObligatorio en el objeto principal
  • minimum: 2
  • maximum: 25
thread.created_atstringObligatorio en el objeto principal—
thread.itemsarrayObligatorio en el objeto principal
  • minItems: 2
  • maxItems: 25
thread.items[]objectOpcional / elemento—
thread.items[].item_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)$"
thread.items[].ordinalintegerObligatorio en el objeto principal
  • minimum: 1
  • maximum: 25
thread.items[].predecessor_post_idstring | nullObligatorio en el objeto principal—
thread.items[].predecessor_post_idanyOf 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}$"
thread.items[].predecessor_post_idanyOf 2nullObligatorio en el objeto principal—
thread.items[].postobjectObligatorio en el objeto principal—
thread.items[].post.idstringObligatorio 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}$"
thread.items[].post.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)$"
thread.items[].post.social_account_idstring | nullObligatorio en el objeto principal—
thread.items[].post.social_account_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)$"
thread.items[].post.social_account_idanyOf 2nullObligatorio en el objeto principal—
thread.items[].post.platformstringObligatorio en el objeto principal
  • enum: ["instagram","threads","facebook","youtube","x"]
thread.items[].post.destinationobjectObligatorio en el objeto principal—
thread.items[].post.destination.social_account_idstring | nullObligatorio en el objeto principal—
thread.items[].post.destination.social_account_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)$"
thread.items[].post.destination.social_account_idanyOf 2nullObligatorio en el objeto principal—
thread.items[].post.destination.platformstringObligatorio en el objeto principal
  • enum: ["instagram","threads","facebook","youtube","x"]
thread.items[].post.destination.platform_user_idstring | nullObligatorio en el objeto principal—
thread.items[].post.destination.account_labelstring | nullObligatorio en el objeto principal—
thread.items[].post.captionstring | nullObligatorio en el objeto principal—
thread.items[].post.hashtagsarrayObligatorio en el objeto principal—
thread.items[].post.hashtags[]stringOpcional / elemento—
thread.items[].post.mediaarrayObligatorio en el objeto principal—
thread.items[].post.media[]objectOpcional / elemento—
thread.items[].post.media[].kindstringObligatorio en el objeto principal
  • enum: ["image","video"]
thread.items[].post.media[].urlstringObligatorio en el objeto principal
  • format: "uri"
thread.items[].post.media[].cover_urlstring | nullOpcional / elemento—
thread.items[].post.media[].cover_urlanyOf 1stringOpcional / elemento
  • format: "uri"
thread.items[].post.media[].cover_urlanyOf 2nullOpcional / elemento—
thread.items[].post.media[].cover_asset_idinteger | nullOpcional / elemento—
thread.items[].post.media[].cover_asset_idanyOf 1integerOpcional / elemento
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
thread.items[].post.media[].cover_asset_idanyOf 2nullOpcional / elemento—
thread.items[].post.media[].asset_idinteger | nullOpcional / elemento—
thread.items[].post.media[].asset_idanyOf 1integerOpcional / elemento
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
thread.items[].post.media[].asset_idanyOf 2nullOpcional / elemento—
thread.items[].post.media[].mime_typestring | nullOpcional / elemento—
thread.items[].post.media[].mime_typeanyOf 1stringOpcional / elemento
  • minLength: 1
  • maxLength: 160
thread.items[].post.media[].mime_typeanyOf 2nullOpcional / elemento—
thread.items[].post.media[].preview_urlstring | nullOpcional / elemento

URL temporal autorizada de lectura; conserva url como identidad multimedia persistente de la publicación programada.

—
thread.items[].post.media[].preview_urlanyOf 1stringOpcional / elemento
  • format: "uri"
thread.items[].post.media[].preview_urlanyOf 2nullOpcional / elemento—
thread.items[].post.media[].cover_preview_urlstring | nullOpcional / elemento

URL temporal autorizada de lectura de portada; conserva cover_url como identidad multimedia persistente.

—
thread.items[].post.media[].cover_preview_urlanyOf 1stringOpcional / elemento
  • format: "uri"
thread.items[].post.media[].cover_preview_urlanyOf 2nullOpcional / elemento—
thread.items[].post.media[].preview_expires_atstring | nullOpcional / elemento—
thread.items[].post.media[].preview_expires_atanyOf 1stringOpcional / elemento
  • 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))$"
thread.items[].post.media[].preview_expires_atanyOf 2nullOpcional / elemento—
thread.items[].post.link_urlstring | nullOpcional / elemento—
thread.items[].post.link_urlanyOf 1stringOpcional / elemento
  • format: "uri"
thread.items[].post.link_urlanyOf 2nullOpcional / elemento—
thread.items[].post.publish_optionsobjectObligatorio en el objeto principal—
thread.items[].post.publish_options.post_typestringOpcional / elemento
  • enum: ["TEXT","LINK","IMAGE","MULTI_IMAGE","VIDEO","CAROUSEL","REELS","STORY_IMAGE","STORY_VIDEO","REPOST","SHORT"]
thread.items[].post.publish_options.location_idstringOpcional / elemento
  • minLength: 1
thread.items[].post.publish_options.share_to_feedbooleanOpcional / elemento—
thread.items[].post.publish_options.collaboratorsarrayOpcional / elemento
  • maxItems: 3
thread.items[].post.publish_options.collaborators[]stringOpcional / elemento
  • minLength: 1
thread.items[].post.publish_options.first_commentstringOpcional / elemento
  • minLength: 1
  • maxLength: 2200
thread.items[].post.publish_options.topic_tagstringOpcional / elemento
  • minLength: 1
thread.items[].post.publish_options.thumb_offset_msintegerOpcional / elemento
  • minimum: 0
  • maximum: 9007199254740991
thread.items[].post.publish_options.titlestringOpcional / elemento
  • maxLength: 255
thread.items[].post.publish_options.youtube_privacy_statusstringOpcional / elemento
  • enum: ["private","unlisted","public"]
thread.items[].post.publish_options.youtube_category_idstringOpcional / elemento
  • pattern: "^\\d+$"
thread.items[].post.publish_options.youtube_contains_synthetic_mediabooleanOpcional / elemento—
thread.items[].post.publish_options.descriptionstringOpcional / elemento
  • maxLength: 5000
thread.items[].post.publish_options.category_idstringOpcional / elemento
  • pattern: "^\\d+$"
thread.items[].post.publish_options.privacy_statusstringOpcional / elemento
  • enum: ["private","unlisted","public"]
thread.items[].post.publish_options.cancellation_modestringOpcional / elemento
  • enum: ["DELETE","UNSCHEDULE_KEEP_PRIVATE"]
thread.items[].post.publish_options.tagsarrayOpcional / elemento—
thread.items[].post.publish_options.tags[]stringOpcional / elemento—
thread.items[].post.publish_options.default_languagestringOpcional / elemento—
thread.items[].post.publish_options.localizationsobjectOpcional / elemento
  • additionalProperties: {}
thread.items[].post.publish_options.localizations.*any JSON valueOpcional / elemento—
thread.items[].post.publish_options.licensestringOpcional / elemento
  • enum: ["youtube","creativeCommon"]
thread.items[].post.publish_options.embeddablebooleanOpcional / elemento—
thread.items[].post.publish_options.public_stats_viewablebooleanOpcional / elemento—
thread.items[].post.publish_options.self_declared_made_for_kidsbooleanOpcional / elemento—
thread.items[].post.publish_options.contains_synthetic_mediabooleanOpcional / elemento—
thread.items[].post.publish_options.has_paid_product_placementbooleanOpcional / elemento—
thread.items[].post.publish_options.recording_datestringOpcional / elemento—
thread.items[].post.publish_options.notify_subscribersbooleanOpcional / elemento—
thread.items[].post.publish_options.thumbnail_asset_idintegerOpcional / elemento
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
thread.items[].post.publish_options.surface_expectationstringOpcional / elemento
  • const: "SHORT"
thread.items[].post.publish_options.brand_partnerobjectOpcional / elemento
  • additionalProperties: {}
thread.items[].post.publish_options.brand_partner.*any JSON valueOpcional / elemento—
thread.items[].post.publish_options.cover_asset_idintegerOpcional / elemento
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
thread.items[].post.publish_options.audio_namestringOpcional / elemento—
thread.items[].post.publish_options.trial_paramsobjectOpcional / elemento
  • additionalProperties: {}
thread.items[].post.publish_options.trial_params.*any JSON valueOpcional / elemento—
thread.items[].post.publish_options.is_ai_generatedbooleanOpcional / elemento—
thread.items[].post.publish_options.branded_content_sponsor_idsarrayOpcional / elemento—
thread.items[].post.publish_options.branded_content_sponsor_ids[]stringOpcional / elemento—
thread.items[].post.publish_options.is_paid_partnershipbooleanOpcional / elemento—
thread.items[].post.publish_options.media_optionsarrayOpcional / elemento—
thread.items[].post.publish_options.media_options[]objectOpcional / elemento
  • additionalProperties: {}
thread.items[].post.publish_options.media_options[].*any JSON valueOpcional / elemento—
thread.items[].post.publish_options.reply_to_idstringOpcional / elemento—
thread.items[].post.publish_options.quote_post_idstringOpcional / elemento—
thread.items[].post.publish_options.repost_target_idstringOpcional / elemento—
thread.items[].post.publish_options.reply_controlstringOpcional / elemento—
thread.items[].post.publish_options.enable_reply_approvalsbooleanOpcional / elemento—
thread.items[].post.publish_options.link_attachmentstringOpcional / elemento
  • format: "uri"
thread.items[].post.publish_options.poll_attachmentobjectOpcional / elemento
  • additionalProperties: {}
thread.items[].post.publish_options.poll_attachment.*any JSON valueOpcional / elemento—
thread.items[].post.publish_options.gif_attachmentobjectOpcional / elemento
  • additionalProperties: {}
thread.items[].post.publish_options.gif_attachment.*any JSON valueOpcional / elemento—
thread.items[].post.publish_options.text_attachmentobjectOpcional / elemento
  • additionalProperties: {}
thread.items[].post.publish_options.text_attachment.*any JSON valueOpcional / elemento—
thread.items[].post.publish_options.text_entitiesarrayOpcional / elemento—
thread.items[].post.publish_options.text_entities[]objectOpcional / elemento
  • additionalProperties: {}
thread.items[].post.publish_options.text_entities[].*any JSON valueOpcional / elemento—
thread.items[].post.publish_options.is_spoiler_mediabooleanOpcional / elemento—
thread.items[].post.publish_options.is_ghost_postbooleanOpcional / elemento—
thread.items[].post.publish_options.allowlisted_country_codesarrayOpcional / elemento—
thread.items[].post.publish_options.allowlisted_country_codes[]stringOpcional / elemento—
thread.items[].post.publish_options.crossreshare_to_igbooleanOpcional / elemento—
thread.items[].post.publish_options.crossreshare_to_ig_dark_modebooleanOpcional / elemento—
thread.items[].post.publish_options.auto_publish_textbooleanOpcional / elemento—
thread.items[].post.publish_options.publication_modestringOpcional / elemento
  • enum: ["PUBLISH","DRAFT"]
thread.items[].post.publish_options.backdated_timenumberOpcional / elemento—
thread.items[].post.publish_options.backdated_time_granularitystringOpcional / elemento
  • enum: ["year","month","day","hour","minute"]
thread.items[].post.publish_options.placestringOpcional / elemento—
thread.items[].post.publish_options.feed_targetingobjectOpcional / elemento
  • additionalProperties: {}
thread.items[].post.publish_options.feed_targeting.*any JSON valueOpcional / elemento—
thread.items[].post.publish_options.targetingobjectOpcional / elemento
  • additionalProperties: {}
thread.items[].post.publish_options.targeting.*any JSON valueOpcional / elemento—
thread.items[].post.publish_options.child_attachmentsarrayOpcional / elemento—
thread.items[].post.publish_options.child_attachments[]objectOpcional / elemento
  • additionalProperties: {}
thread.items[].post.publish_options.child_attachments[].*any JSON valueOpcional / elemento—
thread.items[].post.publish_options.multi_share_end_cardbooleanOpcional / elemento—
thread.items[].post.publish_options.multi_share_optimizedbooleanOpcional / elemento—
thread.items[].post.publish_options.unpublished_content_typestringOpcional / elemento—
thread.items[].post.publish_options.no_storybooleanOpcional / elemento—
thread.items[].post.publish_options.crossposted_video_idstringOpcional / elemento—
thread.items[].post.publish_options.sphericalbooleanOpcional / elemento—
thread.items[].post.scheduled_atstringObligatorio en el objeto principal—
thread.items[].post.display_timezonestringObligatorio en el objeto principal
  • minLength: 1
  • maxLength: 80
thread.items[].post.local_scheduled_atstring | nullOpcional / elemento—
thread.items[].post.local_scheduled_atanyOf 1stringOpcional / elemento
  • pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d{1,6})?)?$"
thread.items[].post.local_scheduled_atanyOf 2nullOpcional / elemento—
thread.items[].post.schedule_timezonestring | nullOpcional / elemento—
thread.items[].post.schedule_timezoneanyOf 1stringOpcional / elemento
  • minLength: 1
  • maxLength: 80
thread.items[].post.schedule_timezoneanyOf 2nullOpcional / elemento—
thread.items[].post.schedule_dst_disambiguationstring | nullOpcional / elemento—
thread.items[].post.schedule_dst_disambiguationanyOf 1stringOpcional / elemento
  • enum: ["exact","earlier","later"]
thread.items[].post.schedule_dst_disambiguationanyOf 2nullOpcional / elemento—
thread.items[].post.schedule_intent_statestringOpcional / elemento
  • enum: ["verified","legacy_unverified"]
thread.items[].post.expires_atstring | nullObligatorio en el objeto principal—
thread.items[].post.statusstringObligatorio en el objeto principal
  • enum: ["scheduled","publishing","published","failed","expired","needs_reschedule","cancelled","deleted"]
thread.items[].post.versionintegerObligatorio en el objeto principal
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
thread.items[].post.automatic_retry_enabledbooleanObligatorio en el objeto principal—
thread.items[].post.delete_requested_atstring | nullObligatorio en el objeto principal—
thread.items[].post.published_atstring | nullObligatorio en el objeto principal—
thread.items[].post.deleted_atstring | nullObligatorio en el objeto principal—
thread.items[].post.provider_post_idstring | nullObligatorio en el objeto principal—
thread.items[].post.permalinkstring | nullObligatorio en el objeto principal—
thread.items[].post.permalinkanyOf 1stringObligatorio en el objeto principal
  • format: "uri"
thread.items[].post.permalinkanyOf 2nullObligatorio en el objeto principal—
thread.items[].post.created_atstringObligatorio en el objeto principal—
thread.items[].post.updated_atstringObligatorio en el objeto principal—
thread.items[].post.project_idstring | nullObligatorio en el objeto principal—
thread.items[].post.project_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)$"
thread.items[].post.project_idanyOf 2nullObligatorio en el objeto principal—
thread.items[].post.batch_idstring | nullObligatorio en el objeto principal—
thread.items[].post.batch_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)$"
thread.items[].post.batch_idanyOf 2nullObligatorio en el objeto principal—
thread.items[].post.source_refobject | nullObligatorio en el objeto principal—
thread.items[].post.source_refanyOf 1objectObligatorio en el objeto principal
  • additionalProperties: {}
thread.items[].post.source_ref.*anyOf 1any JSON valueOpcional / elemento—
thread.items[].post.source_refanyOf 2nullObligatorio en el objeto principal—
thread.items[].retry_allowedbooleanObligatorio en el objeto principal—
thread.expected_versionsobjectObligatorio en el objeto principal
  • additionalProperties: {"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}
thread.expected_versions.*integerOpcional / elemento
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
thread.actionsarrayObligatorio en el objeto principal
  • minItems: 2
  • maxItems: 2
thread.actions[]objectOpcional / elemento—
thread.actions[].actionstringObligatorio en el objeto principal
  • enum: ["resume","cancel"]
thread.actions[].allowedbooleanObligatorio en el objeto principal—
thread.actions[].reason_codestringObligatorio en el objeto principal
  • enum: ["allowed","no_failed_items","resolution_required","retry_unavailable","terminal_state"]
thread.actions[].messagestringObligatorio en el objeto principal—
dedupedbooleanOpcional / elemento—
JSON Schema completo
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "thread": {
      "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)$"
        },
        "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)$"
        },
        "idempotency_key": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "item_count": {
          "type": "integer",
          "minimum": 2,
          "maximum": 25
        },
        "created_at": {
          "type": "string"
        },
        "items": {
          "minItems": 2,
          "maxItems": 25,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "item_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)$"
              },
              "ordinal": {
                "type": "integer",
                "minimum": 1,
                "maximum": 25
              },
              "predecessor_post_id": {
                "anyOf": [
                  {
                    "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}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "post": {
                "type": "object",
                "properties": {
                  "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}$"
                  },
                  "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)$"
                  },
                  "social_account_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"
                      }
                    ]
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "instagram",
                      "threads",
                      "facebook",
                      "youtube",
                      "x"
                    ]
                  },
                  "destination": {
                    "type": "object",
                    "properties": {
                      "social_account_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"
                          }
                        ]
                      },
                      "platform": {
                        "type": "string",
                        "enum": [
                          "instagram",
                          "threads",
                          "facebook",
                          "youtube",
                          "x"
                        ]
                      },
                      "platform_user_id": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "account_label": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "social_account_id",
                      "platform",
                      "platform_user_id",
                      "account_label"
                    ]
                  },
                  "caption": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "hashtags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "media": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "image",
                            "video"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "cover_url": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uri"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cover_asset_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "asset_id": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "mime_type": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 160
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "preview_url": {
                          "description": "Temporary authorized read URL; keep url as persisted Scheduled Post media identity.",
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uri"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cover_preview_url": {
                          "description": "Temporary authorized cover read URL; keep cover_url as persisted media identity.",
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uri"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "preview_expires_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "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))$",
                              "format": "date-time"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "kind",
                        "url"
                      ]
                    }
                  },
                  "link_url": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uri"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "publish_options": {
                    "type": "object",
                    "properties": {
                      "post_type": {
                        "type": "string",
                        "enum": [
                          "TEXT",
                          "LINK",
                          "IMAGE",
                          "MULTI_IMAGE",
                          "VIDEO",
                          "CAROUSEL",
                          "REELS",
                          "STORY_IMAGE",
                          "STORY_VIDEO",
                          "REPOST",
                          "SHORT"
                        ]
                      },
                      "location_id": {
                        "type": "string",
                        "minLength": 1
                      },
                      "share_to_feed": {
                        "type": "boolean"
                      },
                      "collaborators": {
                        "maxItems": 3,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "first_comment": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 2200
                      },
                      "topic_tag": {
                        "type": "string",
                        "minLength": 1
                      },
                      "thumb_offset_ms": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "title": {
                        "type": "string",
                        "maxLength": 255
                      },
                      "youtube_privacy_status": {
                        "type": "string",
                        "enum": [
                          "private",
                          "unlisted",
                          "public"
                        ]
                      },
                      "youtube_category_id": {
                        "type": "string",
                        "pattern": "^\\d+$"
                      },
                      "youtube_contains_synthetic_media": {
                        "type": "boolean"
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 5000
                      },
                      "category_id": {
                        "type": "string",
                        "pattern": "^\\d+$"
                      },
                      "privacy_status": {
                        "type": "string",
                        "enum": [
                          "private",
                          "unlisted",
                          "public"
                        ]
                      },
                      "cancellation_mode": {
                        "type": "string",
                        "enum": [
                          "DELETE",
                          "UNSCHEDULE_KEEP_PRIVATE"
                        ]
                      },
                      "tags": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "default_language": {
                        "type": "string"
                      },
                      "localizations": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      "license": {
                        "type": "string",
                        "enum": [
                          "youtube",
                          "creativeCommon"
                        ]
                      },
                      "embeddable": {
                        "type": "boolean"
                      },
                      "public_stats_viewable": {
                        "type": "boolean"
                      },
                      "self_declared_made_for_kids": {
                        "type": "boolean"
                      },
                      "contains_synthetic_media": {
                        "type": "boolean"
                      },
                      "has_paid_product_placement": {
                        "type": "boolean"
                      },
                      "recording_date": {
                        "type": "string"
                      },
                      "notify_subscribers": {
                        "type": "boolean"
                      },
                      "thumbnail_asset_id": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "surface_expectation": {
                        "type": "string",
                        "const": "SHORT"
                      },
                      "brand_partner": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      "cover_asset_id": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "audio_name": {
                        "type": "string"
                      },
                      "trial_params": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      "is_ai_generated": {
                        "type": "boolean"
                      },
                      "branded_content_sponsor_ids": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "is_paid_partnership": {
                        "type": "boolean"
                      },
                      "media_options": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        }
                      },
                      "reply_to_id": {
                        "type": "string"
                      },
                      "quote_post_id": {
                        "type": "string"
                      },
                      "repost_target_id": {
                        "type": "string"
                      },
                      "reply_control": {
                        "type": "string"
                      },
                      "enable_reply_approvals": {
                        "type": "boolean"
                      },
                      "link_attachment": {
                        "type": "string",
                        "format": "uri"
                      },
                      "poll_attachment": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      "gif_attachment": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      "text_attachment": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      "text_entities": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        }
                      },
                      "is_spoiler_media": {
                        "type": "boolean"
                      },
                      "is_ghost_post": {
                        "type": "boolean"
                      },
                      "allowlisted_country_codes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "crossreshare_to_ig": {
                        "type": "boolean"
                      },
                      "crossreshare_to_ig_dark_mode": {
                        "type": "boolean"
                      },
                      "auto_publish_text": {
                        "type": "boolean"
                      },
                      "publication_mode": {
                        "type": "string",
                        "enum": [
                          "PUBLISH",
                          "DRAFT"
                        ]
                      },
                      "backdated_time": {
                        "type": "number"
                      },
                      "backdated_time_granularity": {
                        "type": "string",
                        "enum": [
                          "year",
                          "month",
                          "day",
                          "hour",
                          "minute"
                        ]
                      },
                      "place": {
                        "type": "string"
                      },
                      "feed_targeting": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      "targeting": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      "child_attachments": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        }
                      },
                      "multi_share_end_card": {
                        "type": "boolean"
                      },
                      "multi_share_optimized": {
                        "type": "boolean"
                      },
                      "unpublished_content_type": {
                        "type": "string"
                      },
                      "no_story": {
                        "type": "boolean"
                      },
                      "crossposted_video_id": {
                        "type": "string"
                      },
                      "spherical": {
                        "type": "boolean"
                      }
                    }
                  },
                  "scheduled_at": {
                    "type": "string"
                  },
                  "display_timezone": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "local_scheduled_at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d{1,6})?)?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "schedule_timezone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "schedule_dst_disambiguation": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "exact",
                          "earlier",
                          "later"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "schedule_intent_state": {
                    "type": "string",
                    "enum": [
                      "verified",
                      "legacy_unverified"
                    ]
                  },
                  "expires_at": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "scheduled",
                      "publishing",
                      "published",
                      "failed",
                      "expired",
                      "needs_reschedule",
                      "cancelled",
                      "deleted"
                    ]
                  },
                  "version": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "automatic_retry_enabled": {
                    "type": "boolean"
                  },
                  "delete_requested_at": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "published_at": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "deleted_at": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "provider_post_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "permalink": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uri"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "updated_at": {
                    "type": "string"
                  },
                  "project_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"
                      }
                    ]
                  },
                  "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"
                      }
                    ]
                  },
                  "source_ref": {
                    "anyOf": [
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "workspace_id",
                  "social_account_id",
                  "platform",
                  "destination",
                  "caption",
                  "hashtags",
                  "media",
                  "publish_options",
                  "scheduled_at",
                  "display_timezone",
                  "expires_at",
                  "status",
                  "version",
                  "automatic_retry_enabled",
                  "delete_requested_at",
                  "published_at",
                  "deleted_at",
                  "provider_post_id",
                  "permalink",
                  "created_at",
                  "updated_at",
                  "project_id",
                  "batch_id",
                  "source_ref"
                ]
              },
              "retry_allowed": {
                "type": "boolean"
              }
            },
            "required": [
              "item_id",
              "ordinal",
              "predecessor_post_id",
              "post",
              "retry_allowed"
            ]
          }
        },
        "expected_versions": {
          "type": "object",
          "propertyNames": {
            "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}$"
          },
          "additionalProperties": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "actions": {
          "minItems": 2,
          "maxItems": 2,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "resume",
                  "cancel"
                ]
              },
              "allowed": {
                "type": "boolean"
              },
              "reason_code": {
                "type": "string",
                "enum": [
                  "allowed",
                  "no_failed_items",
                  "resolution_required",
                  "retry_unavailable",
                  "terminal_state"
                ]
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "action",
              "allowed",
              "reason_code",
              "message"
            ]
          }
        }
      },
      "required": [
        "id",
        "workspace_id",
        "social_account_id",
        "idempotency_key",
        "item_count",
        "created_at",
        "items",
        "expected_versions",
        "actions"
      ]
    },
    "deduped": {
      "type": "boolean"
    }
  },
  "required": [
    "thread"
  ]
}

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": "88888888-8888-4888-8888-888888888888",
  "expected_versions": {
    "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaa1": 2,
    "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaa2": 2
  }
}

cURL

curl --request POST \
  "https://gqeshlawtcexsapabaui.supabase.co/functions/v1/studio-api/x-post-threads/cancel" \
  -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/x-post-threads/cancel", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer " + token },
  body: JSON.stringify({
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "id": "88888888-8888-4888-8888-888888888888",
  "expected_versions": {
    "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaa1": 2,
    "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaa2": 2
  }
})
});
const result = await response.json();
// Check response.ok, the operation-specific body and completion state before continuing.

CLI

npx sosoapi api post /studio-api/x-post-threads/cancel < request.json

Ejemplo de respuesta sintética

{
  "thread": {
    "workspace_id": "11111111-1111-4111-8111-111111111111",
    "id": "88888888-8888-4888-8888-888888888888",
    "social_account_id": "22222222-2222-4222-8222-222222222222",
    "idempotency_key": "example-x-thread-0001",
    "item_count": 2,
    "created_at": "2099-01-15T08:00:00Z",
    "items": [
      {
        "item_id": "99999999-9999-4999-8999-999999999991",
        "ordinal": 1,
        "predecessor_post_id": null,
        "retry_allowed": false,
        "post": {
          "id": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaa1",
          "workspace_id": "11111111-1111-4111-8111-111111111111",
          "social_account_id": "22222222-2222-4222-8222-222222222222",
          "platform": "x",
          "destination": {
            "social_account_id": "22222222-2222-4222-8222-222222222222",
            "platform": "x",
            "platform_user_id": "fictional-x-account",
            "account_label": "Fictional X account"
          },
          "caption": "A fictional two-part announcement.",
          "hashtags": [],
          "media": [],
          "publish_options": {
            "post_type": "TEXT"
          },
          "scheduled_at": "2099-01-15T09:00:00Z",
          "display_timezone": "UTC",
          "expires_at": null,
          "status": "cancelled",
          "version": 3,
          "automatic_retry_enabled": false,
          "delete_requested_at": null,
          "published_at": null,
          "deleted_at": null,
          "provider_post_id": null,
          "permalink": null,
          "project_id": null,
          "batch_id": null,
          "source_ref": null,
          "created_at": "2099-01-15T08:00:00Z",
          "updated_at": "2099-01-15T08:30:00Z"
        }
      },
      {
        "item_id": "99999999-9999-4999-8999-999999999992",
        "ordinal": 2,
        "predecessor_post_id": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaa1",
        "retry_allowed": false,
        "post": {
          "id": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaa2",
          "workspace_id": "11111111-1111-4111-8111-111111111111",
          "social_account_id": "22222222-2222-4222-8222-222222222222",
          "platform": "x",
          "destination": {
            "social_account_id": "22222222-2222-4222-8222-222222222222",
            "platform": "x",
            "platform_user_id": "fictional-x-account",
            "account_label": "Fictional X account"
          },
          "caption": "The second part of this fictional announcement.",
          "hashtags": [],
          "media": [],
          "publish_options": {
            "post_type": "TEXT"
          },
          "scheduled_at": "2099-01-15T09:00:00Z",
          "display_timezone": "UTC",
          "expires_at": null,
          "status": "cancelled",
          "version": 3,
          "automatic_retry_enabled": false,
          "delete_requested_at": null,
          "published_at": null,
          "deleted_at": null,
          "provider_post_id": null,
          "permalink": null,
          "project_id": null,
          "batch_id": null,
          "source_ref": null,
          "created_at": "2099-01-15T08:00:00Z",
          "updated_at": "2099-01-15T08:30:00Z"
        }
      }
    ],
    "expected_versions": {
      "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaa1": 3,
      "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaa2": 3
    },
    "actions": [
      {
        "action": "resume",
        "allowed": false,
        "reason_code": "resolution_required",
        "message": "This example has no retryable failed items."
      },
      {
        "action": "cancel",
        "allowed": false,
        "reason_code": "terminal_state",
        "message": "This fictional thread is already cancelled."
      }
    ]
  }
}

MCP: sosoapi_cancel_x_post_thread