Skip to main content

users

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

Overview​

Nameusers
TypeResource
Idopenai_admin.projects.users

Fields​

The following fields are returned by SELECT queries:

Project user retrieved successfully.

NameDatatypeDescription
idstringThe identifier, which can be referenced in API endpoints
namestringThe name of the user
added_atinteger (unixtime)The Unix timestamp (in seconds) of when the project was added.
emailstringThe email address of the user
objectstringThe object type, which is always organization.project.user (organization.project.user)
rolestringowner or member

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject_id, user_id
listselectproject_idlimit, after
createinsertproject_id, role
updateupdateproject_id, user_id
deletedeleteproject_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
project_idstringThe ID of the project.
user_idstringThe ID of the user.
afterstringA cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

SELECT examples​

Project user retrieved successfully.

SELECT
id,
name,
added_at,
email,
object,
role
FROM openai_admin.projects.users
WHERE project_id = '{{ project_id }}' -- required
AND user_id = '{{ user_id }}' -- required
;

INSERT examples​

No description available.

INSERT INTO openai_admin.projects.users (
user_id,
email,
role,
project_id
)
SELECT
'{{ user_id }}',
'{{ email }}',
'{{ role }}' /* required */,
'{{ project_id }}'
RETURNING
id,
name,
added_at,
email,
object,
role
;

UPDATE examples​

No description available.

UPDATE openai_admin.projects.users
SET
role = '{{ role }}'
WHERE
project_id = '{{ project_id }}' --required
AND user_id = '{{ user_id }}' --required
RETURNING
id,
name,
added_at,
email,
object,
role;

DELETE examples​

No description available.

DELETE FROM openai_admin.projects.users
WHERE project_id = '{{ project_id }}' --required
AND user_id = '{{ user_id }}' --required
;