OpenAI 列出组织邀请

2026-11-17 18:25 更新

列出邀请

get /organization/invites

返回组织中的邀请列表。

查询参数

  • after: optional string

分页游标。after 是标记列表位置的对象 ID。例如,列表请求返回100个对象,最后一个为 obj_foo;后续调用可传入 after=obj_foo,以获取下一页。

  • limit: optional integer (default: 20)

返回的对象数量上限。取值范围为1至100,默认值为20。

返回值

  • data: array of Invite

  • id: string

标识符,可在 API 端点中引用。

  • created_at: integer

邀请发送时间的 Unix 时间戳,单位为秒。

format: unixtime

  • email: string

邀请接收者的电子邮件地址。

  • object: "organization.invite"

对象类型,固定为 organization.invite。

  • "organization.invite"

  • projects: array of object { id, role }

接受邀请时获授成员身份的项目。

  • id: string

项目的公开 ID。

  • role: "member" or "owner"

项目成员角色。

  • "member"

  • "owner"

  • role: "owner" or "reader"

owner(所有者)或 reader(读取者)。

  • "owner"

  • "reader"

  • status: "accepted" or "expired" or "pending"

accepted(已接受)、expired(已过期)或 pending(待接受)。

  • "accepted"

  • "expired"

  • "pending"

  • accepted_at: optional integer or null

邀请接受时间的 Unix 时间戳,单位为秒。

format: unixtime

  • expires_at: optional integer or null

邀请过期时间的 Unix 时间戳,单位为秒。

format: unixtime

  • has_more: boolean

has_more 属性用于分页,表示是否还有其他结果。

  • object: "list"

对象类型,固定为 list。

  • "list"

  • first_id: optional string or null

所获取 list 中的第一个 invite_id。

  • last_id: optional string or null

所获取 list 中的最后一个 invite_id。

示例

## 从环境变量读取管理员密钥;组织邀请ID和示例电子邮件地址应替换为实际值
curl https://api.openai.com/v1/organization/invites \
    -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

200 — 示例

以下 JSON 展示返回字段;字段名、对象类型、角色、状态和标识符按原文保留。

{
  "data": [
    {
      "id": "id",
      "created_at": 0,
      "email": "email",
      "object": "organization.invite",
      "projects": [
        {
          "id": "id",
          "role": "member"
        }
      ],
      "role": "owner",
      "status": "accepted",
      "accepted_at": 0,
      "expires_at": 0
    }
  ],
  "has_more": true,
  "object": "list",
  "first_id": "first_id",
  "last_id": "last_id"
}

示例

## 从环境变量读取管理员密钥;组织邀请ID和示例电子邮件地址应替换为实际值
curl "https://api.openai.com/v1/organization/invites?after=invite-abc&limit=20" \
  -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
  -H "Content-Type: application/json"

响应示例

以下为对应请求的响应示例。

{
  "object": "list",
  "data": [
    {
      "object": "organization.invite",
      "id": "invite-abc",
      "email": "user@example.com",
      "role": "owner",
      "status": "accepted",
      "created_at": 1711471533,
      "expires_at": 1711471533,
      "accepted_at": 1711471533,
      "projects": []
    }
  ],
  "first_id": "invite-abc",
  "last_id": "invite-abc",
  "has_more": false
}
以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号