POST/api/v1/orgs创建组织
Try it 面板需要启用 JavaScript。
创建者自动成为所有者并持有所有者角色。
Request
| Name | Data Type | Required | Description |
| Authorization | string | Yes | 会话令牌认证,格式 `Bearer <sessionToken>` |
| Content-Type | string | Yes | 请求体内容类型(默认值 "application/json") |
type RequestHeaders = {
/** 会话令牌认证,格式 `Bearer <sessionToken>` */
Authorization: string
/** 请求体内容类型,默认值 "application/json" */
Content-Type: string
}
{
"Authorization": "Bearer st_7c1f9e05b28d4a63",
"Content-Type": "application/json"
}
Body
| Name | Data Type | Required | Description |
| name | string | Yes | 组织名称 |
| description | string | No | 组织描述 |
type RequestBody = {
/** 组织名称 */
name: string
/** 组织描述 */
description?: string
}
{
"name": "Xeegam 上海",
"description": "Xeegam 上海研发团队"
}
Response
Body
| Name | Data Type | Required | Description |
| orgId | string | Yes | 组织 ID |
| name | string | Yes | 组织名称 |
| description | string | No | 组织描述 |
| ownerId | string | Yes | 所有者用户 ID |
| memberCount | number | Yes | 成员数 |
| createdAt | string | Yes | 创建时间(ISO 8601 UTC) |
type OrgDTO = {
/** 组织 ID */
orgId: string
/** 组织名称 */
name: string
/** 组织描述 */
description?: string
/** 所有者用户 ID */
ownerId: string
/** 成员数 */
memberCount: number
/** 创建时间(ISO 8601 UTC) */
createdAt: string
}
{
"orgId": "01JD8SRP1N4T8W6XQ5V9XDL2Y7K",
"name": "Xeegam 上海",
"description": "Xeegam 上海研发团队",
"ownerId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"memberCount": 12,
"createdAt": "2026-09-01T02:00:00Z"
}
HTTP Code
| HTTP Status |
Meaning |
Notes |
| 200 |
成功 |
返回新组织 |
Response Code
响应使用统一信封 {id, code, messages, result},其 code 字段:
| code |
Meaning |
Notes |
| 0 |
成功 |
返回新组织 |
Examples
POST /api/v1/orgs
Authorization: Bearer st_7c1f9e05b28d4a63
Content-Type: application/json
{
"name": "Xeegam 上海",
"description": "Xeegam 上海研发团队"
}
{
"id": "01JD8SRVBO0Z4B2DW",
"code": 0,
"messages": [],
"result": {
"orgId": "01JD8SRP1N4T8W6XQ5V9XDL2Y7K",
"name": "Xeegam 上海",
"description": "Xeegam 上海研发团队",
"ownerId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"memberCount": 1,
"createdAt": "2026-09-01T02:00:00Z"
}
}