Skip to content

Asana: Get multiple task templates

Asana taskTemplates.getTaskTemplates: arguments, response, policy and SDK examples.

← Task templates operations · Get started

Operation asana.gettasktemplates

Provider route: GET /task_templates. 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["taskTemplates"]["getTaskTemplates"]>[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.taskTemplates.getTaskTemplates(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.task_templates.get_task_templates(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
queryobjectOptionalAdditional keys: not allowed
query.opt_prettybooleanOptional
query.limitintegerOptionalMinimum: 1
Maximum: 100
query.offsetstringOptional
query.projectstringOptional
query.opt_fieldsarrayOptional
query.opt_fields[]stringEach itemOne of: created_at, created_by, name, offset, path, project, template, uri

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).dataarrayOptional
$ (allOf 1).data[]ModelEach itemExpand Get multiple task templates — response body — data, next page data item
$ (allOf 1).next_pageModelOptionalExpand Get goals — response body — data, next page next page
$ (allOf 2)ModelAll variants applyExpand Get multiple task templates — response body — data, next page

Referenced models: Get goals — response body — data, next page next page, Get multiple task templates — response body — data, next page data item, Get multiple task templates — response body — data, next page

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

Get goals — response body — data, next page next page
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)objectAlternative*Conditional*. This property is only present when a limit query parameter is provided in the request. When making a paginated request, the API will return a number of results as specified by the limit parameter. If more results exist, then the response will contain a next_page attribute, which will include an offset, a relative path attribute, and a full uri attribute. If there are no more pages available, next_page will be null and no offset will be provided. Note that an offset token will expire after some time, as data may have changed.
$ (anyOf 1).offsetstringOptionalPagination offset for the request.
Read only: true
$ (anyOf 1).pathstringOptionalA relative path containing the query parameters to fetch for next_page
Read only: true
$ (anyOf 1).uristringOptionalA full uri containing the query parameters to fetch for next_page
Format: uri
Read only: true
$ (anyOf 2)nullAlternative
Get multiple task templates — response body — data, next page data item
FieldTypePresenceDescription and constraints
$objectRootA *task template* is an object that allows new tasks to be created with a predefined setup.
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 task template.
Get multiple task templates — response body — data, next page
FieldTypePresenceDescription and constraints
$objectRoot
dataarrayRequired within parent
data[]ModelEach itemExpand Get a task template — response body — data data — sdk__Task Template Response
next_pageModelOptionalExpand Get goals — response body — data, next page next page

Referenced models: Get goals — response body — data, next page next page, Get a task template — response body — data data — sdk__Task Template Response

Get a task template — response body — data data — sdk__Task Template Response
FieldTypePresenceDescription and constraints
$objectRootA generic Asana Resource, containing a globally unique identifier.A generic Asana Resource, containing a globally unique identifier.
A *task template* is an object that allows new tasks to be created with a predefined setup.
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 task template.
projectJSONOptional
project (anyOf 1)JSONAlternativeThe project that this task template belongs to.
project (anyOf 1) (allOf 1)ModelAll variants applyExpand Get a rate — response body — data data parent
project (anyOf 2)nullAlternative
templateJSONOptionalThe configuration for the task that will be created from this template.
template (allOf 1)objectAll variants apply
template (allOf 1).namestringOptionalName of the task that will be created from this template.
template (allOf 1).task_resource_subtypestringOptionalThe subtype of the task that will be created from this template.
Known values: default_task, milestone_task, approval_task
template (allOf 1).descriptionstringOptionalDescription of the task that will be created from this template.
template (allOf 1).html_descriptionstringOptionalHTML description of the task that will be created from this template. See [rich text](/docs/rich-text#reading-rich-text).
template (allOf 1).membershipsarrayOptionalArray of projects that the task created from this template will be added to
template (allOf 1).memberships[]ModelEach itemExpand Get a rate — response body — data data parent
template (allOf 1).relative_start_onJSONOptional
template (allOf 1).relative_start_on (anyOf 1)JSONAlternative
template (allOf 1).relative_start_on (anyOf 1) (anyOf 1)integerAlternativeThe number of days after the task has been instantiated on which that the task will start
template (allOf 1).relative_start_on (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
template (allOf 1).relative_start_on (anyOf 2)nullAlternative
template (allOf 1).relative_due_onJSONOptional
template (allOf 1).relative_due_on (anyOf 1)JSONAlternative
template (allOf 1).relative_due_on (anyOf 1) (anyOf 1)integerAlternativeThe number of days after the task has been instantiated on which that the task will be due
template (allOf 1).relative_due_on (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
template (allOf 1).relative_due_on (anyOf 2)nullAlternative
template (allOf 1).due_timeJSONOptional
template (allOf 1).due_time (anyOf 1)stringAlternativeThe time of day that the task will be due
template (allOf 1).due_time (anyOf 2)nullAlternative
template (allOf 1).dependenciesarrayOptionalArray of task templates that the task created from this template will depend on
template (allOf 1).dependencies[]objectEach item
template (allOf 1).dependencies[].namestringOptionalName of the task that will be created from this template.
template (allOf 1).dependencies[].task_resource_subtypestringOptionalThe subtype of the task that will be created from this template.
Known values: default_task, milestone_task, approval_task
template (allOf 1).dependentsarrayOptionalArray of task templates that will depend on the task created from this template
template (allOf 1).dependents[]objectEach item
template (allOf 1).dependents[].namestringOptionalName of the task that will be created from this template.
template (allOf 1).dependents[].task_resource_subtypestringOptionalThe subtype of the task that will be created from this template.
Known values: default_task, milestone_task, approval_task
template (allOf 1).followersarrayOptionalArray of users that will be added as followers to the task created from this template
template (allOf 1).followers[]ModelEach itemExpand Get an OOO entry — response body — data data user
template (allOf 1).attachmentsarrayOptionalArray of attachments that will be added to the task created from this template
template (allOf 1).attachments[]ModelEach itemExpand Get a task template — response body — data / data / template / task_resource_subtype: default task, milestone task, approval task attachments item
template (allOf 1).subtasksarrayOptionalArray of subtasks that will be added to the task created from this template
template (allOf 1).subtasks[]objectEach item
template (allOf 1).subtasks[].namestringOptionalName of the task that will be created from this template.
template (allOf 1).subtasks[].task_resource_subtypestringOptionalThe subtype of the task that will be created from this template.
Known values: default_task, milestone_task, approval_task
template (allOf 1).custom_fieldsarrayOptionalArray of custom fields that will be added to the task created from this template
template (allOf 1).custom_fields[]ModelEach itemExpand Get a goal — response body — data data custom fields item
created_byJSONOptionalThe user who created this task template.
created_by (allOf 1)ModelAll variants applyExpand Get an OOO entry — response body — data data user
created_atstringOptionalThe time at which this task template was created.
Format: date-time

Referenced models: Get a task template — response body — data / data / template / task_resource_subtype: default task, milestone task, approval task attachments item, Get an OOO entry — response body — data data user, Get a goal — response body — data data custom fields item, Get a rate — response body — data data parent

Get a task template — response body — data / data / template / task_resource_subtype: default task, milestone task, approval task attachments item
FieldTypePresenceDescription and constraints
$objectRootA generic Asana Resource, containing a globally unique identifier.A generic Asana Resource, containing a globally unique identifier.
An *attachment* object represents any file attached to a task in Asana, whether it's an uploaded file or one associated via a third-party service such as Dropbox or Google Drive.
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 file.
Read only: true
resource_subtypestringOptionalThe service hosting the attachment. Valid values are `asana`, `dropbox`, `gdrive`, `onedrive`, `box`, `vimeo`, and `external`.

SDK function policy ID: asana.gettasktemplates. Catalog operation: asana:getTaskTemplates. 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: ["task_templates:read"]

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.