Skip to main content

users

Creates, updates, deletes, gets or lists a users resource.

Overview​

Nameusers
TypeResource
Idopenai_admin.groups.users

Fields​

The following fields are returned by SELECT queries:

Group users listed successfully.

NameDatatypeDescription
idstringThe identifier, which can be referenced in API endpoints
namestringThe name of the user.
emailstringThe email address of the user.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectgroup_idlimit, after, order
addinsertgroup_id, user_id
removedeletegroup_id, user_id

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
group_idstringThe ID of the group to update.
user_idstringThe ID of the user to remove from the group.
afterstringA cursor for use in pagination. Provide the ID of the last user from the previous list response to retrieve the next page.
limitintegerA limit on the number of users to be returned. Limit can range between 0 and 1000, and the default is 100.
orderstringSpecifies the sort order of users in the list.

SELECT examples​

Group users listed successfully.

SELECT
id,
name,
email
FROM openai_admin.groups.users
WHERE group_id = '{{ group_id }}' -- required
AND limit = '{{ limit }}'
AND after = '{{ after }}'
AND order = '{{ order }}'
;

INSERT examples​

No description available.

INSERT INTO openai_admin.groups.users (
user_id,
group_id
)
SELECT
'{{ user_id }}' /* required */,
'{{ group_id }}'
RETURNING
group_id,
user_id,
object
;

DELETE examples​

No description available.

DELETE FROM openai_admin.groups.users
WHERE group_id = '{{ group_id }}' --required
AND user_id = '{{ user_id }}' --required
;