工作區GET
取得目前工作區
回傳與 X-Api-Key 請求標頭關聯的工作區。請求內容中無需再傳 workspace_id。
https://api.unifyport.ai/v1/workspace請求標頭
X-Api-Keystring必填
工作區 API Key,工作區會由此標頭解析得到。
路徑參數
此介面沒有路徑參數。
請求內容
此介面無需 JSON 請求內容。
回應內容
namestring
工作區顯示名稱。
statusstring
工作區狀態:active 或 inactive;inactive 時全部 API Key 無法認證。
enum: active, inactive
metadataobject
儲存於工作區、面向自有環境的標籤。
account_quotainteger
此工作區允許的渠道帳號數量上限。
format: uint64
account_quota_unlimitedboolean
為 true 時帳號配額無上限,account_quota 將被忽略。
回應
200200 OK
請求成功,回應內容範例如上。
401未授權
X-Api-Key 請求標頭缺少或無效。
500伺服器錯誤
服務遇到了未預期的錯誤。
請求
curl -X GET https://api.unifyport.ai/v1/workspace \
-H "X-Api-Key: <YOUR_API_KEY>"回應
{
"data": {
"name": "Production Workspace",
"status": "active",
"metadata": {
"env": "production"
},
"account_quota": 10,
"account_quota_unlimited": false
}
}