文档API 参考

Rust · 0.1.0

Create Space

POST /api/v1/spaces

SpaceService · SpaceService_CreateSpace

基于协议生成的参考。授权与实例策略仍然生效。结构描述继承自 MIT 许可的应用接口定义;本站不会向真实服务执行示例。

访问权限

需要有效账号认证;实例策略及下方操作特有的检查仍然适用。

先创建,再邀请

发送包含非空 title、可选 description 和 icon 的 Space 请求体。调用者成为首位 ADMIN。通过 CreateSpaceInvitation 邀请已有有效账号,受邀人接受后才加入。spaceId 可省略,提供时应遵循下方标识格式。

请求

CreateSpace creates a space and makes the authenticated caller its first administrator.

POST/api/v1/spaces

参数

名称 / 位置类型 / 是否必需描述
spaceId
query
string
OpenAPI 未标记为必需
Optional. The space UID to use for this space. If empty, a canonical UUID v4 will be generated. Format: ^[a-zA-Z0-9]([a-zA-Z0-9-]{0,34}[a-zA-Z0-9])?$

请求体

必需

application/json · Space

响应

200 · OK

application/json · Space

default · Default error response

application/json · Status

完整操作定义

下方保留全部已声明约束、媒体类型和响应细节。结构引用链接到完整定义。

展开 JSON 定义
{
  "tags": [
    "SpaceService"
  ],
  "description": "CreateSpace creates a space and makes the authenticated caller its first\n administrator.",
  "operationId": "SpaceService_CreateSpace",
  "parameters": [
    {
      "name": "spaceId",
      "in": "query",
      "description": "Optional. The space UID to use for this space.\n If empty, a canonical UUID v4 will be generated.\n Format: ^[a-zA-Z0-9]([a-zA-Z0-9-]{0,34}[a-zA-Z0-9])?$",
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Space"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Space"
          }
        }
      }
    },
    "default": {
      "description": "Default error response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Status"
          }
        }
      }
    }
  }
}