Endpoint #
POST /wp-json/rtcl/v1/reset-password
Description #
This API allows a user to request a password reset email by providing a username or email address.
If the user exists and password reset is allowed, a reset link is sent to the user’s email.
Request Headers #
| Header | Required | Description |
|---|---|---|
Content-Type | ✅ Yes | application/json |
x-api-key | ✅ Yes | API key used for request authentication |
Request Body ParametersSend data as JSON. #
Parameters #
| Name | Type | Required | Description |
|---|---|---|---|
user_login | string | ✅ Yes | Username or email address |
Example Request #
JSON Body #
{
"user_login": "john@example.com"
}
cURL Example (With API Key) #
curl -X POST https://your-site.com/wp-json/rtcl/v1/reset-password \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-d '{
"user_login": "john@example.com"
}'
Success Response #
HTTP Status Code #
200 OK
Response Body #
{
"user_login": "john@example.com"
}
✔️ Indicates that the password reset email has been successfully sent.
Error Responses #
Missing user_login #
HTTP Status Code #
403 Forbidden
Response Body #
{
"status": "error",
"error": "FORBIDDEN",
"code": "403",
"error_message": "Username and password are required."
}
Invalid Username or Email #
HTTP Status Code #
403 Forbidden
Response Body #
{
"status": "error",
"error": "FORBIDDEN",
"code": "403",
"error_message": "Invalid username or email."
}
Password Reset Not Allowed #
HTTP Status Code #
403 Forbidden
Response Body #
{
"status": "error",
"error": "FORBIDDEN",
"code": "403",
"error_message": "Password reset is not allowed for this user"
}