Asana: Update a goal
Asana goals.updateGoal: arguments, response, policy and SDK examples.
← Goals operations · Get started
Operation asana.updategoal
Provider route: PUT /goals/{goal_gid}. 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["goals"]["updateGoal"]>[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.goals.updateGoal(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.goals.update_goal(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.goal_gid | string | Required within parent | |
query | Model | Optional | Expand Get a goal — request body — query |
body | object | Required within parent | |
body.data | Model | Optional | Expand Update a goal — request body — body data |
Referenced models: Update a goal — request body — body data, Get a goal — request body — query
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 | |
$ (allOf 1).data | Model | Optional | Expand Get a goal — response body — data data — Goal Response |
$ (allOf 2) | Model | All variants apply | Expand Get a goal — response body — data |
Referenced models: Get a goal — response body — data data — Goal Response, Get a goal — response body — data
Schemas
Section titled “Schemas”32 more schemas are linked from the tables above, on the schema pages.
Update a goal — request body — body data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | Model | All variants apply | Expand Create a goal — request body — body data due on, gid, html notes, is workspace level, liked, name, notes, owner, resource type, start on, team, time period, workspace |
$ (allOf 2) | object | All variants apply | |
$ (allOf 2).status | JSON | Optional | |
$ (allOf 2).status (anyOf 1) | string | Alternative | The current status of this goal. When the goal is open, its status can be `green`, `yellow`, and `red` to reflect "On Track", "At Risk", and "Off Track", respectively. When the goal is closed, the value can be `missed`, `achieved`, `partial`, or `dropped`. *Note* you can only write to this property if `metric` is set. |
$ (allOf 2).status (anyOf 2) | null | Alternative | |
$ (allOf 2).custom_fields | object | Optional | An object where each key is the GID of a custom field and its corresponding value is either an enum GID, string, number, or object (depending on the custom field type). See the [custom fields guide](/docs/custom-fields-guide) for details on creating and updating custom field values. Additional keys: see wildcard field |
$ (allOf 2).custom_fields.* | string | Additional keys | "{custom_field_gid}" => Value (can be text, enum GID, a number, etc.). For date, use format "YYYY-MM-DD" (e.g., 2019-09-15). For date-time, use ISO 8601 date string in UTC (e.g., 2019-09-15T02:06:58.147Z). |
$ (allOf 2).html_custom_fields | object | Optional | An object where each key is the GID of a text custom field and the corresponding value is a rich text HTML string. Only text-type custom fields support this parameter. Values must be wrapped in <body></body> tags. See the [custom fields guide](/docs/custom-fields-guide) and [rich text](/docs/rich-text) for details on supported formatting. Additional keys: see wildcard field |
$ (allOf 2).html_custom_fields.* | string | Additional keys | "{custom_field_gid}" => HTML string (e.g., "<body>Text content</body>") |
Referenced models: Create a goal — request body — body data due on, gid, html notes, is workspace level, liked, name, notes, owner, resource type, start on, team, time period, workspace
Get a goal — response body — data data — Goal Response
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | Model | All variants apply | Expand Get a goal — response body — data data due on, gid, html notes, is workspace level, liked, name, notes, resource type, start on |
$ (allOf 2) | object | All variants apply | |
$ (allOf 2).likes | array | Optional | Array of likes for users who have liked this goal. Read only: true |
$ (allOf 2).likes[] | Model | Each item | Expand Get a story — response body — data / data / source: web, email, mobile, api, unknown, type: comment, system likes item |
$ (allOf 2).num_likes | JSON | Optional | |
$ (allOf 2).num_likes (anyOf 1) | integer | Alternative | The number of users who have liked this goal. Read only: true |
$ (allOf 2).num_likes (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
$ (allOf 2).team | JSON | Optional | |
$ (allOf 2).team (anyOf 1) | JSON | Alternative | |
$ (allOf 2).team (anyOf 1) (allOf 1) | Model | All variants apply | Expand Add a user to a team — response body — data data team — Team Compact |
$ (allOf 2).team (anyOf 1) (allOf 2) | object | All variants apply | *Conditional*. This property is only present when the `workspace` provided is an organization. |
$ (allOf 2).team (anyOf 2) | null | Alternative | |
$ (allOf 2).workspace | JSON | Optional | |
$ (allOf 2).workspace (allOf 1) | Model | All variants apply | Expand Update a workspace — request body — body data |
$ (allOf 2).workspace (allOf 2) | object | All variants apply | |
$ (allOf 2).followers | array | Optional | Array of users who are members of this goal. |
$ (allOf 2).followers[] | Model | Each item | Expand Get users in a team — response body — data data item |
$ (allOf 2).time_period | JSON | Optional | |
$ (allOf 2).time_period (anyOf 1) | JSON | Alternative | |
$ (allOf 2).time_period (anyOf 1) (allOf 1) | Model | All variants apply | Expand Get time periods — response body — data, next page data item |
$ (allOf 2).time_period (anyOf 1) (allOf 2) | object | All variants apply | |
$ (allOf 2).time_period (anyOf 2) | null | Alternative | |
$ (allOf 2).metric | JSON | Optional | |
$ (allOf 2).metric (anyOf 1) | JSON | Alternative | |
$ (allOf 2).metric (anyOf 1) (allOf 1) | Model | All variants apply | Expand Get a goal — response body — data / data / default_access_level: admin, editor, commenter, viewer, privacy setting: public to workspace, members only metric resource subtype: number, unit: none, currency, percentage resource subtype: number, unit: none, currency, percentage |
$ (allOf 2).metric (anyOf 1) (allOf 2) | object | All variants apply | |
$ (allOf 2).metric (anyOf 1) (allOf 2).can_manage | boolean | Optional | *Conditional*. Only relevant for `progress_source` of type `external`. This boolean indicates whether the requester has the ability to update the current value of this metric. This returns `true` if the external metric was created by the requester, `false` otherwise. Read only: true |
$ (allOf 2).metric (anyOf 2) | null | Alternative | |
$ (allOf 2).owner | JSON | Optional | |
$ (allOf 2).owner (anyOf 1) | JSON | Alternative | |
$ (allOf 2).owner (anyOf 1) (allOf 1) | Model | All variants apply | Expand Get users in a team — response body — data data item |
$ (allOf 2).owner (anyOf 1) (allOf 2) | object | All variants apply | |
$ (allOf 2).owner (anyOf 2) | null | Alternative | |
$ (allOf 2).current_status_update | JSON | Optional | |
$ (allOf 2).current_status_update (anyOf 1) | JSON | Alternative | |
$ (allOf 2).current_status_update (anyOf 1) (allOf 1) | Model | All variants apply | Expand Get status updates from an object — response body — data, next page data item |
$ (allOf 2).current_status_update (anyOf 1) (allOf 2) | JSON | All variants apply | The latest `status_update` posted to this goal. |
$ (allOf 2).current_status_update (anyOf 2) | null | Alternative | |
$ (allOf 2).status | JSON | Optional | |
$ (allOf 2).status (anyOf 1) | string | Alternative | The current status of this goal. When the goal is open, its status can be `green`, `yellow`, and `red` to reflect "On Track", "At Risk", and "Off Track", respectively. When the goal is closed, the value can be `missed`, `achieved`, `partial`, or `dropped`. *Note* you can only write to this property if `metric` is set. Read only: true |
$ (allOf 2).status (anyOf 2) | null | Alternative | |
$ (allOf 2).privacy_setting | string | Optional | The privacy setting of the goal. Known values: public_to_workspace, members_only |
$ (allOf 2).default_access_level | string | Optional | The default access level when inviting new members to the goal Known values: admin, editor, commenter, viewer |
$ (allOf 2).custom_fields | array | Optional | Array of custom field values applied directly to the goal itself. These represent the values set on the goal, not the fields available for items in the goal. |
$ (allOf 2).custom_fields[] | Model | Each item | Expand Get a membership — response body — data / data / access_level: admin, editor, user parent |
$ (allOf 2).custom_field_settings | array | Optional | Array of custom field definitions that are enabled for the goal. These represent which custom fields are available to be used on items within the goal, but do not include any values. |
$ (allOf 2).custom_field_settings[] | Model | Each item | Expand Add a custom field to a project — response body — data data — Custom Field Setting Response |
Referenced models: Get a goal — response body — data data due on, gid, html notes, is workspace level, liked, name, notes, resource type, start on, Get a story — response body — data / data / source: web, email, mobile, api, unknown, type: comment, system likes item, Get a membership — response body — data / data / access_level: admin, editor, user parent, Add a custom field to a project — response body — data data — Custom Field Setting Response, Get a goal — response body — data / data / default_access_level: admin, editor, commenter, viewer, privacy setting: public to workspace, members only metric resource subtype: number, unit: none, currency, percentage resource subtype: number, unit: none, currency, percentage, Get status updates from an object — response body — data, next page data item, Add a user to a team — response body — data data team — Team Compact, Get time periods — response body — data, next page data item, Get users in a team — response body — data data item, Update a workspace — request body — body data
Get a goal — response body — data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
data | Model | Required within parent | Expand Get a goal — response body — data data — sdk__Goal Response |
Referenced models: Get a goal — response body — data data — sdk__Goal Response
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: asana.updategoal. Catalog operation: asana:updateGoal. 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.