# Script for sending a webhook

**URL:** <https://community.fibery.io/t/script-for-sending-a-webhook/2915>\
**Category:** Get Help\
**Tags:** automations\
**Created:** [June 6, 2022, 6:32pm UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915 "2022-06-06T18:32:49Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maximilian\_Breckbill](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/maximilian_breckbill/32/5080_2.png) [@Maximilian\_Breckbill](https://community.fibery.io/u/Maximilian_Breckbill)\
**Post date:** [June 6, 2022, 6:32pm UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/1 "2022-06-06T18:32:49Z")

</div>

Hi Fiberistas,

I’m trying to set up a Fibery automation to send a webhook to a [Make.com](http://Make.com) (aka integromat) webhook url, but don’t really code :-P.

My use-case: every time an entity is updated and meets certain filters, I want to send it via Webhook to [Make.com](http://Make.com). In the Webhook payload, I’d like it to send the UUID of the entity that has just met the trigger criteria.

Any chance someone can help me out with a sample script?

Any leads would be greatly appreciated!

Best,  
Max

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [June 6, 2022, 8:53pm UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/2 "2022-06-06T20:53:29Z")

</div>

[Make.com](http://Make.com) will automatically create a Fibery webhook for you. No scripting required.  
Just set up a new scenario in Make, then

- Create a Fibery “Watch Events” Trigger (you might need to connect it to your Fibery Workspace & OAuth)  

- Create a connection to your Fibery Workspace (if you haven’t already done this in Make).

- Choose the Fibery DB/entity Type that you want to watch.

Then your Trigger will receive an event every time an entity of that DB/Type is created or changed. It will have all the fields, including Id and Name.

Here is a simple [Make.com](http://Make.com) blueprint I am using to push new Fibery entities into Asana:  
[Make.com Fibery-Asana blueprint.json](https://public-resources.jrpdev3.com/Make.com%20Fibery-Asana%20blueprint.json)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/3/3d0f2746f315bae2cb5df59ce290446997b4b464.jpeg)

---

<div class="post-metadata">

**Author:** ![Maximilian\_Breckbill](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/maximilian_breckbill/32/5080_2.png) [@Maximilian\_Breckbill](https://community.fibery.io/u/Maximilian_Breckbill)\
**Post date:** [June 7, 2022, 3:16pm UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/3 "2022-06-07T15:16:43Z")

</div>

Thanks a bunch @Matt !

Yes, I had done this, and noticed that the Webhook was getting a packet every time the DB in questions was updated.

My issue with this solution - I have a team of ppl constantly creating & updating records in this database, and I only need the automation to fire on a very small fraction of the updates (less than 1%), as shown below, and I’m trying to save Make operations ;-):

 ![Screenshot 2022-06-07 at 17.10.35](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/5/52dfaa815434469a5e7acbc6416c5c68662969e6.png)

Setting up the automation & filters is easy, but I’m a bit slow with the script. @Chr1sG was kind enough to take an initial stab at this here:

for (const entity of args.currentEntities) {  
await http.postAsync(‘[https://hook.us1.make.com](https://hook.us1.make.com)…’, {  
body: {  
text: entity.id  
},  
headers: {  
‘Content-type’: ‘application/json’  
}  
});  
}

Currently I’m getting this error though: _Failed to execute Action “Script”: http is not defined_

My goal is to at least send the entity UUID to Make, then I can pull the rest of the data with the search operator and continue syncing with other apps.

Would be really useful to have this code snippet, if anyone is able to help!

Thanks so much :).

Best,  
Max

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [June 7, 2022, 3:24pm UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/4 "2022-06-07T15:24:40Z")

</div>

You need:

```auto
const http = context.getService('http');

```

---

<div class="post-metadata">

**Author:** ![Maximilian\_Breckbill](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/maximilian_breckbill/32/5080_2.png) [@Maximilian\_Breckbill](https://community.fibery.io/u/Maximilian_Breckbill)\
**Post date:** [June 7, 2022, 4:00pm UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/5 "2022-06-07T16:00:13Z")

</div>

It works perfectly :).

Thanks @Matt_Blais & @Chr1sG !

---

<div class="post-metadata">

**Author:** ![Maximilian\_Breckbill](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/maximilian_breckbill/32/5080_2.png) [@Maximilian\_Breckbill](https://community.fibery.io/u/Maximilian_Breckbill)\
**Post date:** [June 7, 2022, 4:35pm UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/6 "2022-06-07T16:35:57Z")

</div>

So, for future reference, here’s the complete code snippet.

```auto
const http = context.getService('http');

for (const entity of args.currentEntities) {
    await http.postAsync('https://hook.us1.make.com/...', {
        body: {
            matchUUID: entity.id,
            name: entity.name
        },
        headers: {
            'Content-type': 'application/json'
        }
    });
}

```

---

<div class="post-metadata">

**Author:** ![Maximilian\_Breckbill](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/maximilian_breckbill/32/5080_2.png) [@Maximilian\_Breckbill](https://community.fibery.io/u/Maximilian_Breckbill)\
**Post date:** [June 7, 2022, 4:45pm UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/7 "2022-06-07T16:45:48Z")

</div>

A last question → as you can see above, I’m happily building out the contents of the webhook with various datapoints from the entity (name, UUID, etc).

Is there a short and easy way to just have the Webhook send ALL the data in args.currentEntities? As opposed to defining each field to be sent by hand?

Thanks again 😄

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [June 7, 2022, 8:03pm UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/8 "2022-06-07T20:03:48Z")

</div>

Indeed there is - this will pass all the fields in entity:

```auto
const fibery = context.getService('fibery')
const http = context.getService('http')
const MAKE_HOOK_URL = 'https://hook.us1.make.com/......'

for (const entity of args.currentEntities) {
    await http.postAsync(MAKE_HOOK_URL, {
        body: entity,
        headers: { 'Content-type': 'application/json' }
    })
}

```

Note that you may then need to force Make to “Redetermine Data Structure” for the webhook, to pick up all the new fields:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/9/938558c43d3123f962fcb2accadcdae7145c4459.png)

---

<div class="post-metadata">

**Author:** ![Maximilian\_Breckbill](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/maximilian_breckbill/32/5080_2.png) [@Maximilian\_Breckbill](https://community.fibery.io/u/Maximilian_Breckbill)\
**Post date:** [June 8, 2022, 8:51am UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/9 "2022-06-08T08:51:06Z")

</div>

That worked perfectly! Thanks Matt 😄

---

<div class="post-metadata">

**Author:** ![Maximilian\_Breckbill](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/maximilian_breckbill/32/5080_2.png) [@Maximilian\_Breckbill](https://community.fibery.io/u/Maximilian_Breckbill)\
**Post date:** [June 8, 2022, 8:56am UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/10 "2022-06-08T08:56:13Z")

</div>

Very last question on this topic (i hope 😅)…

Is there also a way to send attachment files via webhook?

In our use case, we are sending candidate profiles, it would also be great to send their CV which is generally attached as a pdf to the entities were are sending.

An alternative might be to generate an external link for each file attached to an entity… not sure if this is possible yet?

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [June 8, 2022, 12:55pm UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/11 "2022-06-08T12:55:50Z")

</div>

There are currently no direct script functions for retrieving files, but you can query the entity to get the ‘secret’ of any file(s) in the Files collection field, and then construct urls for downloading them:

```auto
const fibery = context.getService('fibery');
const utils = context.getService('utils');

for (const entity of args.currentEntities) {
    
    const entityWithFilesField = await fibery.getEntityById(entity.type, entity.id, ['Files']);

    const files = await fibery.getEntitiesByIds('fibery/file', entityWithFilesField['Files'].map(file => file['id']), ['fibery/secret']);

    for (const file of files) {
        const url = utils.getEntityUrl('api/files', file['fibery/secret']);
        console.log(url);
    }
}

```

---

<div class="post-metadata">

**Author:** ![Lahall](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/lahall/32/1363_2.png) [@Lahall](https://community.fibery.io/u/Lahall)\
**Post date:** [November 17, 2022, 7:29pm UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/12 "2022-11-17T19:29:25Z")

</div>

This thread just saved me lots of heartache. Thanks to all who contributed!

---

<div class="post-metadata">

**Author:** ![Renato\_Carvalho](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/renato_carvalho/32/11001_2.png) [@Renato\_Carvalho](https://community.fibery.io/u/Renato_Carvalho)\
**Post date:** [July 7, 2024, 7:21pm UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/13 "2024-07-07T19:21:35Z")

</div>

It would be really awesome if Fibery team had this example of usage documented in the documentation.

It took a lot of search in the forum to find out if it was possible to trigger a webhook from the Rules inside Fibery.

And after I found out, I couldn’t find an example of doing it.

cc/ @Chr1sG

---

<div class="post-metadata">

**Author:** ![mdubakov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/mdubakov/32/10_2.png) [@mdubakov](https://community.fibery.io/u/mdubakov)\
**Post date:** [October 2, 2024, 6:53am UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/14 "2024-10-02T06:53:09Z")

</div>

We are considering adding Send Webhook action, please provide your ideas if any!

> [@Webhook Action in Automations](https://community.fibery.io/t/webhook-action-in-automations/7485):
>
> I hope this becomes an automation/button action. It would increase the usability/flexibility of Fibery for low-code users if there was a UI that builds an API call similar to Zapier and Make.

---

<div class="post-metadata">

**Author:** ![mdubakov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/mdubakov/32/10_2.png) [@mdubakov](https://community.fibery.io/u/mdubakov)\
**Post date:** [May 21, 2026, 2:03pm UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/15 "2026-05-21T14:03:06Z")

</div>

Native Send Web Request action added

> [@May 21, 2026 / Manage users visibility, Send web request action in automations](https://community.fibery.io/t/may-21-2026-manage-users-visibility-send-web-request-action-in-automations/10894):
>
> Manage users visibility By default, every user in your workspace can see every other user (only Guests can’t see each other). This is great…until you start collaborating closely with your clients and contractors and invite them as Members or Observers. Your customer base gets exposed, sensitive email addresses get leaked, and your GDPR compliance goes out of the window. Not anymore. Now you can prevent people outside of your org from seeing other users’ profiles: Change the default …

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [May 21, 2026, 2:03pm UTC](https://community.fibery.io/t/script-for-sending-a-webhook/2915/16 "2026-05-21T14:03:44Z")

</div>


