工作区与账号

已连接账号

本工作区已连接的社交账号:平台、handle、粉丝数、授权状态(active / expiring / expired)、能否代发、所属分组。expired 的账号需要用户回站重新授权,外部系统无法代劳。

GET/api/v1/accounts
accounts:read读档限流只读

鉴权与护栏

  • 请求头 Authorization: Bearer <长期凭证>,凭证在设置页「接入外部系统 → 长期凭证」签发,见 鉴权与权限。
  • 凭证需带 scope accounts:read;签发者在工作区里的角色也要允许该动作。
  • 限流:读档,每分钟 60 次(按凭证计),超出回 429 并带 Retry-After。
  • 幂等:读端点,无需 Idempotency-Key。
  • 只读端点:不写库、不外发。

响应

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

状态码可能的错误码
400invalid_input
401unauthenticated
403forbidden / workspace_not_found
404not_found
429rate_limited
500internal

示例

请求
curl -X GET "https://popkit.loxily.com/api/v1/accounts" \
  -H "Authorization: Bearer popkit_it_••••••••"
响应
成功
{
  "data": {
    "accounts": [
      {
        "id": "acc_01J8XQ5M9V2R",
        "platform": "x",
        "handle": "@popkit",
        "displayName": "popkit",
        "avatar": "https://…/avatar.jpg",
        "followers": 12480,
        "status": "active",
        "connectedAt": "2026-07-03T02:11:09.000Z",
        "lastSyncedAt": "2026-09-20T01:00:12.000Z",
        "canPublish": true,
        "isManual": false,
        "profileUrl": "https://x.com/popkit",
        "subscriptionType": null,
        "groupIds": [
          "grp_01J8…"
        ]
      },
      {
        "id": "acc_01J8YB7N4T8K",
        "platform": "douyin",
        "handle": "popkit官方",
        "displayName": "popkit官方",
        "avatar": null,
        "followers": 0,
        "status": "active",
        "connectedAt": "2026-09-04T06:30:00.000Z",
        "lastSyncedAt": null,
        "canPublish": false,
        "isManual": true,
        "profileUrl": null,
        "subscriptionType": null,
        "groupIds": []
      }
    ],
    "groups": [
      {
        "id": "grp_01J8…",
        "name": "品牌号",
        "count": 1
      }
    ],
    "byPlatform": {
      "x": 1,
      "douyin": 1
    },
    "deepLink": "https://popkit.loxily.com/accounts"
  },
  "meta": {
    "requestId": "6a1d0c9e-2b7f-4e3a-8c5d-1f0e9b8a7c62"
  }
}