帳號與工作空間
列出已連結帳號
列出工作空間已連結的社群帳號(Instagram、Threads、Facebook、YouTube),含連結健康狀態和能力資訊。排程或留言時,將其 id 用作 social_account_id。傳入 workspace_id:強制明確指定目標後,缺少此欄位的請求會被拒絕。
POST /identity-api/user/social-accounts/list契約檢閱日期: · sha256:563d2d581da0ad29
概覽
列出工作空間已連結的社群帳號(Instagram、Threads、Facebook、YouTube),含連結健康狀態和能力資訊。排程或留言時,將其 id 用作 social_account_id。傳入 workspace_id:強制明確指定目標後,缺少此欄位的請求會被拒絕。
成功 HTTP 回應可能表示請求已接受,並非已完成。背景工作請儲存回傳 ID,持續檢查同一操作直到完成。已排程或已接受的貼文,只有平台確認後才算已發布;用戶端逾時無法證明結果。
驗證與權限
權杖只能使用其擁有者持有的權利。每次請求會檢查工作空間成員資格、資源擁有權、所選工作空間及已授予能力。core 與 full 設定檔只變更顯示的工具,不會授予存取權。
請求欄位
「必填」是指在其父物件及所選分支內必填。必填子欄位不會使選填父物件變成必填。下列規則與欄位名稱均複製自契約。
| 欄位 / 分支 | 類型 / 必填 | 約束 |
|---|---|---|
$ | object在父物件中必填 |
|
workspace_id | string選填/項目 |
|
include_authorization_grant | boolean選填/項目 | — |
完整 JSON Schema
{
"$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)$"
},
"include_authorization_grant": {
"type": "boolean"
}
},
"additionalProperties": false
}回應與完成
成功 HTTP 狀態:200。操作完成時: synchronous_http_response.
成功 HTTP 回應可能表示請求已接受,並非已完成。背景工作請儲存回傳 ID,持續檢查同一操作直到完成。已排程或已接受的貼文,只有平台確認後才算已發布;用戶端逾時無法證明結果。
「必填」是指在其父物件及所選分支內必填。必填子欄位不會使選填父物件變成必填。下列規則與欄位名稱均複製自契約。
| 欄位 / 分支 | 類型 / 必填 | 約束 |
|---|---|---|
$ | object在父物件中必填 | — |
accounts | array在父物件中必填 | — |
accounts[] | object選填/項目 | — |
accounts[].id | string在父物件中必填 |
|
accounts[].platform | string在父物件中必填 |
|
accounts[].handle | string | null在父物件中必填 | — |
accounts[].handleanyOf 1 | string在父物件中必填 | — |
accounts[].handleanyOf 2 | null在父物件中必填 | — |
accounts[].status | string在父物件中必填 |
|
accounts[].expires_at | string | null在父物件中必填 | — |
accounts[].expires_atanyOf 1 | string在父物件中必填 | — |
accounts[].expires_atanyOf 2 | null在父物件中必填 | — |
accounts[].created_at | string在父物件中必填 | — |
accounts[].avatar_url | string | null選填/項目 | — |
accounts[].avatar_urlanyOf 1 | string選填/項目 | — |
accounts[].avatar_urlanyOf 2 | null選填/項目 | — |
accounts[].follower_count | integer | null選填/項目 | — |
accounts[].follower_countanyOf 1 | integer選填/項目 |
|
accounts[].follower_countanyOf 2 | null選填/項目 | — |
accounts[].post_count | integer | null選填/項目 | — |
accounts[].post_countanyOf 1 | integer選填/項目 |
|
accounts[].post_countanyOf 2 | null選填/項目 | — |
accounts[].auto_sync_enabled | boolean選填/項目 | — |
accounts[].last_synced_at | string | null選填/項目 | — |
accounts[].last_synced_atanyOf 1 | string選填/項目 | — |
accounts[].last_synced_atanyOf 2 | null選填/項目 | — |
accounts[].workspace_id | string | null選填/項目 | — |
accounts[].workspace_idanyOf 1 | string選填/項目 |
|
accounts[].workspace_idanyOf 2 | null選填/項目 | — |
accounts[].platform_user_id | string | null選填/項目 | — |
accounts[].platform_user_idanyOf 1 | string選填/項目 |
|
accounts[].platform_user_idanyOf 2 | null選填/項目 | — |
accounts[].instagram_login_mode | string | null選填/項目 | — |
accounts[].instagram_login_modeanyOf 1 | string選填/項目 |
|
accounts[].instagram_login_modeanyOf 2 | null選填/項目 | — |
accounts[].facebook_page_id | string | null選填/項目 | — |
accounts[].facebook_page_idanyOf 1 | string選填/項目 |
|
accounts[].facebook_page_idanyOf 2 | null選填/項目 | — |
accounts[].blocked_until | string | null選填/項目 | — |
accounts[].blocked_untilanyOf 1 | string選填/項目 | — |
accounts[].blocked_untilanyOf 2 | null選填/項目 | — |
accounts[].block_reason | string | null選填/項目 | — |
accounts[].block_reasonanyOf 1 | string選填/項目 |
|
accounts[].block_reasonanyOf 2 | null選填/項目 | — |
accounts[].block_subcode | integer | null選填/項目 | — |
accounts[].block_subcodeanyOf 1 | integer選填/項目 |
|
accounts[].block_subcodeanyOf 2 | null選填/項目 | — |
accounts[].block_count | integer選填/項目 |
|
accounts[].last_block_at | string | null選填/項目 | — |
accounts[].last_block_atanyOf 1 | string選填/項目 | — |
accounts[].last_block_atanyOf 2 | null選填/項目 | — |
accounts[].health_state | string在父物件中必填 |
|
accounts[].health_message | string在父物件中必填 |
|
accounts[].health_observed_at | string | null在父物件中必填 | — |
accounts[].health_observed_atanyOf 1 | string在父物件中必填 | — |
accounts[].health_observed_atanyOf 2 | null在父物件中必填 | — |
accounts[].authorization_grant | object選填/項目 | — |
accounts[].authorization_grantoneOf 1 | object選填/項目 | — |
accounts[].authorization_grant.granted_permissionsoneOf 1 | array在父物件中必填 | — |
accounts[].authorization_grant.granted_permissions[]oneOf 1 | string選填/項目 |
|
accounts[].authorization_grant.inventory_sourceoneOf 1 | string在父物件中必填 |
|
accounts[].authorization_grant.inventory_exactoneOf 1 | boolean在父物件中必填 |
|
accounts[].authorization_grant.observed_atoneOf 1 | string在父物件中必填 |
|
accounts[].authorization_grant.provider_api_versiononeOf 1 | string在父物件中必填 |
|
accounts[].authorization_grant.oauth_provideroneOf 1 | string在父物件中必填 |
|
accounts[].authorization_grant.oauth_subject_idoneOf 1 | string在父物件中必填 |
|
accounts[].authorization_grantoneOf 2 | object選填/項目 | — |
accounts[].authorization_grant.granted_permissionsoneOf 2 | array在父物件中必填 |
|
accounts[].authorization_grant.granted_permissions[]oneOf 2 | any JSON value選填/項目 | — |
accounts[].authorization_grant.inventory_sourceoneOf 2 | string在父物件中必填 |
|
accounts[].authorization_grant.inventory_exactoneOf 2 | boolean在父物件中必填 |
|
accounts[].authorization_grant.observed_atoneOf 2 | null在父物件中必填 | — |
accounts[].authorization_grant.provider_api_versiononeOf 2 | null在父物件中必填 | — |
accounts[].authorization_grant.oauth_provideroneOf 2 | string | null在父物件中必填 | — |
accounts[].authorization_grant.oauth_provideroneOf 2 / anyOf 1 | string在父物件中必填 |
|
accounts[].authorization_grant.oauth_provideroneOf 2 / anyOf 2 | null在父物件中必填 | — |
accounts[].authorization_grant.oauth_subject_idoneOf 2 | string | null在父物件中必填 | — |
accounts[].authorization_grant.oauth_subject_idoneOf 2 / anyOf 1 | string在父物件中必填 |
|
accounts[].authorization_grant.oauth_subject_idoneOf 2 / anyOf 2 | null在父物件中必填 | — |
accounts[].current_capability_snapshot_id | string | null在父物件中必填 | — |
accounts[].current_capability_snapshot_idanyOf 1 | string在父物件中必填 |
|
accounts[].current_capability_snapshot_idanyOf 2 | null在父物件中必填 | — |
accounts[].capability_facts | array在父物件中必填 | — |
accounts[].capability_facts[] | object選填/項目 | — |
accounts[].capability_facts[].capability | string在父物件中必填 |
|
accounts[].capability_facts[].observed_allowed | boolean | null在父物件中必填 | — |
accounts[].capability_facts[].observed_allowedanyOf 1 | boolean在父物件中必填 | — |
accounts[].capability_facts[].observed_allowedanyOf 2 | null在父物件中必填 | — |
accounts[].capability_facts[].availability | string在父物件中必填 |
|
accounts[].capability_facts[].reason_code | string在父物件中必填 |
|
accounts[].capability_facts[].observed_at | string在父物件中必填 | — |
accounts[].capability_facts[].valid_until | string在父物件中必填 | — |
accounts[].capability_facts[].provider_api_version | string在父物件中必填 |
|
accounts[].capability_facts[].required_permissions | array在父物件中必填 | — |
accounts[].capability_facts[].required_permissions[] | string選填/項目 |
|
accounts[].capability_facts[].granted_permissions | array在父物件中必填 | — |
accounts[].capability_facts[].granted_permissions[] | string選填/項目 |
|
accounts[].capability_facts[].account_eligibility | object在父物件中必填 |
|
accounts[].capability_facts[].account_eligibility.* | any JSON value選填/項目 | — |
完整 JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"accounts": {
"type": "array",
"items": {
"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)$"
},
"platform": {
"type": "string",
"enum": [
"instagram",
"threads",
"facebook",
"tiktok",
"linkedin",
"youtube",
"x"
]
},
"handle": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"status": {
"type": "string",
"enum": [
"valid",
"expiring_soon",
"expired",
"disconnected"
]
},
"expires_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"created_at": {
"type": "string"
},
"avatar_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"follower_count": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"post_count": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"auto_sync_enabled": {
"type": "boolean"
},
"last_synced_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"workspace_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_user_id": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
]
},
"instagram_login_mode": {
"anyOf": [
{
"type": "string",
"enum": [
"instagram_login",
"facebook_login"
]
},
{
"type": "null"
}
]
},
"facebook_page_id": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
]
},
"blocked_until": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"block_reason": {
"anyOf": [
{
"type": "string",
"enum": [
"transient",
"account_block",
"auth_invalid",
"permanent"
]
},
{
"type": "null"
}
]
},
"block_subcode": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"block_count": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"last_block_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"health_state": {
"type": "string",
"enum": [
"ready",
"action_required",
"temporarily_unavailable",
"publishing_restricted",
"disconnected",
"unknown"
]
},
"health_message": {
"type": "string",
"minLength": 1,
"maxLength": 500
},
"health_observed_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"authorization_grant": {
"oneOf": [
{
"type": "object",
"properties": {
"granted_permissions": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"inventory_source": {
"type": "string",
"enum": [
"oauth_token_response",
"provider_token_debug",
"provider_permissions_endpoint"
]
},
"inventory_exact": {
"type": "boolean",
"const": true
},
"observed_at": {
"type": "string",
"minLength": 1
},
"provider_api_version": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"oauth_provider": {
"type": "string",
"enum": [
"instagram",
"threads",
"meta",
"google"
]
},
"oauth_subject_id": {
"type": "string",
"minLength": 1
}
},
"required": [
"granted_permissions",
"inventory_source",
"inventory_exact",
"observed_at",
"provider_api_version",
"oauth_provider",
"oauth_subject_id"
]
},
{
"type": "object",
"properties": {
"granted_permissions": {
"minItems": 0,
"maxItems": 0,
"type": "array",
"items": {
"not": {}
}
},
"inventory_source": {
"type": "string",
"const": "unavailable"
},
"inventory_exact": {
"type": "boolean",
"const": false
},
"observed_at": {
"type": "null"
},
"provider_api_version": {
"type": "null"
},
"oauth_provider": {
"anyOf": [
{
"type": "string",
"enum": [
"instagram",
"threads",
"meta",
"google"
]
},
{
"type": "null"
}
]
},
"oauth_subject_id": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
]
}
},
"required": [
"granted_permissions",
"inventory_source",
"inventory_exact",
"observed_at",
"provider_api_version",
"oauth_provider",
"oauth_subject_id"
]
}
]
},
"current_capability_snapshot_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"
}
]
},
"capability_facts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"capability": {
"type": "string",
"enum": [
"can_publish_text",
"can_publish_image",
"can_publish_video",
"can_publish_reel",
"can_publish_carousel",
"can_publish_first_comment",
"can_publish_topic_tag",
"can_publish_link",
"can_upload_video",
"can_set_title",
"can_set_description",
"can_set_thumbnail",
"can_set_privacy_status",
"can_publish_story",
"can_invite_collaborators",
"can_tag_products",
"can_publish_trial_reel",
"can_publish_partnership",
"can_delete_media",
"can_publish_reply",
"can_quote_post",
"can_repost",
"can_publish_poll",
"can_publish_gif",
"can_publish_text_attachment",
"can_publish_ghost_post",
"can_tag_location",
"can_crossshare_to_instagram",
"can_auto_publish_text",
"can_delete_post",
"can_publish_multi_image",
"can_target_post",
"can_backdate_post",
"can_manage_native_schedule",
"can_update_video",
"can_delete_video",
"can_set_brand_partner"
]
},
"observed_allowed": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"availability": {
"type": "string",
"enum": [
"available",
"unavailable",
"unknown",
"documented_ambiguous"
]
},
"reason_code": {
"type": "string",
"pattern": "^[a-z0-9_]+$"
},
"observed_at": {
"type": "string"
},
"valid_until": {
"type": "string"
},
"provider_api_version": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"required_permissions": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"granted_permissions": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"account_eligibility": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"required": [
"capability",
"observed_allowed",
"availability",
"reason_code",
"observed_at",
"valid_until",
"provider_api_version",
"required_permissions",
"granted_permissions",
"account_eligibility"
]
}
}
},
"required": [
"id",
"platform",
"handle",
"status",
"expires_at",
"created_at",
"health_state",
"health_message",
"health_observed_at",
"current_capability_snapshot_id",
"capability_facts"
]
}
}
},
"required": [
"accounts"
]
}錯誤與安全重試
檢查 HTTP 狀態和回應內容。400 驗證錯誤可能包含 ZodError;處理常式錯誤使用 error、message 和 code 欄位。保留 request_id 或 x-request-id 以便診斷,但不要保留憑證。先解決 401/403 存取錯誤再重試,並在收到 429 時遵循 Retry-After。如寫入結果不確定或回傳 5xx,先讀取現有結果。僅在支援時重複使用冪等鍵;重試行為因操作而異,並不保證恰好傳送一次。
故障排查指南範例
這些範例使用已依結構描述檢查的虛構值。請將 ID 替換為您有權使用的 ID、將媒體替換為已就緒素材,並將日期替換為已確認的發布時間。提交寫入前,請檢查帳號資格。本頁不會傳送 API 請求。
在伺服器上將 SOSOAPI_ACCESS_TOKEN 設為此操作接受的憑證,且不要放入瀏覽器程式碼。代理程式請使用 sosoapi auth login 透過瀏覽器登入,並由 CLI 更新憑證。
request.json
{}cURL
curl --request POST \
"https://gqeshlawtcexsapabaui.supabase.co/functions/v1/identity-api/user/social-accounts/list" \
-H "Authorization: Bearer $SOSOAPI_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @request.jsonJavaScript
// 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/identity-api/user/social-accounts/list", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer " + token },
body: JSON.stringify({})
});
const result = await response.json();
// Check response.ok, the operation-specific body and completion state before continuing.CLI
npx sosoapi api post /identity-api/user/social-accounts/list < request.json合成回應範例
{
"accounts": []
}