---
title: "Update template settings by ID"
method: PATCH
path: "/api/v2/templates/{template}"
tags: ["Templates"]
---

# Update template settings by ID

`PATCH /api/v2/templates/{template}`

## Path parameters

- `template` string, uuid, required

## Request body

- CodersdkUpdateTemplateMeta
  - `activity_bump_ms` integer — ActivityBumpMillis allows optionally specifying the activity bump duration for all workspaces created from this template. Defaults to 1h but can be set to 0 to disable activity bumping.
  - `agents_allowed` boolean — AgentsAllowed controls whether Coder Agents can create workspaces using this template. If omitted, the current value is preserved.
  - `allow_user_autostart` boolean
  - `allow_user_autostop` boolean
  - `allow_user_cancel_workspace_jobs` boolean
  - `autostart_requirement` CodersdkTemplateAutostartRequirement
    - `days_of_week` string[] — DaysOfWeek is a list of days of the week in which autostart is allowed to happen. If no days are specified, autostart is not allowed.
  - `autostop_requirement` CodersdkTemplateAutostopRequirement
    - `days_of_week` string[] — DaysOfWeek is a list of days of the week on which restarts are required. Restarts happen within the user's quiet hours (in their configured timezone). If no days are specified, restarts are not required. Weekdays cannot be specified twice. Restarts will only happen on weekdays in this list on weeks which line up with Weeks.
    - `weeks` integer — Weeks is the number of weeks between required restarts. Weeks are synced across all workspaces (and Coder deployments) using modulo math on a hardcoded epoch week of January 2nd, 2023 (the first Monday of 2023). Values of 0 or 1 indicate weekly restarts. Values of 2 indicate fortnightly restarts, etc.
  - `cors_behavior` 'simple' | 'passthru'
  - `default_ttl_ms` integer
  - `deprecation_message` string — DeprecationMessage if set, will mark the template as deprecated and block any new workspaces from using this template. If passed an empty string, will remove the deprecated message, making the template usable for new workspaces again.
  - `description` string
  - `disable_everyone_group_access` boolean — DisableEveryoneGroupAccess allows optionally disabling the default behavior of granting the 'everyone' group access to use the template. If this is set to true, the template will not be available to all users, and must be explicitly granted to users or groups in the permissions settings of the template.
  - `disable_module_cache` boolean — DisableModuleCache disables the using of cached Terraform modules during provisioning. It is recommended not to disable this.
  - `display_name` string
  - `failure_ttl_ms` integer
  - `icon` string
  - `max_port_share_level` 'owner' | 'authenticated' | 'organization' | 'public'
  - `name` string
  - `require_active_version` boolean — RequireActiveVersion mandates workspaces built using this template use the active version of the template. This option has no effect on template admins.
  - `time_til_autostop_notify_ms` integer — TimeTilAutostopNotifyMillis allows optionally specifying the duration before the autostop deadline at which a reminder notification is sent for workspaces created from this template. Defaults to 0 (disabled). Omitting the field keeps the existing value.
  - `time_til_dormant_autodelete_ms` integer
  - `time_til_dormant_ms` integer
  - `update_workspace_dormant_at` boolean — UpdateWorkspaceDormantAt updates the dormant_at field of workspaces spawned from the template. This is useful for preventing dormant workspaces being immediately deleted when updating the dormant_ttl field to a new, shorter value.
  - `update_workspace_last_used_at` boolean — UpdateWorkspaceLastUsedAt updates the last_used_at field of workspaces spawned from the template. This is useful for preventing workspaces being immediately locked when updating the inactivity_ttl field to a new, shorter value.
  - `use_classic_parameter_flow` boolean — UseClassicParameterFlow is a flag that switches the default behavior to use the classic parameter flow when creating a workspace. This only affects deployments with the experiment "dynamic-parameters" enabled. This setting will live for a period after the experiment is made the default. An "opt-out" is present in case the new feature breaks some existing templates.

## Response `200`

OK

- CodersdkTemplate
  - `active_user_count` integer — ActiveUserCount is set to -1 when loading.
  - `active_version_id` string, uuid
  - `activity_bump_ms` integer
  - `agents_allowed` boolean
  - `allow_user_autostart` boolean — AllowUserAutostart and AllowUserAutostop are enterprise-only. Their values are only used if your license is entitled to use the advanced template scheduling feature.
  - `allow_user_autostop` boolean
  - `allow_user_cancel_workspace_jobs` boolean
  - `autostart_requirement` CodersdkTemplateAutostartRequirement
    - `days_of_week` string[] — DaysOfWeek is a list of days of the week in which autostart is allowed to happen. If no days are specified, autostart is not allowed.
  - `autostop_requirement` CodersdkTemplateAutostopRequirement
    - `days_of_week` string[] — DaysOfWeek is a list of days of the week on which restarts are required. Restarts happen within the user's quiet hours (in their configured timezone). If no days are specified, restarts are not required. Weekdays cannot be specified twice. Restarts will only happen on weekdays in this list on weeks which line up with Weeks.
    - `weeks` integer — Weeks is the number of weeks between required restarts. Weeks are synced across all workspaces (and Coder deployments) using modulo math on a hardcoded epoch week of January 2nd, 2023 (the first Monday of 2023). Values of 0 or 1 indicate weekly restarts. Values of 2 indicate fortnightly restarts, etc.
  - `build_time_stats` CodersdkTemplateBuildTimeStats
  - `cors_behavior` 'simple' | 'passthru'
  - `created_at` string, date-time
  - `created_by_id` string, uuid
  - `created_by_name` string
  - `default_ttl_ms` integer
  - `deleted` boolean
  - `deprecated` boolean
  - `deprecation_message` string
  - `description` string
  - `disable_module_cache` boolean — DisableModuleCache disables the use of cached Terraform modules during provisioning.
  - `display_name` string
  - `failure_ttl_ms` integer — FailureTTLMillis, TimeTilDormantMillis, and TimeTilDormantAutoDeleteMillis are enterprise-only. Their values are used if your license is entitled to use the advanced template scheduling feature.
  - `icon` string
  - `id` string, uuid
  - `max_port_share_level` 'owner' | 'authenticated' | 'organization' | 'public'
  - `name` string
  - `organization_display_name` string
  - `organization_icon` string
  - `organization_id` string, uuid
  - `organization_name` string, url
  - `provisioner` 'terraform'
  - `require_active_version` boolean — RequireActiveVersion mandates that workspaces are built with the active template version.
  - `time_til_autostop_notify_ms` integer — TimeTilAutostopNotifyMillis is the duration before the workspace's autostop deadline at which a reminder notification is sent. 0 disables the notification.
  - `time_til_dormant_autodelete_ms` integer
  - `time_til_dormant_ms` integer
  - `updated_at` string, date-time
  - `use_classic_parameter_flow` boolean

---

[API](https://skmtc.net/coder/apis/coder-api.md) · [All operations](https://skmtc.net/coder/apis/coder-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/coder/coder-api/versions/56b6e9f08540/schema)
