NAME

OpenAPI::Client::OpenAI::Path::projects-project_id-users-user_id-roles - Documentation for the /projects/{project_id}/users/{user_id}/roles path.

OPERATIONS

GET /projects/{project_id}/users/{user_id}/roles

list-project-user-role-assignments

$client->list_project_user_role_assignments({
    body => { ... },
});

Lists the project roles assigned to a user within a project.

Path/query parameters

  • project_id (in path, required, string) - The ID of the project to inspect.

  • user_id (in path, required, string) - The ID of the user to inspect.

  • limit (in query, optional, integer) - A limit on the number of project role assignments to return.

  • after (in query, optional, string) - Cursor for pagination. Provide the value from the previous response's next field to continue listing project roles.

  • order (in query, optional, string) - Sort order for the returned project roles.

    Allowed values: asc, desc

Responses

200 - Project user 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 /projects/{project_id}/users/{user_id}/roles

assign-project-user-role

$client->assign_project_user_role({
    body => { ... },
});

Assigns a project role to a user within a project.

Path/query parameters

  • project_id (in path, required, string) - The ID of the project to update.

  • user_id (in path, required, string) - The ID of the user that should receive the project role.

Responses

200 - Project 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) - Always role .

    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 example api.organization or api.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, or null when there are no more assignments.

  • object (string, required) - Always list .

    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 user

  • id (string, required) - The identifier, which can be referenced in API endpoints

  • is_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 user

  • object (string, required) - The object type, which is always organization.user

    Allowed values: organization.user

  • projects (anyOf) - Projects associated with the user, if included.

  • role (anyOf) - owner or reader

  • technical_level (anyOf) - The technical level metadata for the user.

  • user (object) - Nested user details.

UserRoleAssignment

Properties:

  • object (string, required) - Always user.role .

    Allowed values: user.role

  • role (Role, required)

    See "Role" below for shape.

  • user (User, required)

    See "User" below for shape.

SEE ALSO

OpenAPI::Client::OpenAI::Path

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.