# Webhook for Approval task status changes?

**URL:** <https://forum.asana.com/t/webhook-for-approval-task-status-changes/122288>\
**Category:** API & Developers\
**Tags:** webhooks, tasks\
**Created:** [21 May 2021 16:47 UTC](https://forum.asana.com/t/webhook-for-approval-task-status-changes/122288 "2021-05-21T16:47:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Wynn](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/daniel_wynn/32/77932_2.png) [@Daniel\_Wynn](https://forum.asana.com/u/Daniel_Wynn)\
**Post date:** [21 May 2021 16:47 UTC](https://forum.asana.com/t/webhook-for-approval-task-status-changes/122288/1 "2021-05-21T16:47:07Z")

</div>

Hello! I’m new to the Asana API, and fairly new to manually creating webhooks…  
I am creating approval tasks and hope to trigger a webhook whenever the approval task status is changed (approved, rejected, change requested) in my project (“IAM Tasks”). I would like the webhook to send the gid and due information. (Ideally, it would also send the name/description, but I’d settle for the gid)

Here is the body of my webhook creation request  
{  
“data”: {  
“filters”: [  
{  
“action”: “changed”,  
“fields”: [  
“gid”,  
“name”,  
“due\_on”

```
    ],
    "resource_subtype": "approval",
    "resource_type": "task"
  }
],
"resource": "XXXXXX",
"target": "XXXXX"

```

}  
}

and the response:

{  
“response”: {  
“status\_code”: 201,  
“headers”: {  
“server”: “nginx”,  
“date”: “Fri, 21 May 2021 13:21:38 GMT”,  
“content-type”: “application/json; charset=UTF-8”,  
“content-length”: “478”,  
“connection”: “close”,  
“location”: “/api/1.0/webhooks/XXXXX”,  
“cache-control”: “no-store”,  
“pragma”: “no-cache”,  
“set-cookie”: [  
“TooBusyRedirectCount=0”  
],  
“x-frame-options”: “DENY”,  
“x-xss-protection”: “1; mode=block”,  
“x-content-type-options”: “nosniff”,  
“content-security-policy”: “report-uri [https://app.asana.com/-/csp\_report?report\_only=false;default-src](https://app.asana.com/-/csp_report?report_only=false;default-src) ‘none’;frame-src ‘none’;frame-ancestors ‘none’”,  
“x-asana-api-version”: “1.0”,  
“asana-change”: “name=new\_user\_task\_lists;info=[Update on our planned API changes to user task lists (a.k.a. My Tasks)](https://forum.asana.com/t/update-on-our-planned-api-changes-to-user-task-lists-a-k-a-my-tasks/103828)”,  
“x-robots-tag”: “none”,  
“strict-transport-security”: “max-age=31536000; includeSubDomains”,  
“datacenter-time-end”: “1621603298.133”,  
“x-loadbalancer”: “prod-lb013.ec2”  
},  
“body”: {  
“data”: {  
“gid”: “XXXX”,  
“resource\_type”: “webhook”,  
“resource”: {  
“gid”: “XXXX”,  
“resource\_type”: “project”,  
“name”: “IAM Tasks”  
},  
“target”: “XXXXXXX”,  
“active”: true,  
“filters”: [  
{  
“resource\_type”: “task”,  
“resource\_subtype”: “approval”,  
“action”: “changed”,  
“fields”: [  
“gid”,  
“name”,  
“due\_on”  
]  
}  
],  
“created\_at”: “2021-05-21T13:21:35.534Z”,  
“last\_failure\_at”: null,  
“last\_failure\_content”: “”,  
“last\_success\_at”: “2021-05-21T13:21:37.794Z”  
}  
}  
}  
}

The changes only trigger the webhook intermittently (I’ve received one notification out of 3-4 changes to the status of a task in the project), and when I do receive the notifications, they are essentially blank, as seen below:

{  
“method”: “post”,  
“path”: “/”,  
“body”: {  
“events”:   
},  
“query”: {},  
“headers”: {  
“accept-encoding”: “identity”,  
“content-length”: “13”,  
“content-type”: “application/json”,  
“host”: XXXXX  
“user-agent”: “Asana”,  
“x-amzn-trace-id”: “Root=1-60a7b4d8-402a26017c38a95100243f8d”,  
“x-asana-request-signature”: “XXXXXXX”,  
“x-forwarded-for”: “3.239.117.148”,  
“x-forwarded-port”: “443”,  
“x-forwarded-proto”: “https”,  
“x-hook-signature”: “XXXXX”  
}  
}

Any suggestions would be appreciated!

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [21 May 2021 19:31 UTC](https://forum.asana.com/t/webhook-for-approval-task-status-changes/122288/2 "2021-05-21T19:31:39Z")

</div>

Hi @Daniel_Wynn and welcome to the forum!

A couple of things to note here:

First… when you have an active webhook, Asana pings it periodically to make sure it’s still alive. It expects to receive a 100 response from these pings, if it doesn’t, it assumes the webhook is dead and it deactivates it (I don’t think that happen after just one failed ping; it takes multiple failures to have it deactivated).

When it sends these pings, they contain no actual events. So when you see periodic webhook messages with no events; i.e.

```
“body”: {
“events”: []
},

```

you can figure that’s a ping, and you can ignore it.

So that explains why you see those periodic blank messages. Next question is, why aren’t you getting any actual webhooks?

The answer lies here:

```
“fields”: [
“gid”,
“name”,
“due_on”
],

```

It looks like you’re specifying those fields to try and get that data back. Unfortunately that’s not how it works: the `fields` element within a webhook `filter` is used to further refine the filter to say “only send back a webhook when these specific fields change value”. That’s why you won’t get any webhooks when you change the approval status - it’s not among your filter fields. So you’ll want to remove those from your filter. You could probably replace them with just the field `approval_status` so you’ll only get webhooks when that particular field changes.

Next question, I know, is… “so how DO I get those fields’ values back in my webhook?”

Answer: you don’t. Asana’s webhooks (and this is pretty much an industry standard) are lightweight messages that are designed only to tell you that _something_ changed; they don’t tell you _what_ changed. To get that info, you need to do another API call to query the resource that changed and return its data. In your case, you’ll query the task and that’s how you’ll determine what the new value of `approval_status` is.

---

<div class="post-metadata">

**Author:** ![Daniel\_Wynn](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/daniel_wynn/32/77932_2.png) [@Daniel\_Wynn](https://forum.asana.com/u/Daniel_Wynn)\
**Post date:** [21 May 2021 20:04 UTC](https://forum.asana.com/t/webhook-for-approval-task-status-changes/122288/3 "2021-05-21T20:04:17Z")

</div>

Thanks for the help @Phil_Seeman ! I’ll see if I can delete/re-create the webhook accordingly!

Regarding the “You don’t…”. So, to verify, I should EXPECT to see essentially a blank message… there is no way to give any indication of what task was modified.

If that’s the case, the logic will be: I receive a blank trigger, then query the project for all tasks, and then use whatever method necessary on my end to differentiate prior and current state for each task.

Bummer! Are there any other ways around this leveraging some element of the Asana API that might be more effecient? (This project is expected to scale to hundreds of tasks)

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [21 May 2021 20:38 UTC](https://forum.asana.com/t/webhook-for-approval-task-status-changes/122288/4 "2021-05-21T20:38:18Z")

</div>

No, sorry for confusing you @Daniel_Wynn!

The blank webhooks are just the periodic “ping” ones and you should ignore those completely.

Once you have a valid webhook created that’s returning actual events, you’ll see that it won’t be blank - it will tell you the ID of the task that changed status, and have some other metadata in it. It won’t be empty! When you get these non-empty messages, these are the ones where you’ll then query the specific task whose ID you were told has just changed to get its data.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/system/32/276370_2.png) [@system](https://forum.asana.com/u/system)\
**Post date:** [30 May 2025 18:57 UTC](https://forum.asana.com/t/webhook-for-approval-task-status-changes/122288/5 "2025-05-30T18:57:12Z")

</div>

Closed on 30 May 2025 18:57 UTC


