# How to use webhooks to update variables and trigger logicblocks in Apilio

**URL:** <https://community.apilio.com/t/how-to-use-webhooks-to-update-variables-and-trigger-logicblocks-in-apilio/1607>\
**Category:** Getting Started & How-To's\
**Created:** [3 March 2021 15:20 UTC](https://community.apilio.com/t/how-to-use-webhooks-to-update-variables-and-trigger-logicblocks-in-apilio/1607 "2021-03-03T15:20:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anna](https://community.apilio.com/user_avatar/community.apilio.com/anna/32/72_2.png) [@Anna](https://community.apilio.com/u/Anna)\
**Post date:** [3 March 2021 15:20 UTC](https://community.apilio.com/t/how-to-use-webhooks-to-update-variables-and-trigger-logicblocks-in-apilio/1607/1 "2021-03-03T15:20:03Z")

</div>

Webhooks can be used to update your Apilio data and evaluate your Logiblocks from other apps and services, for example: iOS shortcuts (Siri), Tasker, Zapier, and many more.

In this post we’ll see how we can use these handy URLs to update your data in Apilio from any third party service or apps that can handle webhooks.

 

# Webhooks URLs are in the show view for any variable or Logicblock

These urls are always displayed in the “show” view for any element.

 ![image](https://community.apilio.com/uploads/default/original/1X/e2f1f14c98b8dc5a0c2d8110dd33f0b64b1dec83.png)

# Update boolean variables via webhooks

Variables in Apilio store data from devices, apps or services. With webhooks, you’ll be able to **update your boolean variable to true, to false or to toggle it** (if it was true, it will be set to false, and if it was false, it will be set to true).

 ![image](https://community.apilio.com/uploads/default/original/1X/b397ad42bd9cdbe1539d678294ff3d43f7b287ee.png)

# Update string variables via webhooks

String variables can be **cleared** via webhooks (delete the data they store) or you can **set them to a different value**. You’ll need to append &value=new\_value to the end of the URL, where “new\_value” is the new string you’d like to update the variable to.

 ![image](https://community.apilio.com/uploads/default/original/1X/6acc55e5effd8d530663dce12702a1a47168b269.png)

# Update numeric variables via webhooks

Numeric variables can be **set** via webhooks and you can also do a couple of mathematical operations with them: **add a number** to the current data stored, or **subtract a number** from the value. In all these three cases, you’ll need to append &value=some\_value at the end, where some\_value is the number you wish to update the numeric variable to, or that you wish to add/subtract.

 ![image](https://community.apilio.com/uploads/default/original/1X/bc304ae57ba194cd27790289cad150b66f57cbe2.png)

# Get the current value of a variable via webhook

Every variable, whether boolean, string or numeric, also has a **Get value** webhook. Call it and Apilio replies with a small JSON payload containing the variable’s UUID, name, current value and when it was last updated - handy if you want to pull data out of Apilio, instead of pushing data in.

```json
{
  "uuid": "a1b2c3d4-...",
  "name": "Garage door",
  "value": true,
  "updated_at": "2026-09-17T10:00:00.000Z"
}

```

You’ll find the **Get value** link together with the other webhook URLs on the variable’s page. If the variable belongs to a device attribute, the same link is also available on the device’s page, next to that attribute.

> 💡 **Tip:** this is the easiest way to check a sensor’s current state from a phone widget, Siri Shortcut, or another app, without having to build a Logicblock and a condition just to read a value out.

# Evaluate a Logicblock via webhooks

You can have any external app launch a Logicblock automatically by using this webhook. This is useful for example to use a widget on your phone to launch a Logicblock manually. You’ll find it in the show view of your Logicblock, at the end of the page.

 ![image](https://community.apilio.com/uploads/default/original/1X/3ea4b9969fa5ce609a9a00560314bdfc3067cca4.png)

# Activate or deactivate a Logicblock via webhooks

We’ve added two new capabilities via webhooks, so you can automate if you wish to deactivate a specific logicblock.

You can use this to for example, deactivate a specific Logicblock when you are away on holiday, and then make it active again when you are back home. You can also use this to manually deactivate/activate a specific Logicblock from your phone.

# Examples using webhooks

[https://community.apilio.com/t/how-to-update-apilio-variables-or-run-logicblocks-without-using-ifttt/1736](https://community.apilio.com/t/how-to-update-apilio-variables-or-run-logicblocks-without-using-ifttt/1736)

> [@How to use Tasker and Apilio via webhooks](https://community.apilio.com/t/how-to-use-tasker-and-apilio-via-webhooks/1616):
>
> Tasker is an Android app that can perform tasks based on conditions. Much like Apilio, it lets you automate logic based on what’s going on on your phone: where you are, if you have received an SMS, if the phone is in silent mode, … It’s not a free app, but it has lots of fans out there! In short: Tasker lets you specify some conditions and, if the are met, you can run some actions. One of the types of actions Tasker has is to call a URL, so we will use t…

> # 💡 Related articles
> 
> - [How to renew your webhooks secret key in Apilio](https://community.apilio.com/t/how-to-renew-your-webhooks-secret-key-in-apilio/1609)

---

<div class="post-metadata">

**Author:** ![DanT](https://community.apilio.com/user_avatar/community.apilio.com/dant/32/9_2.png) [@DanT](https://community.apilio.com/u/DanT)\
**Post date:** [4 March 2021 11:10 UTC](https://community.apilio.com/t/how-to-use-webhooks-to-update-variables-and-trigger-logicblocks-in-apilio/1607/2 "2021-03-04T11:10:27Z")

</div>

works great @Anna thank you 🙇‍♂️

Please could we add multiply and divide as well as add and subtract to the numeric variable featues?

---

<div class="post-metadata">

**Author:** ![teknofilo](https://community.apilio.com/user_avatar/community.apilio.com/teknofilo/32/772_2.png) [@teknofilo](https://community.apilio.com/u/teknofilo)\
**Post date:** [8 March 2021 01:08 UTC](https://community.apilio.com/t/how-to-use-webhooks-to-update-variables-and-trigger-logicblocks-in-apilio/1607/3 "2021-03-08T01:08:52Z")

</div>

@pebneter, @Anna

Would it be possible to retrieve the status of a condition (true/false) via webhook? That can be very useful for Tuya-based conditions.

---

<div class="post-metadata">

**Author:** ![pebneter](https://community.apilio.com/user_avatar/community.apilio.com/pebneter/32/56_2.png) [@pebneter](https://community.apilio.com/u/pebneter)\
**Post date:** [9 March 2021 11:10 UTC](https://community.apilio.com/t/how-to-use-webhooks-to-update-variables-and-trigger-logicblocks-in-apilio/1607/4 "2021-03-09T11:10:07Z")

</div>

We are working on an update and extension to the REST API ([https://documenter.getpostman.com/view/7602053/S1TSZeSA?version=latest](https://documenter.getpostman.com/view/7602053/S1TSZeSA?version=latest)).  
Can you elaborate from which system you would want to get that state information?

---

<div class="post-metadata">

**Author:** ![teknofilo](https://community.apilio.com/user_avatar/community.apilio.com/teknofilo/32/772_2.png) [@teknofilo](https://community.apilio.com/u/teknofilo)\
**Post date:** [9 March 2021 14:45 UTC](https://community.apilio.com/t/how-to-use-webhooks-to-update-variables-and-trigger-logicblocks-in-apilio/1607/5 "2021-03-09T14:45:21Z")

</div>

For example, door sensors.

I have a Siri shortcut which runs when I say “What’s the status of the garage door?”

I have currently implemented it through a logicblock which checks the status of the door (positive if closed, negative if open)

 ![download (1)](https://community.apilio.com/uploads/default/original/1X/3159366c8d6874fc353cc79ddfa2ef4b27848e21.png)

 ![download](https://community.apilio.com/uploads/default/original/1X/377edc0c1b030817776719391636816f909e04ed.png)

My Siri shortcut calls that logicblock through a webhook, parses the JSON result, and shows the result via notification and also voice (in case I am asking via HomePod or CarPlay)

 ![1](https://community.apilio.com/uploads/default/original/1X/ac8f6021bc70b3f87085bba02af86453b496d493.jpeg) ![2](https://community.apilio.com/uploads/default/original/1X/0005ef6d19ad76d5fdd009c3a17968dc96529cae.jpeg) ![3](https://community.apilio.com/uploads/default/original/1X/106de8d1e9ddc8a7f5d991ff47cdbf5aefd8ea1a.jpeg)

I even have a Siri shortcut that checks both garage gates and informs about their status. See it in action in this video: [https://www.dropbox.com/s/4bztrjhy4qiana6/2021-03-09%2015.37.20.mp4?dl=0](https://www.dropbox.com/s/4bztrjhy4qiana6/2021-03-09%2015.37.20.mp4?dl=0)

---

<div class="post-metadata">

**Author:** ![DanT](https://community.apilio.com/user_avatar/community.apilio.com/dant/32/9_2.png) [@DanT](https://community.apilio.com/u/DanT)\
**Post date:** [10 March 2021 11:04 UTC](https://community.apilio.com/t/how-to-use-webhooks-to-update-variables-and-trigger-logicblocks-in-apilio/1607/6 "2021-03-10T11:04:49Z")

</div>

Thanks for this @teknofilo! Amazing! 👏 But Dropbox is reporting the link as deleted?

---

<div class="post-metadata">

**Author:** ![teknofilo](https://community.apilio.com/user_avatar/community.apilio.com/teknofilo/32/772_2.png) [@teknofilo](https://community.apilio.com/u/teknofilo)\
**Post date:** [10 March 2021 14:51 UTC](https://community.apilio.com/t/how-to-use-webhooks-to-update-variables-and-trigger-logicblocks-in-apilio/1607/7 "2021-03-10T14:51:39Z")

</div>

Try again, I deleted the file by misstake

---

<div class="post-metadata">

**Author:** ![DanT](https://community.apilio.com/user_avatar/community.apilio.com/dant/32/9_2.png) [@DanT](https://community.apilio.com/u/DanT)\
**Post date:** [10 March 2021 15:36 UTC](https://community.apilio.com/t/how-to-use-webhooks-to-update-variables-and-trigger-logicblocks-in-apilio/1607/8 "2021-03-10T15:36:28Z")

</div>

Works great now thanks!

---

<div class="post-metadata">

**Author:** ![pebneter](https://community.apilio.com/user_avatar/community.apilio.com/pebneter/32/56_2.png) [@pebneter](https://community.apilio.com/u/pebneter)\
**Post date:** [10 March 2021 15:43 UTC](https://community.apilio.com/t/how-to-use-webhooks-to-update-variables-and-trigger-logicblocks-in-apilio/1607/9 "2021-03-10T15:43:49Z")

</div>

Impressive stuff - thanks for sharing! 🤩  
I never took the time to check out iOS Shortcuts in details, and I must say it’s way more powerful than expected.

---

<div class="post-metadata">

**Author:** ![teknofilo](https://community.apilio.com/user_avatar/community.apilio.com/teknofilo/32/772_2.png) [@teknofilo](https://community.apilio.com/u/teknofilo)\
**Post date:** [10 March 2021 15:53 UTC](https://community.apilio.com/t/how-to-use-webhooks-to-update-variables-and-trigger-logicblocks-in-apilio/1607/10 "2021-03-10T15:53:30Z")

</div>

I am not very familiar with it, so I had to “google” every line of code. Being used to other languages like PHP, I find it a little bit complicated.
