How to Encrypt Credentials via API?

Hi,

I’m trying to create basic credentials through the API. I made a POST request to /rest/credentials with the following parameters:

  • name
  • type
  • nodesAccess

The credentials are getting created but when I try to open the credentials from the editor UI I get this error :

There was a problem loading the credentials:
*Credentials could not be decrypted. The reason is that probably a different "encryptionKey" got used to encrypt the data than now to decrypt it.* 

I also tried adding encryptionKey as a body parameter but that didn’t work. Also is there a possibility we could add the User, Password of that credential through this API Call ?

Thanks

Looking at the response it looks like the actual data is missing

Here an example that works fine for me:

1 Like

Cool, Now its working
Thanks @jan :grinning:

Great to hear! Have fun!