Asana: Instantiate a project from a project template
Asana projectTemplates.instantiateProject: arguments, response, policy and SDK examples.
← Project templates operations · Get started
Operation asana.instantiateproject
Provider route: POST /project_templates/{project_template_gid}/instantiateProject. 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["projectTemplates"]["instantiateProject"]>[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.projectTemplates.instantiateProject(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.project_templates.instantiate_project(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.project_template_gid | string | Required within parent | |
query | Model | Optional | Expand Get a job by id — request body — query |
body | object | Optional | |
body.data | Model | Required within parent | Expand Instantiate a project from a project template — request body — body data |
Referenced models: Instantiate a project from a project template — request body — body data, Get a job by id — 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 job by id — response body — data data — Job Compact |
$ (allOf 2) | Model | All variants apply | Expand Get a job by id — response body — data |
Referenced models: Get a job by id — response body — data data — Job Compact, Get a job by id — response body — data
Schemas
Section titled “Schemas”11 more schemas are linked from the tables above, on the schema pages.
Get a job by id — response body — data data — Job Compact
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A *job* is an object representing a process that handles asynchronous work. |
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 |
resource_subtype | string | Optional | The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning. Read only: true |
status | string | Optional | The current status of this job. Known values: not_started, in_progress, succeeded, failed Read only: true |
dates_rollup_progress | Model | Optional | Expand Get a job by id — response body — data data dates rollup progress |
new_portfolio | Model | Optional | Expand Get a portfolio membership — response body — data data portfolio — Portfolio Compact |
new_project | Model | Optional | Expand Search projects in a workspace — response body — data data item |
new_task | JSON | Optional | |
new_task (anyOf 1) | JSON | Alternative | |
new_task (anyOf 1) (allOf 1) | Model | All variants apply | Expand Search tasks in a workspace — response body — data data item |
new_task (anyOf 1) (allOf 2) | object | All variants apply | |
new_task (anyOf 2) | null | Alternative | |
new_project_template | Model | Optional | Expand Get a team's project templates — response body — data, next page data item |
new_graph_export | Model | Optional | Expand Get a job by id — response body — data data new graph export — Graph Export Compact |
new_resource_export | Model | Optional | Expand Get a job by id — response body — data data new resource export — Resource Export Compact |
Referenced models: Get a job by id — response body — data data new graph export — Graph Export Compact, Get a portfolio membership — response body — data data portfolio — Portfolio Compact, Search projects in a workspace — response body — data data item, Get a team's project templates — response body — data, next page data item, Get a job by id — response body — data data new resource export — Resource Export Compact, Search tasks in a workspace — response body — data data item, Get a job by id — response body — data data dates rollup progress
Get a job by id — response body — data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
data | Model | Required within parent | Expand Get a job by id — response body — data data — sdk__Job Response |
Referenced models: Get a job by id — response body — data data — sdk__Job Response
Instantiate a project from a project template — request body — body data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
name | string | Required within parent | The name of the new project. |
team | string | Optional | *Optional*. Sets the team of the new project. If the project template exists in an _organization_, you may specify a value for `team`. If no value is provided then it defaults to the same team as the project template. |
public | boolean | Optional | *Deprecated:* new integrations use `privacy_setting` instead. |
privacy_setting | string | Optional | The privacy setting of the project. *Note: Administrators in your organization may restrict the values of `privacy_setting`.* The value `private_to_team` is deprecated. Use `POST /memberships` to share a project with a team after creation. One of: public_to_workspace, private_to_team, private |
is_strict | boolean | Optional | *Optional*. If set to `true`, the endpoint returns an "Unprocessable Entity" error if you fail to provide a calendar date value for any date variable. If set to `false`, a default date is used for each unfulfilled date variable (e.g., the current date is used as the Start Date of a project). |
requested_dates | array | Optional | *Conditional*. Array of mappings of date variables to calendar dates. This property is required in the instantiation request if the project template includes dates (e.g., a start date on a task). |
requested_dates[] | Model | Each item | Expand Instantiate a project from a project template — request body — body data requested dates item |
requested_roles | array | Optional | Array of mappings of template roles to users. |
requested_roles[] | Model | Each item | Expand Instantiate a project from a project template — request body — body data requested roles item |
Referenced models: Instantiate a project from a project template — request body — body data requested dates item, Instantiate a project from a project template — request body — body data requested roles item
Get a job by id — request body — query
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
opt_pretty | boolean | Optional | |
opt_fields | array | Optional | |
opt_fields[] | string | Each item | One of: dates_rollup_progress, dates_rollup_progress.total_tasks, dates_rollup_progress.updated_tasks, new_graph_export, new_graph_export.completed_at, new_graph_export.created_at, new_graph_export.download_url, new_portfolio, new_portfolio.name, new_portfolio.resource_subtype, new_project, new_project.name, new_project.resource_subtype, new_project_template, new_project_template.name, new_resource_export, new_resource_export.completed_at, new_resource_export.created_at, new_resource_export.download_url, new_task, new_task.created_by, new_task.name, new_task.resource_subtype, resource_subtype, status |
Get a job by id — response body — data data new graph export — Graph Export Compact
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A *graph_export* object represents a request to export the data starting from a parent object |
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 |
created_at | string | Optional | The time at which this resource was created. Format: date-time Read only: true |
download_url | JSON | Optional | |
download_url (anyOf 1) | string | Alternative | Download this URL to retrieve the full export in JSON format. It will be compressed in a gzip (.gz) container. *Note: May be null if the export is still in progress or failed. If present, this URL may only be valid for 1 hour from the time of retrieval. You should avoid persisting this URL somewhere and rather refresh on demand to ensure you do not keep stale URLs.* Format: uri Read only: true |
download_url (anyOf 2) | null | Alternative | |
completed_at | string | Optional | The time at which this resource was completed. Format: date-time Read only: true |
Get a portfolio membership — response body — data data portfolio — Portfolio Compact
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A *portfolio* gives a high-level overview of the status of multiple initiatives in Asana. Portfolios provide a dashboard overview of the state of multiple projects, including a progress report and the most recent [project status](/reference/project-statuses) update. Portfolios have some restrictions on size. Each portfolio has a max of 1500 items and, like projects, a max of 20 custom fields. |
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 portfolio. |
resource_subtype | string | Optional | The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning. Known values: default_portfolio, custom |
Search projects in a workspace — response body — data data item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A *project* represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions. |
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 | Name of the project. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer. |
resource_subtype | string | Optional | The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning. Known values: default_project, custom |
Instantiate a project from a project template — request body — body data requested roles item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
gid | string | Optional | Globally unique identifier of the template role in the project template. |
value | string | Optional | A string identifying a user that should be assigned to the template role. This can either be the string "me", an email, or the gid of a user. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: asana.instantiateproject. Catalog operation: asana:instantiateProject. 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.
Required provider scopes: ["projects:write"]