AdminApi

sealed interface AdminApi(source)

The admin interface for the supabase auth module. Service role access token is required. Import it via Auth.importAuthToken. Never share it publicly

Functions

Link copied to clipboard
abstract suspend fun createUserWithEmail(builder: AdminUserBuilder.Email.() -> Unit): UserInfo

Creates a new user using an email and password

Link copied to clipboard
abstract suspend fun createUserWithPhone(builder: AdminUserBuilder.Phone.() -> Unit): UserInfo

Creates a new user using a phone number and password

Link copied to clipboard
abstract suspend fun deleteFactor(uid: String, factorId: String)

Deletes a verified MFA factor of a user

Link copied to clipboard
abstract suspend fun deleteUser(uid: String)

Deletes a user by its id

Link copied to clipboard
inline suspend fun <C : LinkType.Config> AdminApi.generateLinkFor(linkType: LinkType<C>, redirectTo: String? = null, noinline config: C.() -> Unit): Pair<String, UserInfo>

Generates a link for linkType

Link copied to clipboard
abstract suspend fun inviteUserByEmail(email: String, redirectTo: String? = null, data: JsonObject? = null)

Invites a user by their email

Link copied to clipboard
open suspend fun logout(jwt: String, scope: SignOutScope = SignOutScope.LOCAL)

Removes a user session

Link copied to clipboard
abstract suspend fun retrieveFactors(uid: String): List<UserMfaFactor>

Retrieves all MFA factors of a user

Link copied to clipboard
abstract suspend fun retrieveUserById(uid: String): UserInfo

Retrieves a user by its id

Link copied to clipboard
abstract suspend fun retrieveUsers(page: Int? = null, perPage: Int? = null): List<UserInfo>

Retrieves all users

Link copied to clipboard
abstract suspend fun signOut(jwt: String, scope: SignOutScope = SignOutScope.LOCAL)

Removes a user session

Link copied to clipboard
abstract suspend fun updateUserById(uid: String, builder: AdminUserUpdateBuilder.() -> Unit): UserInfo

Updates a user by its id