Skip to content

Asana: Get events on a resource

Asana events.getEvents: arguments, response, policy and SDK examples.

← Events operations · Get started

Operation asana.getevents

Provider route: GET /events. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/asana with npm, or alter-sdk-asana with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { AsanaIntegration } from "@alter-ai/asana";
async function execute(input: Parameters<AsanaIntegration["events"]["getEvents"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new AsanaIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.events.getEvents(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_asana import AsanaIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = AsanaIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.events.get_events(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
queryobjectRequired within parentAdditional keys: not allowed
query.resourcestringRequired within parent
query.syncstringOptional
query.opt_prettybooleanOptional
query.opt_fieldsarrayOptional
query.opt_fields[]stringEach itemOne of: action, change, change.action, change.added_value, change.field, change.new_value, change.removed_value, created_at, parent, parent.name, resource, resource.name, type, user, user.name

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$JSONRoot
$ (allOf 1)objectAll variants applyThe full record for all events that have occurred since the sync token was created.
$ (allOf 1).dataarrayOptional
$ (allOf 1).data[]ModelEach itemExpand Get workspace events — response body — data, has more, sync data item
$ (allOf 1).syncstringOptionalA sync token to be used with the next call to the /events endpoint.
$ (allOf 1).has_morebooleanOptionalIndicates whether there are more events to pull.
$ (allOf 2)ModelAll variants applyExpand Get workspace events — response body — data, next page

Referenced models: Get workspace events — response body — data, has more, sync data item, Get workspace events — response body — data, next page

1 more schema is linked from the tables above, on the schema pages.

Get workspace events — response body — data, has more, sync data item
FieldTypePresenceDescription and constraints
$objectRootAn *event* is an object representing a change to a resource that was
observed by an event subscription or delivered asynchronously to
the target location of an active webhook.

The event may be triggered by a different `user` than the
subscriber. For example, if user A subscribes to a task and user B
modified it, the event's user will be user B. Note: Some events
are generated by the system, and will have `null` as the user. API
consumers should make sure to handle this case.

The `resource` that triggered the event may be different from the one
that the events were requested for or the webhook is subscribed to. For
example, a subscription to a project will contain events for tasks
contained within the project.

**Note:** pay close attention to the relationship between the fields
`Event.action` and `Event.change.action`.
`Event.action` represents the action taken on the resource
itself, and `Event.change.action` represents how the information
within the resource's fields have been modified.

For instance, consider these scenarios:


* When at task is added to a project, `Event.action` will be
`added`, `Event.parent` will be an object with the `id` and
`type` of the project, and there will be no `change` field.


* When an assignee is set on the task, `Event.parent` will be
`null`, `Event.action` will be `changed`,
`Event.change.action` will be `changed`, and `new_value` will
be an object with the user's `id` and `type`.


* When a collaborator is added to the task, `Event.parent` will
be `null`, `Event.action` will be `changed`,
`Event.change.action` will be `added`, and `added_value` will be
an object with the user's `id` and `type`.
userJSONOptional
user (allOf 1)ModelAll variants applyExpand Get users in a team — response body — data data item
user (allOf 2)JSONAll variants applyThe user who triggered the event.
resourceJSONOptional
resource (allOf 1)ModelAll variants applyExpand Get objects via typeahead — response body — data data item
resource (allOf 2)JSONAll variants applyThe resource which has triggered the event by being modified in some way.
typestringOptional*Deprecated: Refer to the resource_type of the resource.* The type of the resource that generated the event.
Read only: true
actionstringOptionalThe type of action taken on the **resource** that triggered the event. This can be one of `changed`, `added`, `removed`, `deleted`, or `undeleted` depending on the nature of the event.
Read only: true
parentJSONOptional
parent (allOf 1)ModelAll variants applyExpand Get objects via typeahead — response body — data data item
parent (allOf 2)JSONAll variants applyFor added/removed events, the parent object that resource was added to or removed from. The parent will be `null` for other event types.
created_atstringOptionalThe timestamp when the event occurred.
Format: date-time
Read only: true
changeModelOptionalExpand Get workspace events — response body — data, next page data item change

Referenced models: Get objects via typeahead — response body — data data item, Get users in a team — response body — data data item, Get workspace events — response body — data, next page data item change

Get workspace events — response body — data, next page
FieldTypePresenceDescription and constraints
$objectRoot
dataarrayRequired within parent
data[]ModelEach itemExpand Get workspace events — response body — data, next page data item
next_pageModelOptionalExpand Get goals — response body — data, next page next page

Referenced models: Get goals — response body — data, next page next page, Get workspace events — response body — data, next page data item

Get objects via typeahead — response body — data data item
FieldTypePresenceDescription and constraints
$objectRootA generic Asana Resource, containing a globally unique identifier.
gidstringOptionalGlobally unique identifier of the resource, as a string.
Read only: true
resource_typestringOptionalThe base type of this resource.
Read only: true
namestringOptionalThe name of the object.
Get users in a team — response body — data data item
FieldTypePresenceDescription and constraints
$objectRootA *user* object represents an account in Asana that can be given access to various workspaces, projects, and tasks.
gidstringOptionalGlobally unique identifier of the resource, as a string.
Read only: true
resource_typestringOptionalThe base type of this resource.
Read only: true
namestringOptional*Read-only except when same user as requester*. The user's name.
Get workspace events — response body — data, next page data item change
FieldTypePresenceDescription and constraints
$objectRootInformation about the type of change that has occurred. This field is only present when the value of the property `action`, describing the action taken on the **resource**, is `changed`.
Read only: true
fieldstringOptionalThe name of the field that has changed in the resource.
Read only: true
actionstringOptionalThe type of action taken on the **field** which has been changed. This can be one of `changed`, `added`, or `removed` depending on the nature of the change.
Read only: true
new_valueJSONOptional*Conditional.* This property is only present when the value of the event's `change.action` is `changed` _and_ the `new_value` is an Asana resource. This will be only the `gid` and `resource_type` of the resource when the events come from webhooks; this will be the compact representation (and can have fields expanded with [opt_fields](/docs/inputoutput-options)) when using the [get events](/reference/getevents) endpoint.
added_valueJSONOptional*Conditional.* This property is only present when the value of the event's `change.action` is `added` _and_ the `added_value` is an Asana resource. This will be only the `gid` and `resource_type` of the resource when the events come from webhooks; this will be the compact representation (and can have fields expanded with [opt_fields](/docs/inputoutput-options)) when using the [get events](/reference/getevents) endpoint.
removed_valueJSONOptional*Conditional.* This property is only present when the value of the event's `change.action` is `removed` _and_ the `removed_value` is an Asana resource. This will be only the `gid` and `resource_type` of the resource when the events come from webhooks; this will be the compact representation (and can have fields expanded with [opt_fields](/docs/inputoutput-options)) when using the [get events](/reference/getevents) endpoint.
Get goals — response body — data, next page next page
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)objectAlternative*Conditional*. This property is only present when a limit query parameter is provided in the request. When making a paginated request, the API will return a number of results as specified by the limit parameter. If more results exist, then the response will contain a next_page attribute, which will include an offset, a relative path attribute, and a full uri attribute. If there are no more pages available, next_page will be null and no offset will be provided. Note that an offset token will expire after some time, as data may have changed.
$ (anyOf 1).offsetstringOptionalPagination offset for the request.
Read only: true
$ (anyOf 1).pathstringOptionalA relative path containing the query parameters to fetch for next_page
Read only: true
$ (anyOf 1).uristringOptionalA full uri containing the query parameters to fetch for next_page
Format: uri
Read only: true
$ (anyOf 2)nullAlternative

SDK function policy ID: asana.getevents. Catalog operation: asana:getEvents. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.