docs(admin): added missing updateUser api (#4846)

This commit is contained in:
Maxwell
2025-09-24 05:29:14 +10:00
committed by GitHub
parent fda18cadb3
commit c783ff45af
2 changed files with 38 additions and 0 deletions

View File

@@ -259,6 +259,29 @@ type setUserPassword = {
``` ```
</APIMethod> </APIMethod>
### Update user
Update a user's details.
<APIMethod
path="/admin/update-user"
method="POST"
requireSession
>
```ts
type adminUpdateUser = {
/**
* The user id which you want to update.
*/
userId: string = "user-id"
/**
* The data to update.
*/
data: Record<string, any> = { name: "John Doe" }
}
```
</APIMethod>
### Ban User ### Ban User
Bans a user, preventing them from signing in and revokes all of their existing sessions. Bans a user, preventing them from signing in and revokes all of their existing sessions.

View File

@@ -492,6 +492,21 @@ export const admin = <O extends AdminOptions>(options?: O) => {
}); });
}, },
), ),
/**
* ### Endpoint
*
* POST `/admin/update-user`
*
* ### API Methods
*
* **server:**
* `auth.api.adminUpdateUser`
*
* **client:**
* `authClient.admin.updateUser`
*
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-update-user)
*/
adminUpdateUser: createAuthEndpoint( adminUpdateUser: createAuthEndpoint(
"/admin/update-user", "/admin/update-user",
{ {