NAME
OpenAPI::Client::OpenAI::Path::organization-users-user_id-roles - Documentation for the /organization/users/{user_id}/roles path.
OPERATIONS
GET /organization/users/{user_id}/roles
list-user-role-assignments
$client->list_user_role_assignments({
body => { ... },
});
Lists the organization roles assigned to a user within the organization.
Path/query parameters
user_id(in path, required, string) - The ID of the user to inspect.limit(in query, optional, integer) - A limit on the number of organization role assignments to return.after(in query, optional, string) - Cursor for pagination. Provide the value from the previous response'snextfield to continue listing organization roles.order(in query, optional, string) - Sort order for the returned organization roles.Allowed values: asc, desc
Responses
200 - User organization role assignments listed successfully.
Content-Type: application/json
Example:
{
"data" : [
{
"assignment_sources" : null,
"created_at" : 1711471533,
"created_by" : "user_abc123",
"created_by_user_obj" : {
"email" : "ada@example.com",
"id" : "user_abc123",
"name" : "Ada Lovelace"
},
"description" : "Allows managing organization groups",
"id" : "role_01J1F8ROLE01",
"metadata" : {},
"name" : "API Group Manager",
"permissions" : [
"api.groups.read",
"api.groups.write"
],
"predefined_role" : false,
"resource_type" : "api.organization",
"updated_at" : 1711472599
}
],
"has_more" : false,
"next" : null,
"object" : "list"
}
POST /organization/users/{user_id}/roles
assign-user-role
$client->assign_user_role({
body => { ... },
});
Assigns an organization role to a user within the organization.
Path/query parameters
user_id(in path, required, string) - The ID of the user that should receive the organization role.
Responses
200 - Organization role assigned to the user successfully.
Content-Type: application/json
Example:
{
"object" : "user.role",
"role" : {
"description" : "Allows managing organization groups",
"id" : "role_01J1F8ROLE01",
"name" : "API Group Manager",
"object" : "role",
"permissions" : [
"api.groups.read",
"api.groups.write"
],
"predefined_role" : false,
"resource_type" : "api.organization"
},
"user" : {
"added_at" : 1711470000,
"email" : "ada@example.com",
"id" : "user_abc123",
"name" : "Ada Lovelace",
"object" : "organization.user",
"role" : "owner"
}
}
SCHEMAS
AssignedRoleDetails
Properties:
assignment_sources(anyOf, required) - Principals from which the role assignment is inherited, when available.created_at(anyOf, required) - When the role was created.created_by(anyOf, required) - Identifier of the actor who created the role.created_by_user_obj(anyOf, required) - User details for the actor that created the role, when available.description(anyOf, required) - Description of the role.id(string, required) - Identifier for the role.metadata(anyOf, required) - Arbitrary metadata stored on the role.name(string, required) - Name of the role.permissions(array of string, required) - Permissions associated with the role.predefined_role(boolean, required) - Whether the role is predefined by OpenAI.resource_type(string, required) - Resource type the role applies to.updated_at(anyOf, required) - When the role was last updated.
PublicAssignOrganizationGroupRoleBody
Properties:
role_id(string, required) - Identifier of the role to assign.
Role
Properties:
description(anyOf, required) - Optional description of the role.id(string, required) - Identifier for the role.name(string, required) - Unique name for the role.object(string, required) - Alwaysrole.Allowed values: role
permissions(array of string, required) - Permissions granted by the role.predefined_role(boolean, required) - Whether the role is predefined and managed by OpenAI.resource_type(string, required) - Resource type the role is bound to (for exampleapi.organizationorapi.project).
RoleListResource
Properties:
data(array of AssignedRoleDetails, required) - Role assignments returned in the current page.has_more(boolean, required) - Whether additional assignments are available when paginating.next(anyOf, required) - Cursor to fetch the next page of results, ornullwhen there are no more assignments.object(string, required) - Alwayslist.Allowed values: list
User
Properties:
added_at(integer, required) - The Unix timestamp (in seconds) of when the user was added.api_key_last_used_at(anyOf) - The Unix timestamp (in seconds) of the user's last API key usage.created(integer) - The Unix timestamp (in seconds) of when the user was created.developer_persona(anyOf) - The developer persona metadata for the user.email(anyOf) - The email address of the userid(string, required) - The identifier, which can be referenced in API endpointsis_default(boolean) - Whether this is the organization's default user.is_scale_tier_authorized_purchaser(anyOf) - Whether the user is an authorized purchaser for Scale Tier.is_scim_managed(boolean) - Whether the user is managed through SCIM.is_service_account(boolean) - Whether the user is a service account.name(anyOf) - The name of the userobject(string, required) - The object type, which is alwaysorganization.userAllowed values: organization.user
projects(anyOf) - Projects associated with the user, if included.role(anyOf) -ownerorreadertechnical_level(anyOf) - The technical level metadata for the user.user(object) - Nested user details.
UserRoleAssignment
Properties:
object(string, required) - Alwaysuser.role.Allowed values: user.role
role(Role, required)See "Role" below for shape.
user(User, required)See "User" below for shape.
SEE ALSO
COPYRIGHT AND LICENSE
Copyright (C) 2023-2026 by Nelson Ferraz
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.0 or, at your option, any later version of Perl 5 you may have available.