Skip to main content

groups

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

Overview

Namegroups
TypeResource
Idopenai_admin.projects.groups

Fields

The following fields are returned by SELECT queries:

Project groups listed successfully.

NameDatatypeDescription
group_idstringIdentifier of the group that has access to the project.
project_idstringIdentifier of the project.
group_namestringDisplay name of the group.
created_atinteger (unixtime)Unix timestamp (in seconds) when the group was granted project access.
group_typestringThe type of the group.
objectstringAlways project.group. (project.group)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectproject_idlimit, after, order
addinsertproject_id, group_id, role
removedeleteproject_id, group_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 remove from the project.
project_idstringThe ID of the project to update.
afterstringCursor for pagination. Provide the ID of the last group from the previous response to fetch the next page.
limitintegerA limit on the number of project groups to return. Defaults to 20.
orderstringSort order for the returned groups.

SELECT examples

Project groups listed successfully.

SELECT
group_id,
project_id,
group_name,
created_at,
group_type,
object
FROM openai_admin.projects.groups
WHERE project_id = '{{ project_id }}' -- required
AND limit = '{{ limit }}'
AND after = '{{ after }}'
AND order = '{{ order }}'
;

INSERT examples

No description available.

INSERT INTO openai_admin.projects.groups (
group_id,
role,
project_id
)
SELECT
'{{ group_id }}' /* required */,
'{{ role }}' /* required */,
'{{ project_id }}'
RETURNING
group_id,
project_id,
group_name,
created_at,
group_type,
object
;

DELETE examples

No description available.

DELETE FROM openai_admin.projects.groups
WHERE project_id = '{{ project_id }}' --required
AND group_id = '{{ group_id }}' --required
;