创建业务空间、首位成员和首把 API Key 的一次性引导流程
接口说明
创建 workspace + 首位成员 + 首把 API Key 的一次性引导,返回明文 apiKey。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求语法
GET / HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| WorkspaceName |
string |
是 |
业务空间名称 |
my-workspace |
| MemberName |
string |
是 |
首位成员名称 |
my-member |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
创建成功 |
||
| RequestId |
string |
请求 ID |
FE9C65D7-930F-57A5-A207-8C396329**** |
| WorkspaceId |
string |
新建业务空间 ID |
ws-as1llqmkol**** |
| WorkspaceName |
string |
业务空间名称 |
my-workspace |
| MemberId |
string |
首位成员 ID |
mb-cz51tnnp8**** |
| MemberName |
string |
首位成员名称 |
my-member |
| Role |
string |
首位成员角色,固定为 owner |
owner |
| ApiKeyName |
string |
首把 API Key 名称,固定为 default |
default |
| ApiKey |
string |
明文 API Key,仅创建时返回一次,调用方需自行持久化 |
ctxdb-***** |
| Type |
string |
业务空间类型(personal:个人;enterprise:企业) |
personal |
| Status |
string |
业务空间状态(Active:正常运行;Locked:欠费停机/过期锁定) |
Active |
| CreatedAt |
string |
创建时间(ISO-8601 格式) |
2026-05-28T17:59:55Z |
示例
正常返回示例
JSON格式
{
"RequestId": "FE9C65D7-930F-57A5-A207-8C396329****",
"WorkspaceId": "ws-as1llqmkol****",
"WorkspaceName": "my-workspace",
"MemberId": "mb-cz51tnnp8****",
"MemberName": "my-member",
"Role": "owner",
"ApiKeyName": "default",
"ApiKey": "ctxdb-*****",
"Type": "personal",
"Status": "Active",
"CreatedAt": "2026-05-28T17:59:55Z"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidParameter | Request parameter is invalid. | |
| 401 | Unauthorized | Unauthorized. | |
| 500 | InternalError | Internal server error. | |
| 403 | NoPermission | Permission denied. | |
| 502 | UpstreamError | Upstream service returned an error. | |
| 404 | ResourceNotFound | Resource not found. | |
| 429 | QuotaExceeded | Resource quota exceeded. | |
| 409 | ResourceAlreadyExists | Resource state conflict. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。