Skip to main content

group_role_assignments

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

Overview

Namegroup_role_assignments
TypeResource
Idopenai_admin.projects.group_role_assignments

Fields

The following fields are returned by SELECT queries:

Project group role assignments listed successfully.

NameDatatypeDescription
idstringIdentifier for the role.
namestringName of the role.
created_atinteger (unixtime)When the role was created.
created_bystringIdentifier of the actor who created the role.
created_by_user_objobjectUser details for the actor that created the role, when available.
descriptionstringDescription of the role.
metadataobjectArbitrary metadata stored on the role.
permissionsarrayPermissions associated with the role.
predefined_rolebooleanWhether the role is predefined by OpenAI.
resource_typestringResource type the role applies to.
updated_atinteger (int64)When the role was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectproject_id, group_idlimit, after, order
assigninsertproject_id, group_id, role_id
unassigndeleteproject_id, group_id, role_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 whose project role assignment should be removed.
project_idstringThe ID of the project to modify.
role_idstringThe ID of the project role to remove from the group.
afterstringCursor for pagination. Provide the value from the previous response's next field to continue listing project roles.
limitintegerA limit on the number of project role assignments to return.
orderstringSort order for the returned project roles.

SELECT examples

Project group role assignments listed successfully.

SELECT
id,
name,
created_at,
created_by,
created_by_user_obj,
description,
metadata,
permissions,
predefined_role,
resource_type,
updated_at
FROM openai_admin.projects.group_role_assignments
WHERE project_id = '{{ project_id }}' -- required
AND group_id = '{{ group_id }}' -- required
AND limit = '{{ limit }}'
AND after = '{{ after }}'
AND order = '{{ order }}'
;

INSERT examples

No description available.

INSERT INTO openai_admin.projects.group_role_assignments (
role_id,
project_id,
group_id
)
SELECT
'{{ role_id }}' /* required */,
'{{ project_id }}',
'{{ group_id }}'
RETURNING
group,
object,
role
;

DELETE examples

No description available.

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