LogoLogo
  • Welcome to OneAuxilia Docx
  • UI Component
    • Overview
    • <OneAuxiliaProvider>
    • Authentication Components
      • <SignIn />
      • <SignUp />
      • <GoogleOneTap />
    • User Components
      • <UserButton />
      • <UserProfile />
    • Organization Components
      • <CreateOrganization />
      • <OrganizationProfile />
      • <OrganizationSwitcher />
      • <OrganizationList />
    • Control Components
      • <AuthenticateWithRedirectCallback />
      • <OneAuxiliaLoaded>
      • <OneAuxiliaLoading>
      • <Protect>
      • <MultisessionAppSupport>
      • <RedirectToSignIn />
      • <RedirectToSignUp />
      • <RedirectToUserProfile />
      • <RedirectToOrganizationProfile />
      • <RedirectToCreateOrganization />
      • <SignedIn>
      • <SignedOut>
    • Unstyled Components
      • <SignInButton>
      • <SignInWithMetamaskButton>
      • <SignUpButton>
      • <SignOutButton>
  • Quick Start
  • Users
    • Overview
    • Metadata
    • Delete User
  • Organization
    • Organization, Role and Permission
      • Overview
      • Role and Permission
      • Guides
        • Create Role and assign Permission
        • Verify the active user's permission
        • Reassign the Creator role
      • Building custom flow
    • Multi Tenant Setting
  • Application
    • Application
    • User Portal
  • Authentication
    • Setting
    • Social Connectors
    • Multi Factor
  • Customize
    • Branding
    • Sign Up vs Sign In
      • Overview
      • Configuration
        • Sign-up and Sign-in options
        • Session Option
        • Email and SMS templates
      • Social Connection
        • Overview
        • Social connections (OAuth)
        • Account Linking
        • Setup Social Account Linking
  • Development
    • API Key
    • Local Path
    • Custom JWT templates
    • Domain
    • Webhook
    • Backend Request
      • Overview
      • Making requests
        • Same-origin requests
        • Cross-origin requests
        • Customize your session token
      • Handling requests
        • Manual JWT verification
      • Session Management
  • SDK References
    • React
      • Overview
      • Guides
        • Add React Router
      • Client-side Helpers
        • useUser()
        • useOneAuxilia()
        • useAuth()
        • useSignIn()
        • useSignUp()
        • useSession()
        • useSessionList()
        • useOrganization()
        • useOrganizationList()
  • API References
    • Open API
  • industry reference
    • Ecommerce
    • Broadcasting
    • IoT
Powered by GitBook
On this page
  • Delete users in the OneAuxilia Dashboard
  • Delete users using the OneAuxilia API
  1. Users

Delete User

There are two ways to delete users in OneAuxilia: through the OneAuxilia Dashboard or using the OneAuxilia API.

Delete users in the OneAuxilia Dashboard

To delete users in the OneAuxilia Dashboard:

  1. Navigate to the OneAuxilia Dashboard.

  2. In the navigation sidebar, select Users.

  3. You can either select the user and then in the side navigation menu, select Delete user, or select the menu icon on the right side of the user's row and select Delete user.

Delete users using the OneAuxilia API

To delete users using the OneAuxilia API, you can use the deleteUser() method from the users sub-api of the OneAuxiliaClient instance.

import { auth, oneAuxiliaClient } from "@oneauxilia/nextjs/server";
import { NextResponse } from 'next/server';

export async function DELETE() {
  const { userId } = auth();

  try {
    await oneAuxiliaClient.users.deleteUser(userId);
    return NextResponse.json({ message: 'User deleted' });
  }
  catch (error) {
    console.log(error);
    return NextResponse.json({ error: 'Error deleting user' });
  }
}
import { oneAuxiliaClient } from "@oneauxilia/oneauxilia-sdk-node";

app.post('/deleteUser', (req, res) => {
  const userId = req.body.userId;

  try {
    await oneAuxiliaClient.users.deleteUser(userId);
    return res.status(200).json({ message: 'User deleted' });
  }
  catch (error) {
    console.log(error);
    return res.status(500).json({ error: 'Error deleting user' });
  }
});
curl -XDELETE -H 'Authorization: ONEAUXILIA_SECRET_KEY' 'https://api.oneauxilia.tech/v1/users/{user_id}'
PreviousMetadataNextOrganization, Role and Permission

Last updated 10 months ago