Asana: Get workspace events
Asana workspaces.getWorkspaceEvents: arguments, response, policy and SDK examples.
← Workspaces operations · Get started
Operation asana.getworkspaceevents
Provider route: GET /workspaces/{workspace_gid}/events. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”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["workspaces"]["getWorkspaceEvents"]>[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.workspaces.getWorkspaceEvents(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom 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.workspaces.get_workspace_events(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.workspace_gid | string | Required within parent | |
query | object | Optional | Additional keys: not allowed |
query.opt_pretty | boolean | Optional | |
query.sync | string | Optional |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | object | All variants apply | The full record for all events that have occurred since the sync token was created. |
$ (allOf 1).data | array | Optional | |
$ (allOf 1).data[] | Model | Each item | Expand Get workspace events — response body — data, has more, sync data item |
$ (allOf 1).sync | string | Optional | A sync token to be used with the next call to the /events endpoint. |
$ (allOf 1).has_more | boolean | Optional | Indicates whether there are more events to pull. |
$ (allOf 2) | Model | All variants apply | Expand 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
Schemas
Section titled “Schemas”1 more schema is linked from the tables above, on the schema pages.
Get workspace events — response body — data, has more, sync data item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | An *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`. |
user | JSON | Optional | |
user (allOf 1) | Model | All variants apply | Expand Get users in a team — response body — data data item |
user (allOf 2) | JSON | All variants apply | The user who triggered the event. |
resource | JSON | Optional | |
resource (allOf 1) | Model | All variants apply | Expand Get objects via typeahead — response body — data data item |
resource (allOf 2) | JSON | All variants apply | The resource which has triggered the event by being modified in some way. |
type | string | Optional | *Deprecated: Refer to the resource_type of the resource.* The type of the resource that generated the event. Read only: true |
action | string | Optional | The 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 |
parent | JSON | Optional | |
parent (allOf 1) | Model | All variants apply | Expand Get objects via typeahead — response body — data data item |
parent (allOf 2) | JSON | All variants apply | For added/removed events, the parent object that resource was added to or removed from. The parent will be `null` for other event types. |
created_at | string | Optional | The timestamp when the event occurred. Format: date-time Read only: true |
change | Model | Optional | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
data | array | Required within parent | |
data[] | Model | Each item | Expand Get workspace events — response body — data, next page data item |
next_page | Model | Optional | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A generic Asana Resource, containing a globally unique identifier. |
gid | string | Optional | Globally unique identifier of the resource, as a string. Read only: true |
resource_type | string | Optional | The base type of this resource. Read only: true |
name | string | Optional | The name of the object. |
Get users in a team — response body — data data item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A *user* object represents an account in Asana that can be given access to various workspaces, projects, and tasks. |
gid | string | Optional | Globally unique identifier of the resource, as a string. Read only: true |
resource_type | string | Optional | The base type of this resource. Read only: true |
name | string | Optional | *Read-only except when same user as requester*. The user's name. |
Get workspace events — response body — data, next page data item change
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Information 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 |
field | string | Optional | The name of the field that has changed in the resource. Read only: true |
action | string | Optional | The 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_value | JSON | Optional | *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_value | JSON | Optional | *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_value | JSON | Optional | *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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | object | Alternative | *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).offset | string | Optional | Pagination offset for the request. Read only: true |
$ (anyOf 1).path | string | Optional | A relative path containing the query parameters to fetch for next_page Read only: true |
$ (anyOf 1).uri | string | Optional | A full uri containing the query parameters to fetch for next_page Format: uri Read only: true |
$ (anyOf 2) | null | Alternative |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: asana.getworkspaceevents. Catalog operation: asana:getWorkspaceEvents. 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.