# NodeRed Admin API - Example how to use

**URL:** <https://discourse.nodered.org/t/nodered-admin-api-example-how-to-use/53096>\
**Category:** General\
**Created:** [1 November 2021 22:11 UTC](https://discourse.nodered.org/t/nodered-admin-api-example-how-to-use/53096 "2021-11-01T22:11:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [1 November 2021 23:34 UTC](https://discourse.nodered.org/t/nodered-admin-api-example-how-to-use/53096/2 "2021-11-01T23:34:30Z")

</div>

Please don't cross-post the same question in multiple places.

You've already asked this in your existing thread here: [What is the published format for storing NodeRED graph to a file? - #8 by raid2light](https://discourse.nodered.org/t/what-is-the-published-format-for-storing-nodered-graph-to-a-file/52794/8)

The Admin API is a programming API. In this instance, it's an API that is called by properly formed HTTP Requests. So to invoke it from the command-line, you'd need to use something like `curl` or `wget` to make the requests.

In the following examples, I'm assuming you do not have `adminAuth` setup - so the end points are not secured. If you are using `adminAuth` to secure them, you'd have to follow the guide in the docs for getting authenticated: [Authentication : Node-RED](https://nodered.org/docs/api/admin/oauth)

To get the current flow configuration, you'd do a GET request to `/flows`:

```auto
curl http://localhost:1880/flows -s -o /tmp/flows.json 
# -s : silent mode
# -o /tmp/flows.json : write the flow config to the file /tmp/flows.json

```

With that done, you can edit the flows.json file however you want. Once you've made your changes, you can POST it back to `/flows`:

```auto
curl -XPOST -H "Content-Type: application/json" --data "@/tmp/flows.json" http://localhost:1880/flows
# -XPOST : make a POST request
# -H "..." : set the content-type header to application/json
# --data "@..." : use the contents of `/tmp/flows.json` as the body of the request

```

---

_[View the full topic](https://discourse.nodered.org/t/nodered-admin-api-example-how-to-use/53096)._
