Update Saved Password
curl --request PUT \
--url https://api.example.com/api/password-generator/view-all-saved-passwords/{pk}/update/ \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"password_saved": "<string>",
"url": "<string>",
"name_pages": "<string>"
}
'import requests
url = "https://api.example.com/api/password-generator/view-all-saved-passwords/{pk}/update/"
payload = {
"password_saved": "<string>",
"url": "<string>",
"name_pages": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({password_saved: '<string>', url: '<string>', name_pages: '<string>'})
};
fetch('https://api.example.com/api/password-generator/view-all-saved-passwords/{pk}/update/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/password-generator/view-all-saved-passwords/{pk}/update/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'password_saved' => '<string>',
'url' => '<string>',
'name_pages' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/password-generator/view-all-saved-passwords/{pk}/update/"
payload := strings.NewReader("{\n \"password_saved\": \"<string>\",\n \"url\": \"<string>\",\n \"name_pages\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/password-generator/view-all-saved-passwords/{pk}/update/")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"password_saved\": \"<string>\",\n \"url\": \"<string>\",\n \"name_pages\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/password-generator/view-all-saved-passwords/{pk}/update/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"password_saved\": \"<string>\",\n \"url\": \"<string>\",\n \"name_pages\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"url": ["Enter a valid URL."],
"password_saved": ["This field may not be blank."]
}
Saved Passwords
Update Saved Password
PUT
/
api
/
password-generator
/
view-all-saved-passwords
/
{pk}
/
update
/
Update Saved Password
curl --request PUT \
--url https://api.example.com/api/password-generator/view-all-saved-passwords/{pk}/update/ \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"password_saved": "<string>",
"url": "<string>",
"name_pages": "<string>"
}
'import requests
url = "https://api.example.com/api/password-generator/view-all-saved-passwords/{pk}/update/"
payload = {
"password_saved": "<string>",
"url": "<string>",
"name_pages": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({password_saved: '<string>', url: '<string>', name_pages: '<string>'})
};
fetch('https://api.example.com/api/password-generator/view-all-saved-passwords/{pk}/update/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/password-generator/view-all-saved-passwords/{pk}/update/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'password_saved' => '<string>',
'url' => '<string>',
'name_pages' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/password-generator/view-all-saved-passwords/{pk}/update/"
payload := strings.NewReader("{\n \"password_saved\": \"<string>\",\n \"url\": \"<string>\",\n \"name_pages\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/password-generator/view-all-saved-passwords/{pk}/update/")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"password_saved\": \"<string>\",\n \"url\": \"<string>\",\n \"name_pages\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/password-generator/view-all-saved-passwords/{pk}/update/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"password_saved\": \"<string>\",\n \"url\": \"<string>\",\n \"name_pages\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"url": ["Enter a valid URL."],
"password_saved": ["This field may not be blank."]
}
Updates an existing saved password. Users can only update their own passwords.
Endpoint
PUT /api/password-generator/view-all-saved-passwords/{pk}/update/
Authentication
string
required
Bearer token for authentication. User must be logged in.
Path Parameters
integer
required
The unique identifier (primary key) of the saved password to update.
Request Body
All fields are optional. Only include the fields you want to update (partial update).string
The updated password (max 200 characters).
string
The updated URL (max 200 characters).
string
The updated friendly name (max 200 characters).
Request Example
{
"password_saved": "NewSecureP@ss789",
"name_pages": "Updated Example Website"
}
Response
Success Response
200 OK
"data saved"
Error Responses
{
"url": ["Enter a valid URL."],
"password_saved": ["This field may not be blank."]
}
{
"error": "Password not found."
}
{
"error": "error message"
}
Authorization
Users can only update passwords they own. The endpoint automatically filters by the authenticated user, ensuring users cannot update other users’ passwords.Example Request
curl -X PUT https://api.example.com/api/password-generator/view-all-saved-passwords/1/update/ \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"password_saved": "NewSecureP@ss789",
"name_pages": "Updated Example Website"
}'
fetch('https://api.example.com/api/password-generator/view-all-saved-passwords/1/update/', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
password_saved: 'NewSecureP@ss789',
name_pages: 'Updated Example Website'
})
})
.then(response => response.json())
.then(data => console.log(data));
import requests
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
data = {
'password_saved': 'NewSecureP@ss789',
'name_pages': 'Updated Example Website'
}
response = requests.put(
'https://api.example.com/api/password-generator/view-all-saved-passwords/1/update/',
headers=headers,
json=data
)
print(response.json())
Implementation Details
This endpoint is implemented inviews.py:90 using the update_saved_password view function. It supports partial updates through the partial=True parameter in the serializer, meaning you only need to send the fields you want to update.⌘I
