Create a password reset token for a user and reset the user’s password.
When a user’s password is reset, all of their active sessions are revoked.
Get the details of an existing password reset token that can be used to reset a user’s password.
JavaScript
| curl "https://api.workos.com/user_management/password_reset/password_reset_01E4ZCR3C56J083X43JQXF3JK5" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const passwordReset = await workos.userManagement.getPasswordReset( | |
| 'password_reset_01HYGDNK5G7FZ4YJFXYXPB5JRW', | |
| ); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.user_management.get_password_reset(id: "password_reset_01E4ZCR3C56J083X43JQXF3JK5") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.user_management.get_password_reset( | |
| id_="password_reset_01E4ZCR3C56J083X43JQXF3JK5" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.UserManagement().GetPasswordReset(context.Background(), "password_reset_01E4ZCR3C56J083X43JQXF3JK5") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->userManagement() | |
| ->getPasswordReset(id: "password_reset_01E4ZCR3C56J083X43JQXF3JK5"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.userManagement.getPasswordReset("password_reset_01E4ZCR3C56J083X43JQXF3JK5"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.UserManagement.GetPasswordResetAsync("password_reset_01E4ZCR3C56J083X43JQXF3JK5"); |
| use workos::Client; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .user_management() | |
| .get_password_reset("password_reset_01E4ZCR3C56J083X43JQXF3JK5") | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "password_reset", | |
| "id": "password_reset_01E4ZCR3C56J083X43JQXF3JK5", | |
| "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", | |
| "email": "marcelina.davis@example.com", | |
| "expires_at": "2026-01-15T12:00:00.000Z", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "password_reset_token": "Z1uX3RbwcIl5fIGJJJCXXisdI", | |
| "password_reset_url": "https://your-app.com/reset-password?token=Z1uX3RbwcIl5fIGJJJCXXisdI" | |
| } |
GET/user_management /password_reset /:id
Parameters
Returns
Creates a one-time token that can be used to reset a user’s password.
JavaScript
| curl --request POST \ | |
| --url "https://api.workos.com/user_management/password_reset" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "email": "marcelina.davis@example.com" | |
| } | |
| BODY |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const passwordReset = await workos.userManagement.createPasswordReset({ | |
| email: 'marcelina@example.com', | |
| }); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.user_management.reset_password(email: "marcelina.davis@example.com") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.user_management.reset_password(email="marcelina.davis@example.com") |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.UserManagement().ResetPassword(context.Background(), &workos.UserManagementResetPasswordParams{ | |
| Email: "marcelina.davis@example.com", | |
| }) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos->userManagement()->resetPassword(email: "marcelina.davis@example.com"); |
| import com.workos.WorkOS; | |
| import com.workos.usermanagement.UserManagementApi.ResetPasswordOptions; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| ResetPasswordOptions options = | |
| ResetPasswordOptions.builder().email("marcelina.davis@example.com").build(); | |
| workos.userManagement.resetPassword(options); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.UserManagement.ResetPasswordAsync(new UserManagementResetPasswordOptions { | |
| Email = "marcelina.davis@example.com", | |
| }); |
| use workos::Client; | |
| use workos::user_management::ResetPasswordParams; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .user_management() | |
| .reset_password( | |
| ResetPasswordParams { | |
| email: "marcelina.davis@example.com".into(), | |
| ..Default::default() | |
| } | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "password_reset", | |
| "id": "password_reset_01E4ZCR3C56J083X43JQXF3JK5", | |
| "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", | |
| "email": "marcelina.davis@example.com", | |
| "expires_at": "2026-01-15T12:00:00.000Z", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "password_reset_token": "Z1uX3RbwcIl5fIGJJJCXXisdI", | |
| "password_reset_url": "https://your-app.com/reset-password?token=Z1uX3RbwcIl5fIGJJJCXXisdI" | |
| } |
Sends email
POST/user_management /password_reset
Returns
Organization membership Continue to the next section
Up next