Skip to content

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.

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 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.goals.update_goal(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.goal_gidstringRequired within parent
queryModelOptionalExpand Get a goal — request body — query
bodyobjectRequired within parent
body.dataModelOptionalExpand Update a goal — request body — body data

Referenced models: Update a goal — request body — body data, Get a goal — request body — query

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 apply
$ (allOf 1).dataModelOptionalExpand Get a goal — response body — data data — Goal Response
$ (allOf 2)ModelAll variants applyExpand Get a goal — response body — data

Referenced models: Get a goal — response body — data data — Goal Response, Get a goal — response body — data

32 more schemas are linked from the tables above, on the schema pages.

Update a goal — request body — body data
FieldTypePresenceDescription and constraints
$JSONRoot
$ (allOf 1)ModelAll variants applyExpand 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)objectAll variants apply
$ (allOf 2).statusJSONOptional
$ (allOf 2).status (anyOf 1)stringAlternativeThe 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)nullAlternative
$ (allOf 2).custom_fieldsobjectOptionalAn 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.*stringAdditional 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_fieldsobjectOptionalAn 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.*stringAdditional 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
FieldTypePresenceDescription and constraints
$JSONRoot
$ (allOf 1)ModelAll variants applyExpand Get a goal — response body — data data due on, gid, html notes, is workspace level, liked, name, notes, resource type, start on
$ (allOf 2)objectAll variants apply
$ (allOf 2).likesarrayOptionalArray of likes for users who have liked this goal.
Read only: true
$ (allOf 2).likes[]ModelEach itemExpand Get a story — response body — data / data / source: web, email, mobile, api, unknown, type: comment, system likes item
$ (allOf 2).num_likesJSONOptional
$ (allOf 2).num_likes (anyOf 1)integerAlternativeThe number of users who have liked this goal.
Read only: true
$ (allOf 2).num_likes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
$ (allOf 2).teamJSONOptional
$ (allOf 2).team (anyOf 1)JSONAlternative
$ (allOf 2).team (anyOf 1) (allOf 1)ModelAll variants applyExpand Add a user to a team — response body — data data team — Team Compact
$ (allOf 2).team (anyOf 1) (allOf 2)objectAll variants apply*Conditional*. This property is only present when the `workspace` provided is an organization.
$ (allOf 2).team (anyOf 2)nullAlternative
$ (allOf 2).workspaceJSONOptional
$ (allOf 2).workspace (allOf 1)ModelAll variants applyExpand Update a workspace — request body — body data
$ (allOf 2).workspace (allOf 2)objectAll variants apply
$ (allOf 2).followersarrayOptionalArray of users who are members of this goal.
$ (allOf 2).followers[]ModelEach itemExpand Get users in a team — response body — data data item
$ (allOf 2).time_periodJSONOptional
$ (allOf 2).time_period (anyOf 1)JSONAlternative
$ (allOf 2).time_period (anyOf 1) (allOf 1)ModelAll variants applyExpand Get time periods — response body — data, next page data item
$ (allOf 2).time_period (anyOf 1) (allOf 2)objectAll variants apply
$ (allOf 2).time_period (anyOf 2)nullAlternative
$ (allOf 2).metricJSONOptional
$ (allOf 2).metric (anyOf 1)JSONAlternative
$ (allOf 2).metric (anyOf 1) (allOf 1)ModelAll variants applyExpand 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)objectAll variants apply
$ (allOf 2).metric (anyOf 1) (allOf 2).can_managebooleanOptional*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)nullAlternative
$ (allOf 2).ownerJSONOptional
$ (allOf 2).owner (anyOf 1)JSONAlternative
$ (allOf 2).owner (anyOf 1) (allOf 1)ModelAll variants applyExpand Get users in a team — response body — data data item
$ (allOf 2).owner (anyOf 1) (allOf 2)objectAll variants apply
$ (allOf 2).owner (anyOf 2)nullAlternative
$ (allOf 2).current_status_updateJSONOptional
$ (allOf 2).current_status_update (anyOf 1)JSONAlternative
$ (allOf 2).current_status_update (anyOf 1) (allOf 1)ModelAll variants applyExpand Get status updates from an object — response body — data, next page data item
$ (allOf 2).current_status_update (anyOf 1) (allOf 2)JSONAll variants applyThe latest `status_update` posted to this goal.
$ (allOf 2).current_status_update (anyOf 2)nullAlternative
$ (allOf 2).statusJSONOptional
$ (allOf 2).status (anyOf 1)stringAlternativeThe 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)nullAlternative
$ (allOf 2).privacy_settingstringOptionalThe privacy setting of the goal.
Known values: public_to_workspace, members_only
$ (allOf 2).default_access_levelstringOptionalThe default access level when inviting new members to the goal
Known values: admin, editor, commenter, viewer
$ (allOf 2).custom_fieldsarrayOptionalArray 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[]ModelEach itemExpand Get a membership — response body — data / data / access_level: admin, editor, user parent
$ (allOf 2).custom_field_settingsarrayOptionalArray 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[]ModelEach itemExpand 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
FieldTypePresenceDescription and constraints
$objectRoot
dataModelRequired within parentExpand Get a goal — response body — data data — sdk__Goal Response

Referenced models: Get a goal — response body — data data — sdk__Goal Response

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.

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.