---
title: "Apply a Project Template to an existing Workspace"
method: PUT
path: "/workspaces/{id}/apply_template"
tags: ["Workspaces"]
---

# Apply a Project Template to an existing Workspace

`PUT /workspaces/{id}/apply_template`

## Request

- Base URL: `https://api.mavenlink.com/api/v1`
- URL: `https://api.mavenlink.com/api/v1/workspaces/{id}/apply_template`
- Auth: none declared

Applies a template to an existing project.


This endpoint returns structured Workspace objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the `results` array
and will be indexed by ID in the `workspaces` top-level JSON key.
Please see our [Response Format](#section/Response-Format) section for more information.

## Path parameters

- `id` integer, required

## Query parameters

- `edit_stories` boolean
- `include` string
- `optional_fields` string[]

## Request body

- object
  - `workspace` object
    - `project_tracker_template_id` integer: The ID of the template to use to populate tasks and other information in the project.
    - `project_template_weekends_as_workdays` boolean: Whether weekends count as work days when applying the template. If `true`, weekend days will be included in task durations.
    - `project_template_start_date` string, date: The start date that tasks will be based on when the template is applied. The date must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.
    - `project_template_checklist_as_todos` boolean: Whether checklist items are converted to To Dos when applying the template.
    - `project_template_create_unnamed_resources` boolean: If `true`, all template resources and task assignments will be mapped to unnamed resources and `project_template_assignment_mappings` will be ignored.
    - `project_template_distribute_hours` boolean: Whether task estimated hours in the template are automatically added as scheduled hours for all tasks when applying the template. The hours will be distributed evenly between the task start date and end date.
    - `project_template_assignment_mappings` object[]: This maps template resources to named or unnamed resources when the template is applied.
      - `role_id` integer: The ID of the account role to use as the workspace role for this template resource. If you pass a `role_id` but do not pass a `user_id`, an unnamed resource will be created.
      - `user_id` integer: The ID of the user to map the template resource to. If you pass a `user_id` and do not set `role_id`, the workspace resource's role will be the user's default account role or—if they have none—it will be blank.
      - `resource_id` integer: The ID of the [project template assignment](/tag/Project-Template-Assignments) this mapping is for.
      - `create_unnamed_resource` boolean: If this is `true` and no `user_id` is specified, a new unnamed resource will be created for this template resource using the specified role, and the tasks will be assigned to the unnamed resource.
    - `project_template_before_story_id` integer: The ID of an existing task the template tasks should be inserted after. The provided task ID must belong to a top-level task.

## Response `200`

Workspace has been updated.

- object
  - `count` integer
  - `meta` object
    - `count` integer
    - `page_count` integer
    - `page_number` integer
    - `page_size` integer
  - `results` object[]
    - `key` string
    - `id` string
  - `workspaces` object
  - `external_references` object
  - `stories` object
  - `users` object
  - `participations` object
  - `timesheet_submissions` object
  - `workspace_groups` object
  - `custom_field_values` object
  - `workspace_resources` object
  - `status_reports` object
  - `account_colors` object
  - `account_insights_mappings` object
  - `billing_milestones` object

## Other responses

- `400`: Bad Request
- `401`: Unauthorized request
- `403`: Forbidden request
- `404`: Page Not Found
- `422`: Unprocessable Entity
- `503`: Service is unavailable

---

[API](https://skmtc.dev/kantata/apis/kantata-ox-api-documentation.md) - [All operations](https://skmtc.dev/kantata/apis/kantata-ox-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/kantata/apis/kantata-ox-api-documentation/revisions/9d4ebed2fa98?raw)
