Javascript Reference v2.0

Delete a user

Delete a user. Requires a service_role key.

  • The deleteUser() method requires the user's ID, which maps to the auth.users.id column.
Parameters
    id
    REQUIRED
    string

    The user id you want to remove.

    shouldSoftDelete
    Optional
    boolean

    If true, then the user will be soft-deleted (setting deleted_at to the current timestamp and disabling their account while preserving their data) from the auth schema. Defaults to false for backward compatibility.

    This function should only be called on a server. Never expose your service_role key in the browser.


const { data, error } = await supabase.auth.admin.deleteUser(
  '715ed5db-f090-4b8c-a067-640ecee36aa0'
)