'.. http:put:: /api/1/account/1
Edit an existing account.
**Example Request**:
.. sourcecode:: http
PUT /api/1/account/1 HTTP/1.1
Host: example.com
Accept: application/json
\'name\': \'edited_account\'
\'identifier\': \'0123456789\',
\'notes\': \'this account is for ...\',
\'active\': true,
\'third_party\': false
**Example Response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
\'name\': \'edited_account\'
\'identifier\': \'0123456789\',
\'notes\': \'this account is for ...\',
\'active\': true,
\'third_party\': false
\'account_type\': \'AWS\'
:statuscode 200: no error
:statuscode 401: Authentication Error. Please Login.'

def put(self, account_id):

    args = json.loads(request.json)
    account_type = args['account_type']
    name = args['name']
    identifier = args['identifier']
    notes = args['notes']
    active = args['active']
    third_party = args['third_party']
    custom_fields = args['custom_fields']
    from security_monkey.account_manager import account_registry
    account_manager = account_registry.get(account_type)()
    try:
        account = account_manager.update(account_id, account_type, name, active, third_party, notes, identifier, custom_fields=custom_fields)
    except AccountNameExists as _:
        return ({'status': 'error.    Account    name    exists.'}, 409)
    if (not account):
        return ({'status': 'error.    Account    ID    not    found.'}, 404)
    from security_monkey.common.audit_issue_cleanup import clean_account_issues
    clean_account_issues(account)
    marshaled_account = marshal(account.__dict__, ACCOUNT_FIELDS)
    marshaled_account['auth'] = self.auth_dict
    return (marshaled_account, 200)
