跳转到内容
Rayrun
登录注册

组织与成员

成员邀请与用户管理。 完整参数、请求 / 响应 schema 见下方(本页只渲染该组):

v0.1.0
OpenAPI 3.0.3

Rayrun API

Rayrun REST API —— 控制台与命令行(rayrun CLI)的统一接口,也是自托管部署的 第三方集成的接入点。共 13 组、93 个端点(分组见左侧栏或「介绍」页的接口一览)。 基地址与部署同源:<实例地址>/v1(如 https://rayrun.example.com/v1)。 认证:Bearer Token(控制台「设置 → 我的 API Token」或 rayrun login 创建) 或浏览器会话 Cookie;GET /health 免认证。详见「介绍」页的认证一节。

Server:https://api.rayrunos.com/v1

Rayrun 托管平台

Client Libraries

组织与成员

​

创建邀请(owner:可指定 admin/developer;admin:仅 developer, 角色矩阵)

​

Body·

required
application/json
  • 邀请不能造 owner;admin 邀请者仅可指定 developer

  • 被邀请人;此刻必须尚未注册(已被占用 → 409)

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/invitations
curl https://api.rayrunos.com/v1/invitations \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "username": "",
  "role": "admin"
}'
{
  "invitation_id": "123e4567-e89b-12d3-a456-426614174000",
  "token": "string",
  "url": "string",
  "role": "admin",
  "expires_at": "2026-11-11T06:00:17.727Z"
}

列出本组织邀请(含状态;永不回显 token)

​

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for get/invitations
curl https://api.rayrunos.com/v1/invitations \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "invitations": [
    {
      "invitation_id": "123e4567-e89b-12d3-a456-426614174000",
      "username": "string",
      "role": "admin",
      "created_by": "string",
      "created_at": "2026-11-11T06:00:17.727Z",
      "expires_at": "2026-11-11T06:00:17.727Z",
      "accepted_at": null,
      "revoked_at": null
    }
  ]
}

撤销邀请(软撤销置 revoked_at;已接受的不可撤销)

​

Path Parameters

  • invitation_id(UUIDv7)

Responses

  • 已撤销

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for delete/invitations/{id}
curl https://api.rayrunos.com/v1/invitations/123e4567-e89b-12d3-a456-426614174000 \
  --request DELETE \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
No Body

列出成员(owner/admin 看本组织全部成员;平台管理员可带 tenant_id 查任意组织或 all=true 看全量;developer → 403)

​

Query Parameters

  • 仅平台管理员可用:查指定组织的成员

  • 平台管理员专用:all=true 返回全库用户(管理台视图), 每行带 tenant_id 与 platform_admin。与 tenant_id 互斥(同传 → 400)。 注意:响应形状与成员列表不同(多 platform_admin / disabled_at,缺 password_hash —— 两者都不含 password_hash)。

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for get/users
curl 'https://api.rayrunos.com/v1/users?all=true' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "users": [
    {
      "user_id": "string",
      "tenant_id": "string",
      "username": "string",
      "display_name": "string",
      "role": "owner",
      "disabled_at": null,
      "created_at": "2026-11-11T06:00:17.727Z"
    }
  ]
}

重置成员密码(operator 任意组织 / owner 限本组织成员;不验旧密码)

​

Path Parameters

  • 目标成员 user_id

Body·

required
application/json

Responses

  • 已重置(无回显)

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/users/{user_id}/password
curl 'https://api.rayrunos.com/v1/users/{user_id}/password' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "password": ""
}'
No Body

改成员角色(owner-only;「赋予 members 权限」的落点)

​

Path Parameters

  • 目标成员 user_id(必须在本组织,否则 404)

Body·

required
application/json

PATCH /v1/users/{user_id} 请求

  • 不能改成 owner(owner 唯一且不可移交)

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for patch/users/{user_id}
curl 'https://api.rayrunos.com/v1/users/{user_id}' \
  --request PATCH \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "role": "admin"
}'
{
  "user_id": "string",
  "tenant_id": "string",
  "username": "string",
  "display_name": "string",
  "role": "owner",
  "disabled_at": null,
  "created_at": "2026-11-11T06:00:17.727Z"
}

Models