# Get template (/docs/api-reference/templates/get-template)

<!-- agent-signals: reading_time_min: 3 · est_tokens: 1719 · updated: 2026-07-30 -->
Related: [Create template (v3)](/docs/api-reference/templates/create-template-v3.md), [List templates (v2)](/docs/api-reference/templates/list-templates-v2.md), [Create template (v2)](/docs/api-reference/templates/create-template-v2.md), [Get build upload link](/docs/api-reference/templates/get-build-upload-link.md), [List templates](/docs/api-reference/templates/list-templates.md), [Create template](/docs/api-reference/templates/create-template.md)

# Get template

`GET /templates/{templateID}`

List all builds for a template

## OpenAPI

```json
{
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "parameters": [
    {
      "name": "templateID",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "nextToken",
      "in": "query",
      "description": "Cursor to start the list from",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "limit",
      "in": "query",
      "description": "Maximum number of items to return per page",
      "required": false,
      "schema": {
        "type": "integer",
        "format": "int32",
        "minimum": 1,
        "default": 100,
        "maximum": 100
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Successfully returned the template with its builds",
      "content": {
        "application/json": {
          "schema": {
            "required": [
              "templateID",
              "public",
              "aliases",
              "names",
              "createdAt",
              "updatedAt",
              "lastSpawnedAt",
              "spawnCount",
              "builds"
            ],
            "properties": {
              "templateID": {
                "type": "string",
                "description": "Identifier of the template"
              },
              "public": {
                "type": "boolean",
                "description": "Whether the template is public or only accessible by the team"
              },
              "aliases": {
                "type": "array",
                "description": "Aliases of the template",
                "deprecated": true,
                "items": {
                  "type": "string"
                }
              },
              "names": {
                "type": "array",
                "description": "Names of the template (namespace/alias format when namespaced)",
                "items": {
                  "type": "string"
                }
              },
              "createdAt": {
                "type": "string",
                "format": "date-time",
                "description": "Time when the template was created"
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time",
                "description": "Time when the template was last updated"
              },
              "lastSpawnedAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "Time when the template was last used"
              },
              "spawnCount": {
                "type": "integer",
                "format": "int64",
                "description": "Number of times the template was used"
              },
              "builds": {
                "type": "array",
                "description": "List of builds for the template",
                "items": {
                  "required": [
                    "buildID",
                    "status",
                    "createdAt",
                    "updatedAt",
                    "cpuCount",
                    "memoryMB"
                  ],
                  "properties": {
                    "buildID": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Identifier of the build"
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the template build",
                      "enum": [
                        "building",
                        "waiting",
                        "ready",
                        "error",
                        "uploaded"
                      ]
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Time when the build was created"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Time when the build was last updated"
                    },
                    "finishedAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Time when the build was finished"
                    },
                    "cpuCount": {
                      "type": "integer",
                      "format": "int32",
                      "minimum": 1,
                      "description": "CPU cores for the sandbox"
                    },
                    "memoryMB": {
                      "type": "integer",
                      "format": "int32",
                      "minimum": 128,
                      "description": "Memory for the sandbox in MiB"
                    },
                    "diskSizeMB": {
                      "type": "integer",
                      "format": "int32",
                      "minimum": 0,
                      "description": "Disk size for the sandbox in MiB"
                    },
                    "envdVersion": {
                      "type": "string",
                      "description": "Version of the envd running in the sandbox"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "type": "object"
          }
        }
      }
    },
    "401": {
      "description": "Authentication error",
      "content": {
        "application/json": {
          "schema": {
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "integer",
                "format": "int32",
                "description": "Error code"
              },
              "message": {
                "type": "string",
                "description": "Error"
              }
            },
            "type": "object"
          }
        }
      }
    },
    "500": {
      "description": "Server error",
      "content": {
        "application/json": {
          "schema": {
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "integer",
                "format": "int32",
                "description": "Error code"
              },
              "message": {
                "type": "string",
                "description": "Error"
              }
            },
            "type": "object"
          }
        }
      }
    }
  }
}
```
