NATSorganization.org.create创建组织
Try it 面板需要启用 JavaScript。
创建组织;创建者自动成为所有者成员。
Request Payload
消息格式:JSON
| Name | Data Type | Required | Description |
|---|---|---|---|
| userId | string | Yes | 创建者用户 ID |
| name | string | Yes | 组织名称 |
| description | string | No | 组织描述 |
type RequestBody = {
/** 创建者用户 ID */
userId: string
/** 组织名称 */
name: string
/** 组织描述 */
description?: string
}{
"userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"name": "Xeegam 上海",
"description": "Xeegam 上海研发团队"
}Response Payload
回复使用统一信封 {id, code, messages, result},其 result:
| Name | Data Type | Required | Description |
|---|---|---|---|
| orgId | string | Yes | 组织 ID |
| name | string | Yes | 组织名称 |
| ownerId | string | Yes | 所有者用户 ID |
| memberCount | number | Yes | 成员数(固定 1) |
| createdAt | string | Yes | 创建时间 |
type ResponseBody = {
/** 组织 ID */
orgId: string
/** 组织名称 */
name: string
/** 所有者用户 ID */
ownerId: string
/** 成员数(固定 1) */
memberCount: number
/** 创建时间 */
createdAt: string
}{
"orgId": "01JD8SRP1N4T8W6XQ5V9XDL2Y7K",
"name": "Xeegam 上海",
"ownerId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"memberCount": 1,
"createdAt": "2026-09-01T02:00:00Z"
}Response Code
回复使用统一信封 {id, code, messages, result},其 code 字段:
| code | Meaning | Notes |
|---|---|---|
| 0 | 成功 | 创建组织 |
Examples
{ "userId": "01JD8SEGQ0P9N2XK4L7VDH3T6C", "name": "Xeegam 上海", "description": "Xeegam 上海研发团队" }
{
"id": "01JD8SVUY6J2L9MI",
"code": 0,
"messages": [],
"result": {
"orgId": "01JD8SRP1N4T8W6XQ5V9XDL2Y7K",
"name": "Xeegam 上海",
"ownerId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"memberCount": 1,
"createdAt": "2026-09-01T02:00:00Z"
}
}