NATSorganization.invitation.accept接受邀请加入组织
Try it 面板需要启用 JavaScript。
凭一次性令牌加入组织并授予指定角色;授予经 permission_service。
Request Payload
消息格式:JSON
| Name | Data Type | Required | Description |
|---|---|---|---|
| token | string | Yes | 邀请令牌 |
| userId | string | Yes | 接受者用户 ID |
type RequestBody = {
/** 邀请令牌 */
token: string
/** 接受者用户 ID */
userId: string
}{
"token": "inv_8a3d92f1c07b6e54",
"userId": "01JD8SRQ2N5U9W7YR6W0YEM3Z8L"
}Response Payload
回复使用统一信封 {id, code, messages, result},其 result:
| Name | Data Type | Required | Description |
|---|---|---|---|
| orgId | string | Yes | 加入的组织 ID |
| name | string | Yes | 组织名称 |
| joinedAt | string | Yes | 加入时间 |
type ResponseBody = {
/** 加入的组织 ID */
orgId: string
/** 组织名称 */
name: string
/** 加入时间 */
joinedAt: string
}{
"orgId": "01JD8SRP1N4T8W6XQ5V9XDL2Y7K",
"name": "Xeegam 上海",
"joinedAt": "2026-10-14T13:05:00Z"
}Response Code
回复使用统一信封 {id, code, messages, result},其 code 字段:
| code | Meaning | Notes |
|---|---|---|
| 0 | 成功 | 接受邀请加入组织 |
| 2502 | 令牌无效或已过期 | |
| 2503 | 令牌已被使用 | |
| 2504 | 用户已是成员 |
Examples
{ "token": "inv_8a3d92f1c07b6e54", "userId": "01JD8SRQ2N5U9W7YR6W0YEM3Z8L" }
{
"id": "01JD8SW8MX6Z3AW",
"code": 0,
"messages": [],
"result": {
"orgId": "01JD8SRP1N4T8W6XQ5V9XDL2Y7K",
"name": "Xeegam 上海",
"joinedAt": "2026-10-14T13:05:00Z"
}
}
Remarks
令牌不绑定被邀人——收到邀请的任何人凭令牌均可加入。