Asana: Get a task template
Asana taskTemplates.getTaskTemplate: arguments, response, policy and SDK examples.
← Task templates operations · Get started
Operation asana.gettasktemplate
Provider route: GET /task_templates/{task_template_gid}. 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["taskTemplates"]["getTaskTemplate"]>[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.getTaskTemplate(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.task_templates.get_task_template(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.task_template_gid | string | Required within parent | |
query | object | Optional | Additional keys: not allowed |
query.opt_pretty | boolean | Optional | |
query.opt_fields | array | Optional | |
query.opt_fields[] | string | Each item | One of: created_at, created_by, name, project, template |
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 task template — response body — data data — Task Template Response |
$ (allOf 2) | Model | All variants apply | Expand Get a task template — response body — data |
Referenced models: Get a task template — response body — data data — Task Template Response, Get a task template — response body — data
Schemas
Section titled “Schemas”13 more schemas are linked from the tables above, on the schema pages.
Get a task template — response body — data data — Task Template Response
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | Model | All variants apply | Expand Get a task template — response body — data data gid, name, resource type |
$ (allOf 2) | object | All variants apply | |
$ (allOf 2).name | string | Optional | Name of the task template. |
$ (allOf 2).project | JSON | Optional | |
$ (allOf 2).project (anyOf 1) | JSON | Alternative | The project that this task template belongs to. |
$ (allOf 2).project (anyOf 1) (allOf 1) | Model | All variants apply | Expand Search projects in a workspace — response body — data data item |
$ (allOf 2).project (anyOf 2) | null | Alternative | |
$ (allOf 2).template | JSON | Optional | The configuration for the task that will be created from this template. |
$ (allOf 2).template (allOf 1) | Model | All variants apply | Expand Get a task template — response body — data / data / created_at, created_by, name, project, template / template / task_resource_subtype: default task, milestone task, approval task |
$ (allOf 2).created_by | JSON | Optional | The user who created this task template. |
$ (allOf 2).created_by (allOf 1) | Model | All variants apply | Expand Get users in a team — response body — data data item |
$ (allOf 2).created_at | string | Optional | The time at which this task template was created. Format: date-time |
Referenced models: Search projects in a workspace — response body — data data item, Get a task template — response body — data data gid, name, resource type, Get a task template — response body — data / data / created_at, created_by, name, project, template / template / task_resource_subtype: default task, milestone task, approval task, Get users in a team — response body — data data item
Get a task template — response body — data
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
data | Model | Required within parent | Expand Get a task template — response body — data data — sdk__Task Template Response |
Referenced models: Get a task template — response body — data data — sdk__Task Template Response
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 |
Get a task template — response body — data data gid, name, resource type
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | Model | All variants apply | Expand Get multiple task templates — response body — data, next page data item |
Referenced models: Get multiple task templates — response body — data, next page data item
Get a task template — response body — data / data / created_at, created_by, name, project, template / template / task_resource_subtype: default task, milestone task, approval task
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (allOf 1) | Model | All variants apply | Expand Get a task template — response body — data / data / created_at, created_by, name, project, template / template / task_resource_subtype: default task, milestone task, approval task task resource subtype: default task, milestone task, approval task |
$ (allOf 2) | object | All variants apply | |
$ (allOf 2).description | string | Optional | Description of the task that will be created from this template. |
$ (allOf 2).html_description | string | Optional | HTML description of the task that will be created from this template. See [rich text](/docs/rich-text#reading-rich-text). |
$ (allOf 2).memberships | array | Optional | Array of projects that the task created from this template will be added to |
$ (allOf 2).memberships[] | Model | Each item | Expand Search projects in a workspace — response body — data data item |
$ (allOf 2).relative_start_on | JSON | Optional | |
$ (allOf 2).relative_start_on (anyOf 1) | JSON | Alternative | |
$ (allOf 2).relative_start_on (anyOf 1) (anyOf 1) | integer | Alternative | The number of days after the task has been instantiated on which that the task will start |
$ (allOf 2).relative_start_on (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
$ (allOf 2).relative_start_on (anyOf 2) | null | Alternative | |
$ (allOf 2).relative_due_on | JSON | Optional | |
$ (allOf 2).relative_due_on (anyOf 1) | JSON | Alternative | |
$ (allOf 2).relative_due_on (anyOf 1) (anyOf 1) | integer | Alternative | The number of days after the task has been instantiated on which that the task will be due |
$ (allOf 2).relative_due_on (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
$ (allOf 2).relative_due_on (anyOf 2) | null | Alternative | |
$ (allOf 2).due_time | JSON | Optional | |
$ (allOf 2).due_time (anyOf 1) | string | Alternative | The time of day that the task will be due |
$ (allOf 2).due_time (anyOf 2) | null | Alternative | |
$ (allOf 2).dependencies | array | Optional | Array of task templates that the task created from this template will depend on |
$ (allOf 2).dependencies[] | Model | Each item | Expand Get a task template — response body — data / data / created_at, created_by, name, project, template / template / task_resource_subtype: default task, milestone task, approval task task resource subtype: default task, milestone task, approval task |
$ (allOf 2).dependents | array | Optional | Array of task templates that will depend on the task created from this template |
$ (allOf 2).dependents[] | Model | Each item | Expand Get a task template — response body — data / data / created_at, created_by, name, project, template / template / task_resource_subtype: default task, milestone task, approval task task resource subtype: default task, milestone task, approval task |
$ (allOf 2).followers | array | Optional | Array of users that will be added as followers to the task created from this template |
$ (allOf 2).followers[] | Model | Each item | Expand Get users in a team — response body — data data item |
$ (allOf 2).attachments | array | Optional | Array of attachments that will be added to the task created from this template |
$ (allOf 2).attachments[] | Model | Each item | Expand Get attachments from an object — response body — data, next page data item |
$ (allOf 2).subtasks | array | Optional | Array of subtasks that will be added to the task created from this template |
$ (allOf 2).subtasks[] | Model | Each item | Expand Get a task template — response body — data / data / created_at, created_by, name, project, template / template / task_resource_subtype: default task, milestone task, approval task task resource subtype: default task, milestone task, approval task |
$ (allOf 2).custom_fields | array | Optional | Array of custom fields that will be added to the task created from this template |
$ (allOf 2).custom_fields[] | Model | Each item | Expand Get a membership — response body — data / data / access_level: admin, editor, user parent |
Referenced models: Get attachments from an object — response body — data, next page data item, Get a membership — response body — data / data / access_level: admin, editor, user parent, Search projects in a workspace — response body — data data item, Get a task template — response body — data / data / created_at, created_by, name, project, template / template / task_resource_subtype: default task, milestone task, approval task task resource subtype: default task, milestone task, approval task, Get users in a team — response body — data data item
Get users in a team — response body — data data item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A *user* object represents an account in Asana that can be given access to various workspaces, projects, and tasks. |
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 | *Read-only except when same user as requester*. The user's name. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: asana.gettasktemplate. Catalog operation: asana:getTaskTemplate. 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"]