工作区GET
获取当前工作区
返回与 X-Api-Key 请求头关联的工作区。请求体中无需再传 workspace_id。
https://api.unifyport.ai/v1/workspace请求头
X-Api-Keystring必填
工作区 API Key,工作区由该请求头解析得到。
路径参数
该接口没有路径参数。
请求体
该接口无需 JSON 请求体。
响应体
namestring
工作区显示名。
statusstring
工作区生命周期状态,例如 active。
metadataobject
存储在工作区上的自有环境标签。
account_quotanumber
该工作区允许的渠道账号数量上限。
account_quota_unlimitedboolean
为 true 时账号配额不受限制,account_quota 被忽略。
响应
200200 OK
请求成功,响应体示例如上。
400请求错误
请求体、路径或参数不合法。
401未授权
X-Api-Key 请求头缺失或无效。
409冲突
当前操作与已有的渠道账号或资源冲突。
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
}
}