How to authenticate for REST API with Users management activated?

So here the explanation.

First step : login
Create a REQUEST Node.

  • Authentication : None
  • Request Method : POST
  • URL : YOUR_URL/rest/login
  • Add Option “Full Response” (do not forget to put it at true)
  • Add 2 body parameters :
    • Name : email, value : the email of the account
    • Name : password, value : the password of the account

Next steps : authenticate your requests
In the next steps requesting your n8n server, add a header parameter :

  • Name : Cookie (with upper C)
  • Value : From the node Authentication, Output Data, JSON, header, set-cookie as Raw value (click on the grey circle next to set-cookie)

Example
To finish, here the JSON to export your workflows in an array.
Please, note you should modify CHANGE_WITH_YOUR_URL, CHANGE_WITH_YOUR_EMAIL and CHANGE_WITH_YOUR_PASSWORD

6 Likes