# Homey App, Permissions HomeyApi =\> Flow.triggerFlow

**URL:** <https://community.homey.app/t/homey-app-permissions-homeyapi-flow-triggerflow/80916>\
**Category:** Developers\
**Tags:** app, flow, homey-pro\
**Created:** [May 22, 2023, 8:30am UTC](https://community.homey.app/t/homey-app-permissions-homeyapi-flow-triggerflow/80916 "2023-05-22T08:30:45Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/niels/32/89_2.png) [@Niels](https://community.homey.app/u/Niels)\
**Post date:** [May 22, 2023, 8:30am UTC](https://community.homey.app/t/homey-app-permissions-homeyapi-flow-triggerflow/80916/1 "2023-05-22T08:30:45Z")

</div>

Hey Devs,

I’m running into an issue i can’t seem to tackle.  
I’m exposing homey flows to a secondary system but I am unable to trigger the flows.

Using [Api Playground](https://tools.developer.homey.app/tools/api-playground) I am able to execute this code:

`Homey.flow.triggerFlow({ id: "c4330edf-8131-4a37-9729-c83872fed6ff" })`

From within the homey App I’m developing I have set app.json

```auto
  "permissions": [
    "homey:manager:api"
  ]

```

This is a snippet of my code:

```auto
const { HomeyAPI } = require("athom-api");
let homeyApi = await HomeyAPI.forCurrentHomey(this.homey);

...

homeyApi.flow.triggerFlow({ id: "c4330edf-8131-4a37-9729-c83872fed6ff" }).catch((e) => {
  console.warn(e);
});

```

From the app it doesn’t work, seem to be a permission thing. I am however able to get all flows.  
Error i receive:

> missing\_scopes: Je hebt geen toegang om dit te doen.  
> at /node\_modules/athom-api/dist/index.js:1:1242141  
> at processTicksAndRejections (node:internal/process/task\_queues:96:5) {  
> code: 403,  
> cause: t {  
> \_\_athom\_api\_type: ‘HomeyAPI.ManagerFlow.Error’,  
> code: 403,  
> error: ‘missing\_scopes’,  
> error\_description: ‘Je hebt geen toegang om dit te doen.’,  
> ‘$stack’: undefined  
> }

Does anyone have a clue what I could do to fix this?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [May 22, 2023, 8:33am UTC](https://community.homey.app/t/homey-app-permissions-homeyapi-flow-triggerflow/80916/2 "2023-05-22T08:33:45Z")

</div>

> [@Niels](#):
>
> Does anyone have a clue what I could do to fix this?

AFAIK you can’t, apps don’t have permission to trigger flows like this.

---

<div class="post-metadata">

**Author:** ![Niels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/niels/32/89_2.png) [@Niels](https://community.homey.app/u/Niels)\
**Post date:** [May 22, 2023, 8:39am UTC](https://community.homey.app/t/homey-app-permissions-homeyapi-flow-triggerflow/80916/3 "2023-05-22T08:39:13Z")

</div>

Thanks for the quick response.

at [https://apps.developer.homey.app/the-basics/app/permissions](https://apps.developer.homey.app/the-basics/app/permissions) it states:

> The API permission (`"homey:manager:api"` ) allows an app to access the Homey Web API. This web api can be used to control all of Homey (devices, Flows, etc) even if they are not part of the App that requested the permission.

Should i create a support case?

---

<div class="post-metadata">

**Author:** ![Niels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/niels/32/89_2.png) [@Niels](https://community.homey.app/u/Niels)\
**Post date:** [May 22, 2023, 8:41am UTC](https://community.homey.app/t/homey-app-permissions-homeyapi-flow-triggerflow/80916/4 "2023-05-22T08:41:44Z")

</div>

Only thing i can try is using this API approach opposed to the one i’m currently using:

> **[HomeyAPI - Homey Web API](https://athombv.github.io/node-homey-api/HomeyAPI.html#.createAppAPI)**

(homey-api VS athom-api)

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [May 22, 2023, 8:50am UTC](https://community.homey.app/t/homey-app-permissions-homeyapi-flow-triggerflow/80916/5 "2023-05-22T08:50:13Z")

</div>

> [@Niels](#):
>
> Should i create a support case?

You can try, but they will probably just change the documentation 😉

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [May 22, 2023, 8:51am UTC](https://community.homey.app/t/homey-app-permissions-homeyapi-flow-triggerflow/80916/6 "2023-05-22T08:51:17Z")

</div>

> [@Niels](#):
>
> (homey-api VS athom-api)

`athom-api` is the predecessor of `homey-api`, which you should be using anyway 😃

---

<div class="post-metadata">

**Author:** ![Niels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/niels/32/89_2.png) [@Niels](https://community.homey.app/u/Niels)\
**Post date:** [May 22, 2023, 9:21am UTC](https://community.homey.app/t/homey-app-permissions-homeyapi-flow-triggerflow/80916/7 "2023-05-22T09:21:04Z")

</div>

Helaas:

```auto
'use strict';

const Homey = require('homey');
const { HomeyAPI } = require('homey-api');

class MyApp extends Homey.App {

  /**
   * onInit is called when the app is initialized.
   */
  async onInit() {
    this.homeyApi = await HomeyAPI.createAppAPI({
      homey: this.homey,
    });

    this.homeyApi.flow.triggerFlow({ id: "c4330edf-8131-4a37-9729-c83872fed6ff" }).catch((e) => {
      console.warn(e);
    });

    this.log('MyApp has been initialized');
  }

}

module.exports = MyApp;

```

Log:

```auto
─────────────── Logging stdout & stderr ───────────────
[log] 2023-05-22 09:18:50 [MyApp] MyApp has been initialized
[HomeyAPIError: Je hebt geen toegang om dit te doen.] {
  statusCode: 403,
  description: 'Je hebt geen toegang om dit te doen.'
}

```

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [May 22, 2023, 4:55pm UTC](https://community.homey.app/t/homey-app-permissions-homeyapi-flow-triggerflow/80916/8 "2023-05-22T16:55:54Z")

</div>

No, Athom will not allow executing flows from apps.  
Thats why H.O.O.P was released in the Community Store.

---

<div class="post-metadata">

**Author:** ![Svensei38](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/svensei38/32/140297_2.png) [@Svensei38](https://community.homey.app/u/Svensei38)\
**Post date:** [September 10, 2025, 1:03pm UTC](https://community.homey.app/t/homey-app-permissions-homeyapi-flow-triggerflow/80916/9 "2025-09-10T13:03:04Z")

</div>

Can I asume that triggering moods has the same restriction?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/9/195563ed3d8aae7e5e561f3bdec18708a5e86181.png)

(20.9s is caused by the debugger)

App code (not working):

```typescript
  public async setMoodById(moodId: string): Promise<void> {
    let homeyAPI = await super.ensureHomeyAPI();
    await homeyAPI.flow.runFlowCardAction({
      uri: `homey:mood:${moodId}`,
      id: `homey:mood:${moodId}:set`,
      args: {}
    });
  }

```

Yet, it works from HomeyScript:

```javascript
//...
  promises.push(Homey.flow.runFlowCardAction({
    uri: `homey:mood:${homeyMoodId}`,
    id: `homey:mood:${homeyMoodId}:set`,
    args: {}
  }));
//...

```

My app has Homey API permission:

```json
  "permissions": [
    "homey:manager:api"
  ],

```

and other calls (like retrieving all devices) work just fine.

## UPDATE

I thought I found [the solution](https://athombv.github.io/node-homey-api/HomeyAPIV3Local.ManagerMoods.html#setMood), be I got the same error (Missing Scopes)…

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/a/ea161a5fc7a92ca0acbdd592b94b0f86e177f32f.png)

New app code:

```typescript
  public async setMoodById(moodId: string): Promise<void> {
    let homeyAPI = await super.ensureHomeyAPI();
    await homeyAPI.moods.setMood({ id: moodId } );
  }

```

Homey API instance creation:

```typescript
  protected async ensureHomeyAPI() {
    if(this._homeyAPI === null) {
      this._homeyAPI = await HomeyAPI.createAppAPI({ homey: this._app.homey });
    }
    return this._homeyAPI;
  }

```

**Is there any other way to active a mood from a Homey app?**

---

<div class="post-metadata">

**Author:** ![Caseda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/caseda/32/138695_2.png) [@Caseda](https://community.homey.app/u/Caseda)\
**Post date:** [September 11, 2025, 7:41am UTC](https://community.homey.app/t/homey-app-permissions-homeyapi-flow-triggerflow/80916/10 "2025-09-11T07:41:59Z")

</div>

I don’t think Athom will allow this, but looks like you’ll have to ask Athom to add your app to the web api’s scope list of moods.

---

<div class="post-metadata">

**Author:** ![Svensei38](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/svensei38/32/140297_2.png) [@Svensei38](https://community.homey.app/u/Svensei38)\
**Post date:** [September 11, 2025, 1:45pm UTC](https://community.homey.app/t/homey-app-permissions-homeyapi-flow-triggerflow/80916/11 "2025-09-11T13:45:51Z")

</div>

I don’t understand why the Homey Web API would block this. A mood exposes less functionality than devices, yet with `"homey:manager:api"` permission I can control all devices.

The funny thing is… I can read the properties (the configuration) of the mood and I can control the capabilities of the devices. That means I can actually set a mood by applying (for each device in the mood) each property in the mood to the capability in the device. So why don’t they save me the trouble and just allow setting moods when you have `"homey:manager:api"` permission? They could also add a new permission `"homey:manager:moods"` that explicitly allows setting moods.

For my setup at home, I can easily solve this by creating a HomeyScript “Set mood by ID”, but I would have loved to have this card in my app and offer it to the rest of the community too.

@Caseda

Thanks for responding… not the answer I was hoping for, but much appreciated.

> you’ll have to ask Athom to add your app to the web api’s scope list of moods

**How do I proceed? Can you point me in the right direction?**  
↳ Do I open a support ticket for this?  
↳ Is there a topic for feature requests?  
↳ Is there a mailbox I can write to?

---

<div class="post-metadata">

**Author:** ![Caseda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/caseda/32/138695_2.png) [@Caseda](https://community.homey.app/u/Caseda)\
**Post date:** [September 11, 2025, 3:23pm UTC](https://community.homey.app/t/homey-app-permissions-homeyapi-flow-triggerflow/80916/12 "2025-09-11T15:23:38Z")

</div>

> [@Svensei38](#):
>
> **How do I proceed? Can you point me in the right direction?**  
> ↳ Do I open a support ticket for this?  
> ↳ Is there a topic for feature requests?  
> ↳ Is there a mailbox I can write to?

Support ticket is your only way.  
There are several things behind the scope wall, devices is one of the few that isn’t.  
still waiting for dashboard scope support for HomeyScript (yes even HomeyScript doesn’t have all scopes)
