---
title: "Create template version by organization"
method: POST
path: "/api/v2/organizations/{organization}/templateversions"
tags: ["Templates"]
---

# Create template version by organization

`POST /api/v2/organizations/{organization}/templateversions`

## Path parameters

- `organization` string, uuid, required

## Request body

- CodersdkCreateTemplateVersionRequest
  - `example_id` string
  - `file_id` string, uuid
  - `message` string
  - `name` string
  - `provisioner` 'terraform' | 'echo', required
  - `storage_method` 'file', required
  - `tags` object
  - `template_id` string, uuid — TemplateID optionally associates a version with a template.
  - `user_variable_values` CodersdkVariableValue[]
    - `name` string
    - `value` string

## Response `201`

Created

- CodersdkTemplateVersion
  - `archived` boolean
  - `created_at` string, date-time
  - `created_by` CodersdkMinimalUser
    - `avatar_url` string, uri
    - `id` string, uuid, required
    - `name` string
    - `username` string, required
  - `has_external_agent` boolean
  - `id` string, uuid
  - `job` CodersdkProvisionerJob
    - `available_workers` string[]
    - `canceled_at` string, date-time
    - `completed_at` string, date-time
    - `created_at` string, date-time
    - `error` string
    - `error_code` 'REQUIRED_TEMPLATE_VARIABLES' | 'INSUFFICIENT_QUOTA'
    - `file_id` string, uuid
    - `id` string, uuid
    - `initiator_id` string, uuid
    - `input` CodersdkProvisionerJobInput
      - `error` string
      - `template_version_id` string, uuid
      - `workspace_build_id` string, uuid
    - `logs_overflowed` boolean
    - `metadata` CodersdkProvisionerJobMetadata
      - `template_display_name` string
      - `template_icon` string
      - `template_id` string, uuid
      - `template_name` string
      - `template_version_name` string
      - `workspace_build_transition` 'start' | 'stop' | 'delete'
      - `workspace_id` string, uuid
      - `workspace_name` string
    - `organization_id` string, uuid
    - `queue_position` integer
    - `queue_size` integer
    - `started_at` string, date-time
    - `status` 'pending' | 'running' | 'succeeded' | 'canceling' | 'canceled' | 'failed' | 'unknown'
    - `tags` object
    - `type` 'template_version_import' | 'workspace_build' | 'template_version_dry_run'
    - `worker_id` string, uuid
    - `worker_name` string
  - `matched_provisioners` CodersdkMatchedProvisioners
    - `available` integer — Available is the number of provisioner daemons that are available to take jobs. This may be less than the count if some provisioners are busy or have been stopped.
    - `count` integer — Count is the number of provisioner daemons that matched the given tags. If the count is 0, it means no provisioner daemons matched the requested tags.
    - `most_recently_seen` string, date-time — MostRecentlySeen is the most recently seen time of the set of matched provisioners. If no provisioners matched, this field will be null.
  - `message` string
  - `name` string
  - `organization_id` string, uuid
  - `readme` string
  - `template_id` string, uuid
  - `updated_at` string, date-time
  - `warnings` CodersdkTemplateVersionWarning[]

---

[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)
