创建连接
POST
/web/v1/workspaces/{workspaceId}/slash/connections JWT在指定工作空间内创建一个新的 Slash 平台连接。
鉴权
需要有效的 JWT token 并具有 workspace:manage 权限。Portal 访问权限:system、tenant。
请求参数
| Name | Type | Required | In | Description |
|---|---|---|---|---|
workspaceId | String | Required | path | 工作空间 ID。 路径参数(由 Gateway 注入) |
connectionName | String | Required | body | 连接显示名称。 不能为空 |
partnerEndpoint | String | Required | body | 合作伙伴 API 端点 URL。 不能为空 |
slashApiBaseUrl | String | Required | body | Slash 平台 API 基础 URL。 不能为空 |
slashApiKey | String | Required | body | 用于 Slash 鉴权的 API Key。 不能为空 |
slashAccountId | String | Required | body | Slash 账户标识符。 不能为空 |
slashWebhookSecret | String | Required | body | 用于签名验证的 Webhook 密钥。 不能为空 |
tenantBizId | String | Optional | body | 租户业务 ID。省略时自动解析。 |
成功响应
Bad Request 400
{
"code": "4000",
"message": "connectionName must not be blank"
}错误响应
| HTTP 状态码 | 错误码 | 描述 |
|---|---|---|
| 400 | 4000 | 校验错误(缺少必填字段) |
| 401 | 4010 | JWT token 无效或已过期 |
| 403 | 4030 | 权限不足 |
说明
- 成功时返回 HTTP 201。
- 敏感字段(
slashApiKey、slashAccountId、slashWebhookSecret)在响应中已脱敏。 - 连接创建时为
PENDING状态 (20010201)。