# Import Flows using API

**URL:** <https://discourse.nodered.org/t/import-flows-using-api/40355>\
**Category:** General\
**Created:** [4 February 2021 05:37 UTC](https://discourse.nodered.org/t/import-flows-using-api/40355 "2021-02-04T05:37:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henjoe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henjoe/32/52335_2.png) [@Henjoe](https://discourse.nodered.org/u/Henjoe)\
**Post date:** [4 February 2021 05:37 UTC](https://discourse.nodered.org/t/import-flows-using-api/40355/1 "2021-02-04T05:37:19Z")

</div>

Hi Node-red Experts,  
I know there is an API for node-red, but I am not sure if can we import flows using it's API?  
I don't want my end-user to login on my node-red and go to Menu -\> Import Flows, but instead, I want to create a custom application where we can automatically import flows without doing it manually.

Hoping for your guidance.

Thank you.

With kind regards,  
Henjoe

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [4 February 2021 09:08 UTC](https://discourse.nodered.org/t/import-flows-using-api/40355/2 "2021-02-04T09:08:20Z")

</div>

Hi @Henjoe

the runtime provides an API that lets you add/update individual flows (ie tabs) - [POST /flow : Node-RED](https://nodered.org/docs/api/admin/methods/post/flow/)

---

<div class="post-metadata">

**Author:** ![Henjoe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henjoe/32/52335_2.png) [@Henjoe](https://discourse.nodered.org/u/Henjoe)\
**Post date:** [4 February 2021 12:04 UTC](https://discourse.nodered.org/t/import-flows-using-api/40355/3 "2021-02-04T12:04:10Z")

</div>

Hi Knolleary,

Thank you for this.  
But I don't know what I am doing wrong in here, I am trying to get an access token via postman.

But I am getting an "authentication error". Any thoughts?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/0/d03662db757bcd1c4e54049b7140459756b03ed8.png)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [4 February 2021 12:34 UTC](https://discourse.nodered.org/t/import-flows-using-api/40355/4 "2021-02-04T12:34:17Z")

</div>

Don't make that request using Basic Auth

---

<div class="post-metadata">

**Author:** ![Henjoe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/henjoe/32/52335_2.png) [@Henjoe](https://discourse.nodered.org/u/Henjoe)\
**Post date:** [19 February 2021 00:09 UTC](https://discourse.nodered.org/t/import-flows-using-api/40355/5 "2021-02-19T00:09:32Z")

</div>

Hi knolleary,

What type of auth should I use in here?

Thanks for supporting. I highly appreciated it.

With kind regards,  
Henjoe

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [19 February 2021 00:22 UTC](https://discourse.nodered.org/t/import-flows-using-api/40355/6 "2021-02-19T00:22:34Z")

</div>

Have a look at this page in the docs: [Authentication : Node-RED](https://nodered.org/docs/api/admin/oauth)

It explains how to get an access token and how to use that token when using the api.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 April 2021 00:23 UTC](https://discourse.nodered.org/t/import-flows-using-api/40355/7 "2021-04-20T00:23:28Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
