When i try to run the HTTP node with the api key in the body it works, but i prefer not to have the key exposed in the body, so i tried adding it in the credential section in my account, but i cant point to it in the body using {{$credential[‘SUMIT TEST’].value}} .. it simply doesnt work..
Yes defiantly! i didn’t think its an n8n issue.. so if i do want to use it as they provide.. what can i do to make sure its fully secured? any idea? @trungtlt
Works great.. the question is now.. if this is secured. because the only place to see these details are in the server.
I’ve asked chatGpt and he recommended to add N8N_ENCRYPTION_KEY to the environment, but when do that the site is going down and i get bad gateway.. i think something related to the encryption..
@Adeative_Media depend on your expected level of security, but at least above option allow you to not hard-coding company ID & API key in the n8n workflow JSON!
Space for improvement still there (with trade-off too), keep reviewing your system/need and improve it!
You’re right that keeping the API key in the body isn’t ideal. In n8n, credentials don’t automatically inject into the body — they work for headers, auth, etc. If the API requires it inside the body, the usual approach is:
Store your API key in a credential (or environment variable).
Then in the HTTP node body, reference it using expression mode like:
"APIKey": {{$credentials.SUMIT_TEST.APIKey}}
(make sure the name matches your credential property).
If the built-in credentials system doesn’t map directly, another safe option is to use environment variables and reference them in the body.