---
title: "Create a template"
method: POST
path: "/v2/templates"
tags: ["Templates"]
---

# Create a template

`POST /v2/templates`

Creates a reusable container-configuration preset — image, disk,
ports, env, registry, and mount settings — for pods and serverless
endpoints. `createPod` and `createEndpoint` don't take a template ID;
instead, spread a template's fields into the request body directly.
Returns the created template.

## Request body

- CreateTemplateRequest — Reusable container configuration shared across templates, pods, and serverless endpoints. Adding a field here automatically propagates to all three resources.
  - `image` string, required — Docker image reference
  - `args` string — Arguments passed to the container entrypoint
  - `disk` integer — Container disk in GB (ephemeral, wiped on restart)
  - `ports` string[] — Exposed ports, formatted as port/protocol
  - `env` object — Environment variables as key-value pairs
  - `registry` string, nullable — Container registry credential ID (for private images)
  - `name` string, required
  - `mounts` TemplateMounts — Storage mounts attached to a template. Templates support only a single persistent mount today; any `network` property is rejected with 422 by the schema validator. PATCH semantics: omitting `mounts` or sending `{}` leaves the existing mount unchanged.
    - `persistent` PersistentMount — Host-local persistent storage. Pinned to the pod's host machine — data does not survive a host failure. Disallowed on CPU pods. Mutually exclusive with NetworkMount. Deprecated: prefer NetworkMount for any data you cannot recreate.
      - `size` integer, required — Host-local persistent storage in GB. Upstream enforces a 10 GB floor.
      - `path` string, required — Mount path inside the container. May be changed via PATCH.
  - `serverless` boolean
  - `public` boolean
  - `category` 'CPU' | 'NVIDIA' | 'AMD' — Controls how the template is grouped and filtered in the Runpod console. It does not affect hardware selection, scheduling, or billing. - `CPU` — CPU-only workloads - `NVIDIA` — NVIDIA GPU workloads - `AMD` — AMD GPU workloads

## Response `201`

Created

- Template
  - `category` string — The category of the template. The category can be used to filter templates in the Runpod UI. Current categories are NVIDIA, AMD, and CPU.
  - `containerDiskInGb` integer — The amount of disk space, in gigabytes (GB), to allocate on the container disk for a Pod or worker. The data on the container disk is wiped when the Pod or worker restarts. To persist data across restarts, set volumeInGb to configure the local network volume.
  - `containerRegistryAuthId` string
  - `dockerEntrypoint` string[] — If specified, overrides the ENTRYPOINT for the Docker image run on a Pod or worker. If [], uses the ENTRYPOINT defined in the image.
  - `dockerStartCmd` string[] — If specified, overrides the start CMD for the Docker image run on a Pod or worker. If [], uses the start CMD defined in the image.
  - `earned` number — The amount of Runpod credits earned by the creator of a template by all Pods or workers created from the template.
  - `env` object
  - `id` string — A unique string identifying a template.
  - `imageName` string — The image tag for the container run on Pods or workers created from a template.
  - `isPublic` boolean — Set to true if a template is public and can be used by any Runpod user. Set to false if a template is private and can only be used by the creator.
  - `isRunpod` boolean — If true, a template is an official template managed by Runpod.
  - `isServerless` boolean — If true, instances created from a template are Serverless workers. If false, instances created from a template are Pods.
  - `name` string — A user-defined name for a template. The name needs to be unique.
  - `ports` string[] — A list of ports exposed on a Pod or worker. Each port is formatted as [port number]/[protocol]. Protocol can be either http or tcp.
  - `readme` string — A string of markdown-formatted text that describes a template. The readme is displayed in the Runpod UI when a user selects the template.
  - `runtimeInMin` integer
  - `volumeInGb` integer — The amount of disk space, in gigabytes (GB), to allocate on the local network volume for a Pod or worker. The data on the local network volume is persisted across restarts. To persist data so that future Pods and workers can access it, create a network volume and set networkVolumeId to attach it to the Pod or worker.
  - `volumeMountPath` string — If a local network volume or network volume is attached to a Pod or worker, the absolute path where the network volume is mounted in the filesystem.

## Other responses

- `400` — The request could not be processed because it is malformed or conflicts with request rules.
- `401` — Authentication failed because the bearer token is missing, malformed, expired, or invalid.
- `403` — The bearer token is valid, but it does not grant access to the requested resource or action.
- `422` — The request body or parameters were syntactically valid but failed validation.
- `429` — The caller exceeded its per-user rate limit. The response identifies the window that was exceeded and how long to wait. The `RateLimit` and `RateLimit-Policy` headers (per the IETF ratelimit-headers draft) also accompany successful responses, so clients can track quota before a 429.
- `default` — Error

---

[API](https://skmtc.dev/runpod/apis/runpod-rest-api.md) · [All operations](https://skmtc.dev/runpod/apis/runpod-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runpod/runpod-rest-api/revisions/504cd0394ed6/schema)
