# UiBuilder - Create REST API

**URL:** <https://discourse.nodered.org/t/uibuilder-create-rest-api/95508>\
**Category:** General\
**Tags:** uibuilder\
**Created:** [19 February 2025 09:20 UTC](https://discourse.nodered.org/t/uibuilder-create-rest-api/95508 "2025-02-19T09:20:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdacruz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cdacruz/32/29482_2.png) [@cdacruz](https://discourse.nodered.org/u/cdacruz)\
**Post date:** [19 February 2025 09:20 UTC](https://discourse.nodered.org/t/uibuilder-create-rest-api/95508/1 "2025-02-19T09:20:31Z")

</div>

Hi uibuilder users,

I want to implement a standard REST API with the usual verbs (GET, POST, PUT, DELETE) to manage a list of todos, for example. :

GET /todos  
GET /todos/:id  
POST /todos  
PUT /todos/:id  
DELETE /todos/:id  
...

Can this be set up with uibuilder? Do you have a basic example? Is there a solution for simple authentication?

Do we have to go through the node-red http nodes?

Thanks for your advice!

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [19 February 2025 10:09 UTC](https://discourse.nodered.org/t/uibuilder-create-rest-api/95508/2 "2025-02-19T10:09:28Z")

</div>

> [@cdacruz](#):
>
> Can this be set up with uibuilder?

Yes. The main feature would be the instance-specific API's.

> **[UIBUILDER Documentation v7](https://totallyinformation.github.io/node-red-contrib-uibuilder/#/how-to/instance-apis)**
>
> UIBUILDER Documentation v7

With this feature, you can create your API endpoints as you've indicated and they are linked to a specific uibuilder node instance which defines the base URL.

> [@cdacruz](#):
>
> Do you have a basic example?

I think there might have been an example of this shared in the forum a long time ago but because I don't currently use this feature in anger (it was added at the request of a uibuilder user some years ago), I don't have a specific example other than what is in the docs shared above.

> [@cdacruz](#):
>
> Is there a solution for simple authentication?

UIBUILDER now has the same identity information that Dashboard 2 also has - this consists of standardised user and authentication information taken from standard HTTP headers used by typical external authentication services.

[http://127.0.0.1:1880/red/uibuilder/docs/#/security/authenticated-client-properties](http://127.0.0.1:1880/red/uibuilder/docs/#/security/authenticated-client-properties)

In addition, UIBUILDER provides client (browser) details to Node-RED including the source IP, a client ID that is stable for the life of the open browser, a tab id and the page name.

It also gives you access to a number of "hooks" in settings.js that lets you enhance or change client data and add security to messaging (something that normally isn't covered by "standard" security tools). You can also use the older but still effective middleware config feature of uibuilder but the hooks are easier to work with.

There really is no "one-size-fits-all" way of dealing with authentication and authorisation since there are so many options and requirements. UIBUILDER tries to ensure that you have easy access to the key data and process points so that you can easily build up your own requirements.

> [@cdacruz](#):
>
> Do we have to go through the node-red http nodes?

Nope! The whole point of UIBUILDER is to provide flexible, full featured but relatively easy to develop data-driven web applications. 😄

* * *

Co-incidentally, I've been thinking about instance API's again recently and wondering whether I should introduce a more visible feature that would possibly mirror the core http-in/-response nodes but with a UIBUILDER flavour, ensuring that, for example, you get access to the comms and shared endpoints of uibuilder automatically.

Let me know if you think that would be helpful for a future release.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [19 February 2025 10:31 UTC](https://discourse.nodered.org/t/uibuilder-create-rest-api/95508/3 "2025-02-19T10:31:23Z")

</div>

Forgot to also say that, uibuilder also provides node-red with the full connection headers on client connect.

---

<div class="post-metadata">

**Author:** ![cdacruz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cdacruz/32/29482_2.png) [@cdacruz](https://discourse.nodered.org/u/cdacruz)\
**Post date:** [19 February 2025 13:10 UTC](https://discourse.nodered.org/t/uibuilder-create-rest-api/95508/4 "2025-02-19T13:10:55Z")

</div>

Excellent, thank you very much Julian. That's exactly what I'm looking for!  
I'm going to spend some time on it to learn more.

And yes, I think it's a good idea to make access to the API visible, accessible, adjusted and maybe driven via uibuilder. That's still my opinion, you'd have to ask for other opinions...

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [19 February 2025 13:45 UTC](https://discourse.nodered.org/t/uibuilder-create-rest-api/95508/5 "2025-02-19T13:45:22Z")

</div>

> [@cdacruz](#):
>
> And yes, I think it's a good idea to make access to the API visible, accessible, adjusted and maybe driven via uibuilder. That's still my opinion, you'd have to ask for other opinions...

Thanks for the feedback. It is a relatively complex thing to get right so may take some time to appear. However, the basics are already there.

By the way, should you need some server-side rendering support in your API's, that is possible too.

---

<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:** [5 March 2025 13:46 UTC](https://discourse.nodered.org/t/uibuilder-create-rest-api/95508/6 "2025-03-05T13:46:09Z")

</div>

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