# 預覽 Threads 有序串文

Canonical URL: https://sosoapi.ai/zh-hant/docs/api/studio-api-threads-sequences-preview

Contract: sha256:11debf801a5e6096

核對已儲存串文的內容、排程及回覆能力，回傳阻礙或綁定版本的 preview_digest。未有 eligible 結果時，不可建立串文。

POST /studio-api/threads-sequences/preview

## 驗證及權限

- **接受的憑證類型:** user_session, delegated_oauth, personal_access_token

- **委派權限:** agent:operate

- **最低工作空間角色:** editor

- **存取範圍:** 已登入用戶及獲授權資源範圍

- **需要所有工作空間同意:** 否

- **會改動狀態:** 否

- **完成依據:** saved editorial Draft revisions or read-only sequence preview; no provider writes

憑證不能擴大持有人的權限。實際操作仍會檢查工作空間成員資格、資源擁有權、已選工作空間及能力授權。Tool profile 只會改變可見工具，不會授予權限。

## 請求欄位

```json
{
  "$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_version": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "workspace_id",
    "id",
    "expected_version"
  ],
  "additionalProperties": false
}
```

## 回應及完成條件

成功 HTTP 狀態碼: 200

HTTP 成功只表示本次操作的回應。背景工作須保留回傳 ID，並讀取同一操作，直至達到文件指定的終態。接受請求、排程成功或客戶端逾時，均不代表已發佈。

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "sequence": {
      "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)$"
        },
        "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)$"
        },
        "version": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "state": {
          "type": "string",
          "enum": [
            "draft",
            "admitted",
            "cancelled"
          ]
        },
        "item_count": {
          "type": "integer",
          "minimum": 2,
          "maximum": 25
        },
        "caption_preview": {
          "type": "string",
          "maxLength": 500
        },
        "created_at": {
          "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
          "format": "date-time"
        },
        "updated_at": {
          "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
          "format": "date-time"
        },
        "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
              },
              "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"
                      },
                      "threadsOptions": {
                        "type": "object",
                        "properties": {
                          "post_type": {
                            "type": "string",
                            "enum": [
                              "TEXT",
                              "IMAGE",
                              "VIDEO",
                              "CAROUSEL",
                              "REPOST"
                            ]
                          },
                          "reply_to_id": {
                            "type": "string",
                            "maxLength": 128
                          },
                          "quote_post_id": {
                            "type": "string",
                            "maxLength": 128
                          },
                          "repost_target_id": {
                            "type": "string",
                            "maxLength": 128
                          },
                          "reply_control": {
                            "type": "string",
                            "enum": [
                              "everyone",
                              "accounts_you_follow",
                              "mentioned_only",
                              "parent_post_author_only",
                              "followers_only"
                            ]
                          },
                          "enable_reply_approvals": {
                            "type": "boolean"
                          },
                          "link_attachment": {
                            "type": "string",
                            "maxLength": 2048
                          },
                          "poll_attachment": {
                            "type": "object",
                            "properties": {
                              "option_a": {
                                "type": "string",
                                "maxLength": 25
                              },
                              "option_b": {
                                "type": "string",
                                "maxLength": 25
                              },
                              "option_c": {
                                "type": "string",
                                "maxLength": 25
                              },
                              "option_d": {
                                "type": "string",
                                "maxLength": 25
                              }
                            },
                            "required": [
                              "option_a",
                              "option_b"
                            ]
                          },
                          "gif_attachment": {
                            "type": "object",
                            "properties": {
                              "gif_id": {
                                "type": "string",
                                "maxLength": 128
                              },
                              "provider": {
                                "type": "string",
                                "const": "GIPHY"
                              }
                            },
                            "required": [
                              "gif_id",
                              "provider"
                            ]
                          },
                          "text_attachment": {
                            "type": "object",
                            "properties": {
                              "plaintext": {
                                "type": "string",
                                "maxLength": 10000
                              },
                              "link_attachment_url": {
                                "type": "string",
                                "maxLength": 2048
                              },
                              "text_with_styling_info": {
                                "maxItems": 100,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "offset": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "length": {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    "styling_info": {
                                      "minItems": 1,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "bold",
                                          "italic",
                                          "highlight",
                                          "underline",
                                          "strikethrough"
                                        ]
                                      }
                                    }
                                  },
                                  "required": [
                                    "offset",
                                    "length",
                                    "styling_info"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "plaintext"
                            ]
                          },
                          "topic_tag": {
                            "type": "string",
                            "maxLength": 50
                          },
                          "text_entities": {
                            "maxItems": 10,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "entity_type": {
                                  "type": "string",
                                  "enum": [
                                    "SPOILER",
                                    "spoiler"
                                  ]
                                },
                                "offset": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "length": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "entity_type",
                                "offset",
                                "length"
                              ]
                            }
                          },
                          "is_spoiler_media": {
                            "type": "boolean"
                          },
                          "is_ghost_post": {
                            "type": "boolean"
                          },
                          "location_id": {
                            "type": "string",
                            "maxLength": 128
                          },
                          "allowlisted_country_codes": {
                            "minItems": 1,
                            "maxItems": 249,
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[A-Z]{2}$"
                            }
                          },
                          "crossreshare_to_ig": {
                            "type": "boolean"
                          },
                          "crossreshare_to_ig_dark_mode": {
                            "type": "boolean"
                          },
                          "auto_publish_text": {
                            "type": "boolean"
                          },
                          "media_options": {
                            "maxItems": 20,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "asset_id": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "alt_text": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 1000
                                },
                                "is_spoiler_media": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "asset_id"
                              ]
                            }
                          }
                        }
                      },
                      "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",
                    "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)))$",
                    "format": "date-time"
                  },
                  "updated_at": {
                    "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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                    "format": "date-time"
                  },
                  "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",
                            "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)))$",
                            "format": "date-time"
                          },
                          "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"
                      }
                    ]
                  },
                  "brand_context": {
                    "anyOf": [
                      {
                        "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)$"
                          },
                          "selection": {
                            "type": "object",
                            "properties": {
                              "profile_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)$"
                              },
                              "version_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
                              },
                              "content_digest": {
                                "type": "string",
                                "pattern": "^[a-f0-9]{64}$"
                              },
                              "context_digest": {
                                "type": "string",
                                "pattern": "^[a-f0-9]{64}$"
                              }
                            },
                            "required": [
                              "profile_id",
                              "version_id",
                              "revision",
                              "content_digest",
                              "context_digest"
                            ]
                          },
                          "availability": {
                            "type": "string",
                            "enum": [
                              "available",
                              "missing"
                            ]
                          },
                          "profile_state": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "archived"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "content": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string",
                                    "maxLength": 120
                                  },
                                  "audience": {
                                    "type": "string",
                                    "maxLength": 2000
                                  },
                                  "voice": {
                                    "type": "string",
                                    "maxLength": 2000
                                  },
                                  "language": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 64
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "preferred_terms": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    }
                                  },
                                  "prohibited_terms": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    }
                                  },
                                  "locked_facts": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 500
                                    }
                                  },
                                  "call_to_action": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 1000
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "name",
                                  "audience",
                                  "voice",
                                  "language",
                                  "preferred_terms",
                                  "prohibited_terms",
                                  "locked_facts",
                                  "call_to_action"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "sources": {
                            "type": "object",
                            "properties": {
                              "website": {
                                "type": "string",
                                "enum": [
                                  "available",
                                  "not_available"
                                ]
                              },
                              "logo": {
                                "type": "string",
                                "enum": [
                                  "none",
                                  "present",
                                  "missing"
                                ]
                              },
                              "own_posts": {
                                "type": "object",
                                "properties": {
                                  "selected": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 10
                                  },
                                  "available": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 10
                                  },
                                  "unavailable": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 10
                                  },
                                  "erased": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 10
                                  }
                                },
                                "required": [
                                  "selected",
                                  "available",
                                  "unavailable",
                                  "erased"
                                ]
                              }
                            },
                            "required": [
                              "website",
                              "logo",
                              "own_posts"
                            ]
                          }
                        },
                        "required": [
                          "workspace_id",
                          "selection",
                          "availability",
                          "profile_state",
                          "content",
                          "sources"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "brand_review": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "rule_version": {
                            "type": "number",
                            "const": 1
                          },
                          "context_digest": {
                            "type": "string",
                            "pattern": "^[a-f0-9]{64}$"
                          },
                          "content_digest": {
                            "type": "string",
                            "pattern": "^[a-f0-9]{64}$"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "clear",
                              "attention",
                              "unavailable"
                            ]
                          },
                          "issues": {
                            "maxItems": 5151,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string",
                                  "enum": [
                                    "prohibited_term",
                                    "locked_fact_missing",
                                    "conflicting_rule",
                                    "context_unavailable"
                                  ]
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 80
                                },
                                "rule_index": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 49
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "message": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 240
                                }
                              },
                              "required": [
                                "code",
                                "target",
                                "rule_index",
                                "message"
                              ]
                            }
                          }
                        },
                        "required": [
                          "rule_version",
                          "context_digest",
                          "content_digest",
                          "status",
                          "issues"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "workspace_id",
                  "revision",
                  "state",
                  "content",
                  "created_by",
                  "updated_by",
                  "created_at",
                  "updated_at",
                  "submission"
                ]
              },
              "predecessor_post_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"
                  }
                ]
              },
              "post": {
                "anyOf": [
                  {
                    "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"
                        ]
                      },
                      "deletion": {
                        "type": "object",
                        "properties": {
                          "state": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "retry_scheduled",
                              "failed",
                              "unconfirmed",
                              "confirmed",
                              "unpublished_cancelled"
                            ]
                          },
                          "retry_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": [
                          "state",
                          "retry_at"
                        ]
                      },
                      "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"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "retry_allowed": {
                "type": "boolean"
              }
            },
            "required": [
              "item_id",
              "ordinal",
              "draft",
              "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",
                "minLength": 1,
                "maxLength": 80
              },
              "message": {
                "type": "string",
                "maxLength": 1000
              }
            },
            "required": [
              "action",
              "allowed",
              "reason_code",
              "message"
            ]
          }
        }
      },
      "required": [
        "workspace_id",
        "id",
        "social_account_id",
        "version",
        "state",
        "item_count",
        "caption_preview",
        "created_at",
        "updated_at",
        "items",
        "expected_versions",
        "actions"
      ]
    },
    "preview_digest": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "eligible": {
      "type": "boolean"
    },
    "issues": {
      "maxItems": 25,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "item_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"
              }
            ]
          },
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "message": {
            "type": "string",
            "maxLength": 1000
          }
        },
        "required": [
          "item_id",
          "code",
          "message"
        ]
      }
    }
  },
  "required": [
    "sequence",
    "preview_digest",
    "eligible",
    "issues"
  ]
}
```

## 錯誤及安全重試

請檢查 HTTP 狀態及實際回應格式。400 驗證錯誤可能回傳 ZodError；handler 錯誤可能採用 error／message／code envelope。請保留可用的 request_id 或 x-request-id，避免記錄憑證。遇到 401／403 時，須先修正存取問題；429 須遵守 Retry-After。寫入結果未明或回傳 5xx 時，請先讀取原有結果，再決定是否重試。只有操作支援時才可重用 idempotency key；並無通用重試或 exactly-once 保證。

## 範例

以下虛構值已按 contract 驗證，並非真實帳戶 ID、憑證或發佈紀錄。請以已授權範圍回傳的 ID、已準備完成的素材及已審核排程取代，並在寫入前核對平台資格。此頁不會呼叫 API。

在伺服器環境設定 SOSOAPI_ACCESS_TOKEN，使用此操作接受的憑證。請勿將憑證放入瀏覽器程式。一般 AI Agent 建議透過 sosoapi auth login 使用瀏覽器 OAuth，由 CLI 管理憑證更新。

request.json

```json
{
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "id": "33333333-3333-4333-8333-333333333333",
  "expected_version": 1
}
```

cURL

```bash
curl --request POST \
  "https://gqeshlawtcexsapabaui.supabase.co/functions/v1/studio-api/threads-sequences/preview" \
  -H "Authorization: Bearer $SOSOAPI_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @request.json
