ExBifrost.Api.Users (ex_bifrost v0.1.0)

Copy Markdown View Source

API calls for all endpoints tagged Users.

Summary

Functions

Assign role to user Assigns an RBAC role to a user. This also auto-assigns the default access profile for the new role and reloads the RBAC permission cache.

Create user Manually creates a new user in the organization.

Delete user Permanently removes a user from the organization. This cascades to delete the user's governance settings (budget/rate limits), team memberships, access profiles, and OIDC sessions. Cannot delete yourself.

Get current user permissions Returns the RBAC permissions for the authenticated user. When SCIM is not enabled, returns full permissions for all resources. Otherwise returns the permissions associated with the user's assigned role.

Get user's teams Returns the list of teams a user belongs to, including the membership source.

Get user's virtual keys by email Enterprise only. Returns all virtual keys associated with a user, looked up by email address. Returns an empty virtual_keys array when the user exists but has no virtual keys assigned. Intended for MDM and credential-helper integrations that need to resolve a user's keys without knowing their internal ID.

List users Returns a paginated list of users with optional search.

Update user's team assignments Replaces the user's manual team assignments. Synced team memberships (from SCIM providers) are preserved and cannot be removed via this endpoint.

Functions

assign_user_role(connection, id, assign_user_role_request, opts \\ [])

Assign role to user Assigns an RBAC role to a user. This also auto-assigns the default access profile for the new role and reloads the RBAC permission cache.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • id (String.t): User ID
  • assign_user_role_request (AssignUserRoleRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.MessageResponse.t} on success
  • {:error, Tesla.Env.t} on failure

create_user(connection, create_user_request, opts \\ [])

Create user Manually creates a new user in the organization.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • create_user_request (CreateUserRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.CreateUser200Response.t} on success
  • {:error, Tesla.Env.t} on failure

delete_user(connection, id, opts \\ [])

Delete user Permanently removes a user from the organization. This cascades to delete the user's governance settings (budget/rate limits), team memberships, access profiles, and OIDC sessions. Cannot delete yourself.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • id (String.t): User ID
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.MessageResponse.t} on success
  • {:error, Tesla.Env.t} on failure

get_current_user_permissions(connection, opts \\ [])

Get current user permissions Returns the RBAC permissions for the authenticated user. When SCIM is not enabled, returns full permissions for all resources. Otherwise returns the permissions associated with the user's assigned role.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.GetCurrentUserPermissions200Response.t} on success
  • {:error, Tesla.Env.t} on failure

get_user_teams(connection, id, opts \\ [])

Get user's teams Returns the list of teams a user belongs to, including the membership source.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • id (String.t): User ID
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.GetUserTeams200Response.t} on success
  • {:error, Tesla.Env.t} on failure

get_user_virtual_keys_by_email(connection, email, opts \\ [])

Get user's virtual keys by email Enterprise only. Returns all virtual keys associated with a user, looked up by email address. Returns an empty virtual_keys array when the user exists but has no virtual keys assigned. Intended for MDM and credential-helper integrations that need to resolve a user's keys without knowing their internal ID.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • email (String.t): URL-encoded email address of the user
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.GetUserVirtualKeysByEmail200Response.t} on success
  • {:error, Tesla.Env.t} on failure

list_users(connection, opts \\ [])

@spec list_users(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, ExBifrost.Model.BifrostError.t()}
  | {:ok, ExBifrost.Model.ListUsers200Response.t()}
  | {:error, Tesla.Env.t()}

List users Returns a paginated list of users with optional search.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :page (integer()): Page number (1-based)
    • :limit (integer()): Number of users per page (max 100)
    • :search (String.t): Search by name or email

Returns

  • {:ok, ExBifrost.Model.ListUsers200Response.t} on success
  • {:error, Tesla.Env.t} on failure

update_user_teams(connection, id, update_user_teams_request, opts \\ [])

Update user's team assignments Replaces the user's manual team assignments. Synced team memberships (from SCIM providers) are preserved and cannot be removed via this endpoint.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • id (String.t): User ID
  • update_user_teams_request (UpdateUserTeamsRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.MessageResponse.t} on success
  • {:error, Tesla.Env.t} on failure