添加工作区人员

OpenAPI 契约

方法
POST
路径
/api/v1/workspaces/{id}/people
认证
jwtBearer (bearer)
响应状态
201 400 401 403 404 409 429 500
请求与响应 Schema
JSON
{
  "requestBody": {
    "application/json": {
      "$ref": "#/components/schemas/AddWorkspacePersonRequest"
    }
  },
  "responses": {
    "201": {
      "description": "Workspace person added or invited",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/WorkspacePersonResponse"
        }
      }
    },
    "400": {
      "description": "Invalid request",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/RequestError"
        }
      }
    },
    "401": {
      "description": "Authentication required or invalid",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/SecurityError"
        }
      }
    },
    "403": {
      "description": "Authenticated but not permitted",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/SecurityError"
        }
      }
    },
    "404": {
      "description": "Requested workspace resource was not found",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    },
    "409": {
      "description": "Request conflicts with current workspace state",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    },
    "429": {
      "description": "Rate limit exceeded",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/SecurityError"
        }
      }
    },
    "500": {
      "description": "Unexpected server error",
      "content": {
        "application/json": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  }
}

POST /api/v1/workspaces/{id}/people 仅限 JWT,并且需要 people:manage。提交有效、非空且最多 320 个字符的邮箱,以及角色:ADMIN、DEVELOPER、VIEWER 或 BILLING。已归档工作区会拒绝请求。

如果邮箱属于现有账户,服务会确保其组织成员资格,并创建或重新激活有效的工作区成员资格;否则会记录待处理邀请。现有有效成员或待处理邀请会返回冲突。响应会标明结果是 MEMBER 还是 INVITATION。

json
{"email":"[email protected]","role":"DEVELOPER"}