reset_user_password
PUT
/api/v1/admin/users/{id}/password
const url = 'https://example.com/api/v1/admin/users/1/password';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"password":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use std::str::FromStr;use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://example.com/api/v1/admin/users/1/password";
let payload = json!({"password": "example"});
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request PUT \ --url https://example.com/api/v1/admin/users/1/password \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "password": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer format: int64
User ID
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
Reset a user’s password (admin operation).
object
password
required
string
Examplegenerated
{ "password": "example"}Responses
Section titled “Responses”User password reset
Validation error
Unauthorized
Forbidden
User not found