# Create flow over API

**URL:** <https://community.homey.app/t/create-flow-over-api/19199>\
**Category:** Developers\
**Created:** [October 13, 2019, 6:36am UTC](https://community.homey.app/t/create-flow-over-api/19199 "2019-10-13T06:36:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![homeyuser](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/homeyuser/32/16390_2.png) [@homeyuser](https://community.homey.app/u/homeyuser)\
**Post date:** [October 13, 2019, 6:36am UTC](https://community.homey.app/t/create-flow-over-api/19199/1 "2019-10-13T06:36:44Z")

</div>

Hi!  
I’m a new Homey user but started looking into using the API right away since I want to create a large number of flows programmatically. I am however not a developer so I have some trouble understanding the API documentation and how to map them to endpoints.  
I’m trying to create a flow over the API and have successfully done in the sandbox. The problem is that the sandbox does not give me the raw HTTP request and hence I am not entirely sure of to what endpoint I should send my request.  
My code is written in python and I’ve been able to GET all devices and flows but bump into 404’s as soon as I try to use the createFlow function.  
Have anyone been able to create a flow over the API? If so, could you share the raw HTTP request?

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [October 13, 2019, 7:39am UTC](https://community.homey.app/t/create-flow-over-api/19199/2 "2019-10-13T07:39:54Z")

</div>

It is absolutely possible to create flows but all flows must be valid with fe devices and a trigger. (In Homey fw 1.x it was not verified)  
But I guess your authorization is the issue.  
What did you use for authentication?  
Have you tried the web playground on the developers page?  
Maybe look into the community backup and restore i created.

> [@Community Backup & Restore for Homey v2 and Up! \[Alpha Version\]](https://community.homey.app/t/community-backup-restore-for-homey-v2-alpha-version/13727):
>
> Hi guys, Just to be Clear: This is NOT about [Athom’s Homey Cloud Backup](https://community.homey.app/t/homey-cloud-backup-part-of-homey-subscription/24523) and/or [Homey + Subscription](https://community.homey.app/t/homey-subscription/24522) I created a Homey Community Backup & Restore Web App (HCB&RWA). This makes it possible to create and download a Zip file with the Alarms, Logic, Apps, Zones, Devices, Folders and Flows on your Homey. After that it is possible to Select a previous downloaded Zip backup and restore these objects on this or another Homey. Community Backup & Restore works best from a Desktop browser, pls do …

---

<div class="post-metadata">

**Author:** ![homeyuser](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/homeyuser/32/16390_2.png) [@homeyuser](https://community.homey.app/u/homeyuser)\
**Post date:** [October 13, 2019, 12:19pm UTC](https://community.homey.app/t/create-flow-over-api/19199/3 "2019-10-13T12:19:36Z")

</div>

Hi and thanks for your reply!  
The authentication is not the problem. I’ve autenticated successfully using the bearer token in the v2 format as described in [this post](https://community.homey.app/t/unsupported-homey-v2-rest-api/7268/6).  
I am simply not sure where to send my (I suppose) PUT request, to what endpoint. So i can for example perform a GET request to get a list of all the devices here:  
  
http://\<HOMEY\_IP\>/api/manager/devices/device/   
and get a list of all flows here:  
http://\<HOMEY\_IP\>/api/manager/flow/flow/.   
This is straightforward. But I am not sure how to craft a createFlow action over pure HTTP since http://\<HOMEY\_IP\>/api/manager/flow/createFlow/ for example gives me a 404. When I found out how to do so, I’ll just make a copy of my current flows to ensure I have all the triggers etc in place before starting to substitute parts and make it more dynamic.

Yes, I have successfully created flows using the playground.

Oh, and happy birthday @Dijker! 🙂

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [October 13, 2019, 12:25pm UTC](https://community.homey.app/t/create-flow-over-api/19199/4 "2019-10-13T12:25:41Z")

</div>

Thanks!  
I don’t know the http request as I use the js webapi, but look at restoring a flow from the backup fe after removing the original flow. It should be possible to see it in the chrome console.

---

<div class="post-metadata">

**Author:** ![DaneedeKruyff](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/daneedekruyff/32/964_2.png) [@DaneedeKruyff](https://community.homey.app/u/DaneedeKruyff)\
**Post date:** [October 13, 2019, 1:46pm UTC](https://community.homey.app/t/create-flow-over-api/19199/5 "2019-10-13T13:46:46Z")

</div>

Congrats Dijker!

@homeyuser have a look at the flow viewer @Erik made: [https://github.com/irritanterik/homey-realtime-logpage/blob/master/flowview.html](https://github.com/irritanterik/homey-realtime-logpage/blob/master/flowview.html)  
Think you can find a lot of API endpoints in it (Not sure if adding is one of it though)

You can find some more information about it here:  
[[HOW TO] View your Homey v2 flows in a browser](https://community.homey.app/t/how-to-view-your-homey-v2-flows-in-a-browser/7427)  
(This was posted after Homey V2 was released and Athom still believed in the Mobile only strategy, it’s superseded now by flow.homey.app)

btw, I think you’d want to use POST to create.
