PATCH/api/v1/orgs/:orgId更新组织
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"
}
URL Parameters
| Name |
Data Type |
Description |
| orgId |
string |
组织 ID |
Body
| Name | Data Type | Required | Description |
| name | string | No | 组织名称 |
| description | string | No | 组织描述 |
type RequestBody = {
/** 组织名称 */
name?: string
/** 组织描述 */
description?: string
}
{
"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 |
成功 |
返回更新后的组织 |
| 403 |
无权操作 |
仅所有者或组织管理角色可更新 |
Response Code
响应使用统一信封 {id, code, messages, result},其 code 字段:
| code |
Meaning |
Notes |
| 0 |
成功 |
返回更新后的组织 |
| 2501 |
无权操作组织 |
当前用户不是所有者且不持有组织管理角色 |
Examples
PATCH /api/v1/orgs/01JD8SRP1N4T8W6XQ5V9XDL2Y7K
Authorization: Bearer st_7c1f9e05b28d4a63
Content-Type: application/json
{
"description": "Xeegam 上海研发中心"
}
{
"id": "01JD8SRXDQ2B6D4FY",
"code": 0,
"messages": [],
"result": {
"orgId": "01JD8SRP1N4T8W6XQ5V9XDL2Y7K",
"name": "Xeegam 上海",
"description": "Xeegam 上海研发中心",
"ownerId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"memberCount": 12,
"createdAt": "2026-09-01T02:00:00Z"
}
}