Skip to main content
POST
/
change_password
Change Password
curl --request POST \
  --url https://api.example.com/change_password \
  --header 'Content-Type: application/json' \
  --data '
{
  "url_code": "<string>",
  "old_url_pass": "<string>",
  "new_url_pass": "<string>"
}
'
{
  "message": "<string>"
}
This endpoint allows you to update the password for a protected short URL. You must provide the old password for verification before setting a new password.
This endpoint requires authentication. Include a valid Bearer token in the Authorization header.

Authentication

This endpoint uses HTTPBearer security. Include the access token obtained from the /login endpoint:
Authorization: Bearer <access_token>

Request Body

url_code
string
required
The short URL code whose password you want to change
old_url_pass
string
required
The current password for the short URL
new_url_pass
string
required
The new password to set. Must be between 3 and 20 characters in length.

Password Validation Rules

  • Password length must be between 3 and 20 characters
  • New password cannot be the same as the old password
  • Old password must match the current password for authentication

Response

message
string
Success message confirming the password change

Status Codes

  • 200: Password successfully changed
  • 400: Invalid request (new password same as old, or invalid password length)
  • 401: Invalid credentials (wrong old password or url_code mismatch)
  • 403: Invalid or expired token
curl -X POST https://api.example.com/change_password \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "url_code": "myshorturl",
    "old_url_pass": "oldpass123",
    "new_url_pass": "newpass456"
  }'

Build docs developers (and LLMs) love