Create invite
admin.organization.invites.create(**kwargs) -> Invite { id, created_at, email, 6 more }
POST/organization/invites
Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization.
Create invite
require "openai"
openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")
invite = openai.admin.organization.invites.create(email: "email", role: :reader)
puts(invite){
"object": "organization.invite",
"id": "invite-def",
"email": "anotheruser@example.com",
"role": "reader",
"status": "pending",
"created_at": 1711471533,
"expires_at": 1711471533,
"accepted_at": null,
"projects": [
{
"id": "project-xyz",
"role": "member"
},
{
"id": "project-abc",
"role": "owner"
}
]
}
Returns Examples
{
"object": "organization.invite",
"id": "invite-def",
"email": "anotheruser@example.com",
"role": "reader",
"status": "pending",
"created_at": 1711471533,
"expires_at": 1711471533,
"accepted_at": null,
"projects": [
{
"id": "project-xyz",
"role": "member"
},
{
"id": "project-abc",
"role": "owner"
}
]
}