帳戶及工作空間
列出已連接帳戶
列出工作空間嘅社交帳戶、連接健康及能力資料。排程或留言用回傳 ID 作 social_account_id。明確傳 workspace_id;強制指定目的地時,欠缺此欄位會被拒絕。實際平台支援以回傳能力為準。
POST /identity-api/user/social-accounts/listContract 核對日期: · sha256:563d2d581da0ad29
概覽
列出工作空間嘅社交帳戶、連接健康及能力資料。排程或留言用回傳 ID 作 social_account_id。明確傳 workspace_id;強制指定目的地時,欠缺此欄位會被拒絕。實際平台支援以回傳能力為準。
HTTP 成功只表示呢次操作嘅回應。背景工作要保留回傳 ID,讀取同一操作直到文件指定嘅終態。接受請求、排程成功或客戶端逾時,都唔代表已發佈。
驗證及權限
憑證唔能夠擴大持有人權限。實際操作仍會檢查工作空間成員資格、資源擁有權、已選工作空間及能力授權。Tool profile 只改變可見工具,唔會授權。
請求欄位
必填表示喺所屬物件及所選分支內必須提供;子欄位必填唔代表可選父物件變成必填。以下欄位名稱及規則直接來自 contract。
| 欄位/分支 | 類型/必填 | 限制 |
|---|---|---|
$ | 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,讀取同一操作直到文件指定嘅終態。接受請求、排程成功或客戶端逾時,都唔代表已發佈。
必填表示喺所屬物件及所選分支內必須提供;子欄位必填唔代表可選父物件變成必填。以下欄位名稱及規則直接來自 contract。
| 欄位/分支 | 類型/必填 | 限制 |
|---|---|---|
$ | 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;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,使用此操作接受嘅憑證。唔好放入瀏覽器程式。一般 agent 建議透過 sosoapi auth login 用瀏覽器 OAuth,由 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": []
}