帖子编辑帖子

帖子

编辑帖子

任何网络开始发送前,可替换 targets、设置 scheduledAt,或在 draft 与 scheduled 之间切换,其余字段不变。

PATCHhttps://api.sofia-post.com/api/v1/posts/{id}
PATCH/v1/posts/{id}

此请求将作用于你的真实账户。

curl -X PATCH 'https://api.sofia-post.com/api/v1/posts/{id}' \
  -H "Authorization: Bearer $SOFIA_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"scheduledAt":"2026-11-02T10:00:00.000Z"}'

授权

  • Authorizationstring必填

    你的个人密钥或 OAuth 访问令牌,以 Bearer <token> 发送。

路径参数

  • idstring必填

    帖子的标识符。

请求体

application/json

  • targetsobject[]

    全部目标,整体重写(文案、媒体、格式、账号);省略则保持不变

    显示子属性
    • platformstring必填

      目标网络

      允许的值: instagramfacebookxlinkedintiktok

    • textstring必填

      在此网络上发布的文案

    • mediaobject[]

      附加的媒体

      显示子属性
      • idstring

        门店媒体库中某个媒体的标识符(否则用 url 和 type)

      • urlstring

        媒体的公开地址(正式模式下为 https);不提供标识符时使用

      • typestring

        按地址提供的媒体的类型

        允许的值: imagevideo

    • formatstring

      格式(post、reel、story、carousel 等);默认为该网络会采用的格式

    • accountIdstring

      正式模式:负责发布的已连接账号,在门店于该网络有多个账号时使用(GET /v1/establishments/:id/accounts)

  • scheduledAtstring<date-time>

    新的未来时间:帖子将在此时间排期发布

  • statusstring

    draft:退回草稿(保留内容,丢失时间);scheduled:按 scheduledAt 排期,或按原来的时间

    允许的值: draftscheduled

响应

200application/json

编辑后的帖子。

  • idstring必填

    帖子的标识符

  • statusstring必填

    跨所有网络的状态;partial:在一个网络发布成功,在另一个失败

    允许的值: draftscheduledpublishingpublishedsent_to_inboxfailedpartial

  • establishmentIdstring必填

    帖子所属的门店

  • createdAtstring<date-time>必填

    帖子的创建时间

  • targetsobject[]必填

    每个网络和账号一条:同一网络上的两个账号对应两条

    显示子属性
    • platformstring必填

      目标所在的网络

    • accountIdstring必填

      负责发布的账号(GET /v1/establishments/:id/accounts)

    • statestring必填

      目标在其网络上的状态

      允许的值: draftscheduledpublishingpublishedsent_to_inboxfailed

    • publishedAtstring<date-time>

      目标发布的时间

    • permalinkstring

      指向网络上已发布帖子的链接

    • errorstring

      网络拒绝的原因

  • scheduledAtstring<date-time>

    帖子计划发布的时间

402

subscription_required。

403

测试应用返回 live_mode_required,或缺少 posts:write scope。

404

post_not_found:令牌无法访问该帖子。

409

post_not_editable:某个网络已发送或正在发送。

422application/json

post_refused:某个网络、门店或 Publishing 会拒绝编辑后的帖子。同一网络上有两个目标时返回 duplicate_platform。

4XXapplication/json

其他任何错误,以错误结构返回。