We’re excited to announce new API features that improve the ability to track and audit changes to goals. Starting March 4th, Asana will begin emitting event objects for goals, providing apps programmatic visibility into changes.
While events allow apps to poll for changes, we have also added goal events to our webhooks infrastructure for apps that need to be immediately notified about changes in Asana.
Usage
You can access goal events by using the existing events API. For example, here is how you would use the GET events on resource route to fetch events for a goal:
- Establish an initial sync token by making a request with no sync token:
GET /events?resource=<goal-GID>
- The response will be a
412 Precondition Failed
. They body of the error will provide a sync token to use in your subsequent request:
{
"errors": [
{
"message": "Sync token invalid or too old. If you are attempting to keep resources in sync, you must fetch the full dataset for this query now and use the new sync token for the next sync."
}
],
"sync": "4647de3a0f78f6a74e4ef066ef30a4fe:0"
}
(Note: this is also the error you get for an expired or invalid sync token)
-
Make another request using the sync token from the error body:
GET /events?resource=<goal-GID>&sync=4647de3a0f78f6a74e4ef066ef30a4fe:0
-
Use the unique sync token in each response in your next request
-
Events can be noisy. Consider using
opt_fields
(by passing a comma-separated list) to specify the types of changes that are of interest
The following goal events will be emitted:
- Goal added/removed from domain/team
- Goal deleted/undeleted
- Goal property changed, including:
- Name
- Due date
- Start date
- Owner
- Status
- Description
- Metric
- Time period
- Followers
- Attachment added/deleted
- Member added/removed
- Project/task/portfolio/goal added/removed from goal
- Story added/removed from goal
Here’s an example of an API response for a name change event:
[
{
"user": {
"gid": "75603",
"resource_type": "user",
"name": "Sashimi Rosenstein"
},
"created_at": "2024-01-02T18:15:29.907Z",
"type": "goal",
"action": "changed",
"resource": {
"gid": "2420428",
"resource_type": "goal",
"owner": {
"gid": "75603",
"resource_type": "user",
"name": "Sashimi Rosenstein"
},
"name": "testing"
},
"parent": null,
"change": {
"field": "name",
"action": "changed"
}
}
]
Timeline for Launch
We will start the incremental rollout on March 4th, beginning with 10% of domains and increasing to 100% over the course of the day. Unless there are any unexpected issues, goal events and webhooks will be available to everyone by March 5th.
Reason for change
We chose to build events for goals for 2 primary reasons:
- Goal events are needed by customers in regulated industries that have audit compliance requirements
- We strive for API parity with the Asana web product. By making the Asana work graph programmatically accessible via the API, developers can build more powerful apps that integrate Asana data with the other tools customers rely on
Questions & Feedback
Our engineering team behind goals, alongside the Developer Relations team, will be actively monitoring this topic. This is your direct line to those who have crafted the feature, so please provide feedback, report any issues you encounter, and ask questions. Your input is valuable as it helps us continue to refine and improve the developer experience.
Happy coding!
Best,
Asana DevRel
P.S.: To stay updated on Asana API changes, you can create a customizable subscription to the API changelog forum category. Instructions for doing so can be found in this post.
March 4th Update:
We have rolled this out to 100% of domains