---
title: "Create template"
method: POST
path: "/templates"
tags: ["templates"]
deprecated: true
---

# Create template

`POST /templates`

> **Deprecated.**

Create a new template

## Request body

- TemplateBuildRequest
  - `alias` string — Alias of the template
  - `dockerfile` string, required — Dockerfile for the template
  - `teamID` string — Identifier of the team
  - `startCmd` string — Start command to execute in the template after the build
  - `readyCmd` string — Ready check command to execute in the template after the build
  - `cpuCount` integer — CPU cores for the sandbox
  - `memoryMB` integer — Memory for the sandbox in MiB

## Response `202`

The build was accepted

- TemplateLegacy
  - `templateID` string, required — Identifier of the template
  - `buildID` string, required — Identifier of the last successful build for given template
  - `cpuCount` integer, required — CPU cores for the sandbox
  - `memoryMB` integer, required — Memory for the sandbox in MiB
  - `diskSizeMB` integer, required — Disk size for the sandbox in MiB
  - `public` boolean, required — Whether the template is public or only accessible by the team
  - `aliases` string[], required — Aliases of the template
  - `createdAt` string, date-time, required — Time when the template was created
  - `updatedAt` string, date-time, required — Time when the template was last updated
  - `createdBy` TeamUser, required
    - `id` string, uuid, required — Identifier of the user
    - `email` string, nullable, required — Email of the user
  - `lastSpawnedAt` string, date-time, nullable, required — Time when the template was last used
  - `spawnCount` integer, required — Number of times the template was used
  - `buildCount` integer, required — Number of times the template was built
  - `envdVersion` string, required — Version of the envd running in the sandbox

## Other responses

- `400` — Bad request
- `401` — Authentication error
- `500` — Server error

---

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