View Source OpenAi.Users (OpenAI REST API Client v1.0.0)

Provides API endpoints related to users

Summary

Functions

Deletes a user from the organization.

Lists all of the users in the organization.

Modifies a user's role in the organization.

Retrieves a user by their identifier.

Functions

Link to this function

delete_user(user_id, opts \\ [])

View Source
@spec delete_user(user_id :: String.t(), opts :: keyword()) ::
  {:ok, OpenAi.User.DeleteResponse.t()} | {:error, OpenAi.Error.error()}

Deletes a user from the organization.

@spec list_users(opts :: keyword()) ::
  {:ok, OpenAi.User.ListResponse.t()} | {:error, OpenAi.Error.error()}

Lists all of the users in the organization.

Options

  • limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • after: A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

  • emails: Filter by the email address of users.

Link to this function

modify_user(user_id, body, opts \\ [])

View Source
@spec modify_user(
  user_id :: String.t(),
  body :: OpenAi.User.Role.UpdateRequest.t(),
  opts :: keyword()
) :: {:ok, OpenAi.User.t()} | {:error, OpenAi.Error.error()}

Modifies a user's role in the organization.

Link to this function

retrieve_user(user_id, opts \\ [])

View Source
@spec retrieve_user(user_id :: String.t(), opts :: keyword()) ::
  {:ok, OpenAi.User.t()} | {:error, OpenAi.Error.error()}

Retrieves a user by their identifier.