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 或 inactive;inactive 时全部 API Key 无法鉴权。

enum: active, inactive

metadata
object

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

account_quota
integer

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

format: uint64

account_quota_unlimited
boolean

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

响应

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