Create template by organization
CoderSessionTokenCoder-Session-Token<token>organization*stringOrganization ID
Request body
application/json- body
activity_bump_ms?integerActivityBumpMillis 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?booleanAgentsAllowed controls whether Coder Agents can create workspaces using this template. Defaults to true.
allow_user_autostart?booleanAllowUserAutostart allows users to set a schedule for autostarting their workspace. By default this is true. This can only be disabled with a Premium license.
allow_user_autostop?booleanAllowUserAutostop allows users to set a custom workspace TTL to use in place of the template's DefaultTTL field. By default this is true. If false, the DefaultTTL will always be used. This can only be disabled with a Premium license.
allow_user_cancel_workspace_jobs?booleanAllow users to cancel in-progress workspace jobs. *bool as the default value is "true".
allow_workspace_renames?booleanAllowWorkspaceRenames permits users to rename workspaces built from this template. Renaming can be destructive for templates whose Terraform references the workspace name, so this defaults to false.
autostart_requirement?AutostartRequirement allows optionally specifying the autostart allowed days for workspaces created from this template. This is a Premium feature.
autostop_requirement?AutostopRequirement allows optionally specifying the autostop requirement for workspaces created from this template. This is a Premium feature.
cors_behavior?stringCORSBehavior allows optionally specifying the CORS behavior for all shared ports.
"simple""passthru"default_ttl_ms?integerDefaultTTLMillis allows optionally specifying the default TTL for all workspaces created from this template.
delete_ttl_ms?integerTimeTilDormantAutoDeleteMillis allows optionally specifying the max lifetime before Coder permanently deletes dormant workspaces created from this template.
description?stringDescription is a description of what the template contains. It must be no longer than 128 Unicode code points.
length <= 128disable_everyone_group_access?booleanDisableEveryoneGroupAccess 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.
display_name?stringDisplayName is the displayed name of the template.
dormant_ttl_ms?integerTimeTilDormantMillis allows optionally specifying the max lifetime before Coder locks inactive workspaces created from this template.
failure_ttl_ms?integerFailureTTLMillis allows optionally specifying the max lifetime before Coder stops all resources for failed workspaces created from this template.
icon?stringIcon is a relative path or external URL that specifies an icon to be displayed in the dashboard.
max_port_share_level?stringMaxPortShareLevel allows optionally specifying the maximum port share level for workspaces created from the template.
"owner""authenticated""organization""public"name*stringName is the name of the template.
require_active_version?booleanRequireActiveVersion mandates that workspaces are built with the active template version.
template_use_classic_parameter_flow?booleanUseClassicParameterFlow allows optionally specifying whether
the template should use the classic parameter flow. The default if unset is
true, and is why *bool is used here. When dynamic parameters becomes
the default, this will default to false.
template_version_id*stringVersionID is an in-progress or completed job to use as an initial version of the template.
This is required on creation to enable a user-flow of validating a template works. There is no reason the data-model cannot support empty templates, but it doesn't make sense for users.
uuidtime_til_autostop_notify_ms?integerTimeTilAutostopNotifyMillis 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).
OK
application/json- response
active_user_count?integerActiveUserCount is set to -1 when loading.
active_version_id?stringuuidactivity_bump_ms?integeragents_allowed?booleanallow_user_autostart?booleanAllowUserAutostart and AllowUserAutostop are Premium features. Their values are only used if your license is entitled to use the advanced template scheduling feature.
allow_user_autostop?booleanallow_user_cancel_workspace_jobs?booleanallow_workspace_renames?booleanAllowWorkspaceRenames permits users to rename workspaces built from this template. Renaming can be destructive for templates whose Terraform references the workspace name.
autostart_requirement?autostop_requirement?AutostopRequirement and AutostartRequirement are Premium features. Their values are only used if your license is entitled to use the advanced template scheduling feature.
build_time_stats?cors_behavior?codersdk.CORSBehavior"simple""passthru"created_at?stringdate-timecreated_by_id?stringuuidcreated_by_name?stringdefault_ttl_ms?integerdeleted?booleandeprecated?booleandeprecation_message?stringdescription?stringdisable_module_cache?booleanDisableModuleCache disables the use of cached Terraform modules during provisioning for this template. It is read-only while ModuleCacheDisabledByDeployment is true.
display_name?stringfailure_ttl_ms?integerFailureTTLMillis, TimeTilDormantMillis, and TimeTilDormantAutoDeleteMillis are Premium features. Their values are used if your license is entitled to use the advanced template scheduling feature.
icon?stringid?stringuuidmax_port_share_level?codersdk.WorkspaceAgentPortShareLevel"owner""authenticated""organization""public"module_cache_disabled_by_deployment?booleanModuleCacheDisabledByDeployment reports that the deployment disables the Terraform module cache for every template. Templates cannot opt back in, so the effective state is disabled regardless of DisableModuleCache.
name?stringorganization_display_name?stringorganization_icon?stringorganization_id?stringuuidorganization_name?stringurlprovisioner?"terraform""terraform"require_active_version?booleanRequireActiveVersion mandates that workspaces are built with the active template version.
time_til_autostop_notify_ms?integerTimeTilAutostopNotifyMillis 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?integertime_til_dormant_ms?integerupdated_at?stringdate-timeuse_classic_parameter_flow?booleanThe samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.
curl -X POST \ "$CODER_URL/api/v2/organizations/{organization}/templates" \ -H "Coder-Session-Token: $CODER_SESSION_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1"}'{ "active_user_count": 0, "active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc", "activity_bump_ms": 0, "agents_allowed": true, "allow_user_autostart": true, "allow_user_autostop": true, "allow_user_cancel_workspace_jobs": true, "allow_workspace_renames": true, "autostart_requirement": { "days_of_week": [ "monday" ] }, "autostop_requirement": { "days_of_week": [ "monday" ], "weeks": 0 }, "build_time_stats": { "property1": { "p50": 123, "p95": 146 }, "property2": { "p50": 123, "p95": 146 } }, "cors_behavior": "simple", "created_at": "2019-08-24T14:15:22Z", "created_by_id": "9377d689-01fb-4abf-8450-3368d2c1924f", "created_by_name": "string", "default_ttl_ms": 0, "deleted": true, "deprecated": true, "deprecation_message": "string", "description": "string", "disable_module_cache": true, "display_name": "string", "failure_ttl_ms": 0, "icon": "string", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "max_port_share_level": "owner", "module_cache_disabled_by_deployment": true, "name": "string", "organization_display_name": "string", "organization_icon": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "organization_name": "string", "provisioner": "terraform", "require_active_version": true, "time_til_autostop_notify_ms": 0, "time_til_dormant_autodelete_ms": 0, "time_til_dormant_ms": 0, "updated_at": "2019-08-24T14:15:22Z", "use_classic_parameter_flow": true}