```

JavaScript

```js
// 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/threads-sequences/preview", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer " + token },
  body: JSON.stringify({
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "id": "33333333-3333-4333-8333-333333333333",
  "expected_version": 1
})
});
const result = await response.json();
// Check response.ok, the operation-specific body and completion state before continuing.
```

CLI

```bash
npx sosoapi api post /studio-api/threads-sequences/preview < request.json
```

虛構回應範例

```json
{
  "sequence": {
    "id": "33333333-3333-4333-8333-333333333333",
    "workspace_id": "11111111-1111-4111-8111-111111111111",
    "social_account_id": "22222222-2222-4222-8222-222222222222",
    "version": 1,
    "state": "draft",
    "item_count": 2,
    "caption_preview": "A fictional announcement.",
    "created_at": "2099-01-14T09:00:00Z",
    "updated_at": "2099-01-14T09:00:00Z",
    "items": [
      {
        "item_id": "80000000-0000-4000-8000-000000000001",
        "ordinal": 1,
        "draft": {
          "id": "70000000-0000-4000-8000-000000000001",
          "workspace_id": "11111111-1111-4111-8111-111111111111",
          "revision": 1,
          "state": "draft",
          "content": {
            "schemaVersion": 1,
            "accountIds": [
              "22222222-2222-4222-8222-222222222222"
            ],
            "caption": "A fictional announcement.",
            "hashtags": "",
            "assetIds": [],
            "threadsTextOnly": false,
            "threadsOptions": {
              "post_type": "TEXT"
            },
            "instagramMode": "REELS",
            "youtubeTitle": "",
            "youtubePrivacy": "private",
            "youtubeSynthetic": false,
            "youtubeCategoryId": "",
            "youtubeShort": false,
            "linkUrl": "",
            "scheduledAt": "2099-01-15T09:00:00Z",
            "displayTimezone": "UTC",
            "publishNow": false,
            "destinationOverrides": {},
            "expiresAt": ""
          },
          "created_by": null,
          "updated_by": null,
          "created_at": "2099-01-14T09:00:00Z",
          "updated_at": "2099-01-14T09:00:00Z",
          "submission": null
        },
        "predecessor_post_id": null,
        "post": null,
        "retry_allowed": false
      },
      {
        "item_id": "80000000-0000-4000-8000-000000000002",
        "ordinal": 2,
        "draft": {
          "id": "70000000-0000-4000-8000-000000000002",
          "workspace_id": "11111111-1111-4111-8111-111111111111",
          "revision": 1,
          "state": "draft",
          "content": {
            "schemaVersion": 1,
            "accountIds": [
              "22222222-2222-4222-8222-222222222222"
            ],
            "caption": "A fictional first reply.",
            "hashtags": "",
            "assetIds": [],
            "threadsTextOnly": false,
            "threadsOptions": {
              "post_type": "TEXT"
            },
            "instagramMode": "REELS",
            "youtubeTitle": "",
            "youtubePrivacy": "private",
            "youtubeSynthetic": false,
            "youtubeCategoryId": "",
            "youtubeShort": false,
            "linkUrl": "",
            "scheduledAt": "2099-01-15T09:00:00Z",
            "displayTimezone": "UTC",
            "publishNow": false,
            "destinationOverrides": {},
            "expiresAt": ""
          },
          "created_by": null,
          "updated_by": null,
          "created_at": "2099-01-14T09:00:00Z",
          "updated_at": "2099-01-14T09:00:00Z",
          "submission": null
        },
        "predecessor_post_id": null,
        "post": null,
        "retry_allowed": false
      }
    ],
    "expected_versions": {},
    "actions": [
      {
        "action": "resume",
        "allowed": false,
        "reason_code": "no_failed_items",
        "message": "No safe failed suffix is present in this fictional snapshot."
      },
      {
        "action": "cancel",
        "allowed": true,
        "reason_code": "allowed",
        "message": "Only unsent items can be cancelled; published content stays in place."
      }
    ]
  },
  "eligible": false,
  "preview_digest": null,
  "issues": [
    {
      "item_id": null,
      "code": "capability_unknown",
      "message": "Fictional account: reply capability has not been verified. This preview does not authorize creation."
    }
  ]
}
```

## 相關工具及指南

MCP: sosoapi_preview_threads_sequence

[API reference](https://sosoapi.ai/zh-hant/docs/api)
