对外发布

确认发布

两步确认的第二步:拿新建 / 修改返回的 confirmToken 真正对外发布。令牌一次性、十分钟内有效,并绑定当时的内容 —— 内容在两步之间被改过,令牌即失效。确认时会重新校验账号状态、安全阀与频控。

POST/api/v1/posts/{postId}/confirm
publish:execute发布档限流Idempotency-Key 必填

鉴权与护栏

  • 请求头 Authorization: Bearer <长期凭证>,凭证在设置页「接入外部系统 → 长期凭证」签发,见 鉴权与权限。
  • 凭证需带 scope publish:execute;签发者在工作区里的角色也要允许该动作。
  • 限流:发布档,每分钟 5 次(按凭证计),超出回 429 并带 Retry-After。
  • 幂等:必须带 Idempotency-Key(缺了回 400);同键重试原样回第一次结果并带 meta.replayed: true。

路径参数

postIdstring必填

内容 id。

请求体(application/json)

confirmTokenstring必填

新建 / 修改返回的 confirm.token。

clientRequestIdstring必填

幂等键(8–128 chars of [A-Za-z0-9_.:-]);推荐放在 Idempotency-Key 请求头,头与 body 都给时以头为准。

响应

成功返回 HTTP 200,信封为 { data, meta };右侧(窄屏在本页末尾)给出了各状态码的示例。所有错误都是 { error: { code, message, params }, meta },按机器码处理而不是按 message 匹配,码表见 错误码。

状态码可能的错误码
400invalid_input
401unauthenticated
402plan_limit
403forbidden / workspace_not_found
404not_found
409no_account / needs_reauth / replay
429rate_limited
500internal
502platform_error
503external_writes_off

示例

请求
curl -X POST "https://popkit.loxily.com/api/v1/posts/pst_01J8ZK3R7QW6M2/confirm" \
  -H "Authorization: Bearer popkit_it_••••••••" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: acme-2026-09-21-001" \
  -d '{
  "confirmToken": "cf_9u2K…"
}'
响应
已进入发布
{
  "data": {
    "postId": "pst_01J8ZK3R7QW6M2",
    "status": "publishing",
    "scheduledAt": null,
    "deepLink": "https://popkit.loxily.com/history?post=pst_01J8ZK3R7QW6M2"
  },
  "meta": {
    "requestId": "6a1d0c9e-2b7f-4e3a-8c5d-1f0e9b8a7c69"
  }
}