PUT | Update a password
  • 2 minutes to read
  • Dark
    Light
  • PDF

PUT | Update a password

  • Dark
    Light
  • PDF

Article summary

Update a password in MySafe.

Requirements

  • Editing permission to the password in MySafe.

Request

POST api/mysafe/password/update/[identifier]

Request parameters

Send the parameter below in the path of the URL.



Send the parameters below in the request body.

  • name - string - Name of the password.


  • username - string - Username used to access the account.


  • password - string - The password that's being added.


  • url - string - URL of the website where the password is being used.


  • secret_key - string - The seed for the TOTP automatic generation.Note: must be encoded in base32.


  • notes - string - Additional password observations.


  • users_allowed - array of objects - Data of the users with password access.
    →username - string - Name of the user with password access permission.


    →can_edit - boolean - Editing permission.    Note: if left empty, users will have only viewing permission.


Attention

Users with can_edit = true permission can disable the password.


  • groups_allowed - array of objects - Data of the groups with password access.
    →name - string - Name of the group with password access permission.


    →can_edit - boolean - Editing permission.    Note: if left empty, group members will have only viewing permission.


Attention

Group members with can_edit = true permission can disable the password.

Example request

PUT api/mysafe/password/update/9

{
    "name": "senseg account",
    "url": "www.senhasegura.com",
    "username": "npass",
    "password": "8jhfy@3789",
    "secret_key": "JBSWY3DPEHPK3PXP",
    "notes": "Access details",
    "tags": "tag1, tag2",
    "users_allowed": [
        {
            "username" : "pduarte"
        }
    ],
    "groups_allowed": [
        {
            "name" : "Test group",
            "can_edit" : false
        }
    ]
}

Response

HTTP/1.1 200 OK
 {
    "code": 200,
    "response": {
        "status": 200,
        "message": "Password successfully updated",
        "error": false,
        "error_code": 0,
        "detail": "",
        "mensagem": "Password successfully updated",
        "erro": false,
        "cod_erro": 0
    },
    "password_entity": {
        "identifier": "312",
        "name": "senhasegura account",
        "url": "www.url.com",
        "username": "senhapass",
        "note": "Access details for this key.",
        "tags": "access",
        "users_allowed": [
            {
                "username": "pduarte",
                "can_edit": true
            }
        ],
        "groups_allowed": [
            {
                "name": "Test group",
                "can_edit": true
            }
        ],
        "shared_error": []
    }
}

Errors

400 - Bad Request.

Message: "1005: Password not found"

Possible cause: the password wasn't found.

Solution: check the value for the identifier and resend the request.

Message: "1006: User does not have access"

Possible cause: user isn't allowed to access this item.


500 - Internal Server Error.

Message: "Unexpected error."

Possible cause: the error is in the senhasegura server.

Solution: contact the support team for more information.


No route matched with those values.

Message: "You are not authorized to access this resource."

Possíveis causas: failure in your application authentication with the senhasegura server.

Solution: check the authentication parameters such as Access Token URL, Client ID and Client Secret and request a new access token or check and correct the URL.


An invalid response was received from the upstream server .

Message: "An invalid response was received from the a seupstream server

Possible cause: the upstream server may be taking too long to respond, leading to a timeout error that is interpreted as an invalid response by the proxy/gateway server.

Solution: check the connectivity between the source of the request and the senhasegura server.


The upstream server is timing out.

Message: "The upstream server is timing out"

Possible cause: the request time has expired.

Solution: check the connectivity between the source of the request and the senhasegura server.



Was this article helpful?