Sample - Asana API
POST/goals

Create a goal

Creates a new goal in a workspace or team. Supply the goal definition in the data object and use opt_fields to request properties that are excluded by default. A 201 response returns the complete newly created goal record.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter · 1 body field
opt_fieldsarray<string>optional
A comma-separated list of optional goal properties to include in the response, including nested properties. Omit this parameter to use the default response fields.

The goal to create, supplied in the data object.

dataobjectoptional
The goal creation payload, including the goal properties and any `followers` to associate with it.

7 status codes
201Returns the newly created goal record.
dataobjectoptional
400Returned when a required value is missing or a request parameter is malformed.
errorsarray<object>optional
401Returned when the request does not include a valid authentication token.
errorsarray<object>optional
402Returned when the requested goal operation exceeds the authenticated user's current premium level.
errorsarray<object>optional
403Returned when the authenticated user does not have access to complete the request.
errorsarray<object>optional
404Returned when the request does not specify a known action or the specified object does not exist.
errorsarray<object>optional
500Returned when a server-side problem prevents the request from completing.
errorsarray<object>optional

Error handling

A 400 is returned when the request is missing a required value or contains a malformed parameter. A 401 is returned without a valid authentication token, while a 403 indicates that the authenticated user cannot create or access the goal. A 402 indicates that the requested goal operation exceeds the current premium level; 404 indicates an unknown action or object, and 500 indicates a server-side failure.