Skip to content

Asana: Create a project template from a project

Asana projects.projectSaveAsTemplate: arguments, response, policy and SDK examples.

← Projects operations · Get started

Operation asana.projectsaveastemplate

Provider route: POST /projects/{project_gid}/saveAsTemplate. 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["projects"]["projectSaveAsTemplate"]>[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.projects.projectSaveAsTemplate(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.projects.project_save_as_template(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.project_gidstringRequired within parent
queryModelOptionalExpand Get a job by id — request body — query
bodyobjectRequired within parent
body.dataModelRequired within parentExpand Create a project template from a project — request body — body data

Referenced models: Create a project template from a project — request body — body data, Get a job by id — 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 job by id — response body — data data — Job Compact
$ (allOf 2)ModelAll variants applyExpand 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

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

Get a job by id — response body — data data — Job Compact
FieldTypePresenceDescription and constraints
$objectRootA *job* is an object representing a process that handles asynchronous work.
gidstringOptionalGlobally unique identifier of the resource, as a string.
Read only: true
resource_typestringOptionalThe base type of this resource.
Read only: true
resource_subtypestringOptionalThe 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
statusstringOptionalThe current status of this job.
Known values: not_started, in_progress, succeeded, failed
Read only: true
dates_rollup_progressModelOptionalExpand Get a job by id — response body — data data dates rollup progress
new_portfolioModelOptionalExpand Get a portfolio membership — response body — data data portfolio — Portfolio Compact
new_projectModelOptionalExpand Search projects in a workspace — response body — data data item
new_taskJSONOptional
new_task (anyOf 1)JSONAlternative
new_task (anyOf 1) (allOf 1)ModelAll variants applyExpand Search tasks in a workspace — response body — data data item
new_task (anyOf 1) (allOf 2)objectAll variants apply
new_task (anyOf 2)nullAlternative
new_project_templateModelOptionalExpand Get a team's project templates — response body — data, next page data item
new_graph_exportModelOptionalExpand Get a job by id — response body — data data new graph export — Graph Export Compact
new_resource_exportModelOptionalExpand 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
FieldTypePresenceDescription and constraints
$objectRoot
dataModelRequired within parentExpand 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

Create a project template from a project — request body — body data
FieldTypePresenceDescription and constraints
$objectRoot
namestringRequired within parentThe name of the new project template.
teamstringOptionalSets the team of the new project template. If the project exists in an organization, specify team and not workspace.
workspacestringOptionalSets the workspace of the new project template. Only specify workspace if the project exists in a workspace.
publicbooleanRequired within parentSets the project template to public to its team.
Get a job by id — request body — query
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
opt_prettybooleanOptional
opt_fieldsarrayOptional
opt_fields[]stringEach itemOne 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
FieldTypePresenceDescription and constraints
$objectRootA *graph_export* object represents a request to export the data starting from a parent object
gidstringOptionalGlobally unique identifier of the resource, as a string.
Read only: true
resource_typestringOptionalThe base type of this resource.
Read only: true
created_atstringOptionalThe time at which this resource was created.
Format: date-time
Read only: true
download_urlJSONOptional
download_url (anyOf 1)stringAlternativeDownload 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)nullAlternative
completed_atstringOptionalThe time at which this resource was completed.
Format: date-time
Read only: true
Get a portfolio membership — response body — data data portfolio — Portfolio Compact
FieldTypePresenceDescription and constraints
$objectRootA *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.
gidstringOptionalGlobally unique identifier of the resource, as a string.
Read only: true
resource_typestringOptionalThe base type of this resource.
Read only: true
namestringOptionalThe name of the portfolio.
resource_subtypestringOptionalThe 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
FieldTypePresenceDescription and constraints
$objectRootA *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.
gidstringOptionalGlobally unique identifier of the resource, as a string.
Read only: true
resource_typestringOptionalThe base type of this resource.
Read only: true
namestringOptionalName 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_subtypestringOptionalThe 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
Get a team's project templates — response body — data, next page data item
FieldTypePresenceDescription and constraints
$objectRootA *project template* is an object that allows new projects to be created with a predefined setup, which may include tasks, sections, Rules, etc. It simplifies the process of running a workflow that involves a similar set of work every time.
gidstringOptionalGlobally unique identifier of the resource, as a string.
Read only: true
resource_typestringOptionalThe base type of this resource.
Read only: true
namestringOptionalName of the project template.
Get a job by id — response body — data data new resource export — Resource Export Compact
FieldTypePresenceDescription and constraints
$objectRootA *resource_export* object represents a request to bulk export objects for one or more resources.
gidstringOptionalGlobally unique identifier of the resource, as a string.
Read only: true
resource_typestringOptionalThe base type of this resource.
Read only: true
created_atstringOptionalThe time at which the resource export object was created.
Format: date-time
Read only: true
download_urlJSONOptional
download_url (anyOf 1)stringAlternativeDownload this URL to retrieve the full export
in [JSON Lines](https://jsonlines.org/) format. It will be compressed in a gzip (.gz) container.

*Note: May be null if the export is still in progress or failed.*
Format: uri
Read only: true
download_url (anyOf 2)nullAlternative
completed_atstringOptionalThe time at which this resource was completed. This will be null if the export is still in progress.
Format: date-time
Read only: true

SDK function policy ID: asana.projectsaveastemplate. Catalog operation: asana:projectSaveAsTemplate. 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.