Need recomendation in programatically updating External User Directory

I need to programmatically update only the field ldap.password on an existing External Directory. What is recommended option, Do i need to write plugin using REST-API, or can i just use simple REST-API URL and update and test ?

Using the REST API Browser I identified and executed related to this requirement (I tried http://jiraserver/rest/directorymanagement/1/directory/testldap/10100 with the actual value (instead of test example) for the body {“URL”:“ldap://localhost:389/”,“baseDN”:“dc=test,dc=com”,“ldapPassword”:“admin”,“secure”:false,“userDN”:“cn=admin,dc=test,dc=com”,“connector”:“com.atlassian.crowd.directory.MicrosoftActiveDirectory”,“referral”:true} and get Bad Request Error 400.

Could you also point me the correct POST , GET urls for updating and testing a specific Directory id

Can you please suggest whats recommended.