API 参考
工作区GET

获取当前工作区

返回与 X-Api-Key 请求头关联的工作区。请求体中无需再传 workspace_id。

https://api.unifyport.ai/v1/workspace

请求头

X-Api-Key
string必填

工作区 API Key,工作区由该请求头解析得到。

路径参数

该接口没有路径参数。

请求体

该接口无需 JSON 请求体。

响应体

name
string

工作区显示名。

status
string

工作区生命周期状态,例如 active。

metadata
object

存储在工作区上的自有环境标签。

account_quota
number

该工作区允许的渠道账号数量上限。

account_quota_unlimited
boolean

为 true 时账号配额不受限制,account_quota 被忽略。

响应

200
200 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
  }
}