---
title: "Start template build (v2)"
method: POST
path: "/v2/templates/{templateID}/builds/{buildID}"
tags: ["templates"]
---

# Start template build (v2)

`POST /v2/templates/{templateID}/builds/{buildID}`

Start the build

## Path parameters

- `templateID` string, required
- `buildID` string, required

## Request body

- TemplateBuildStartV2
  - `fromImage` string — Image to use as a base for the template build
  - `fromTemplate` string — Template to use as a base for the template build
  - `fromImageRegistry` union
    - AWSRegistry
      - `type` 'aws', required — Type of registry authentication
      - `awsAccessKeyId` string, required — AWS Access Key ID for ECR authentication
      - `awsSecretAccessKey` string, required — AWS Secret Access Key for ECR authentication
      - `awsRegion` string, required — AWS Region where the ECR registry is located
    - GCPRegistry
      - `type` 'gcp', required — Type of registry authentication
      - `serviceAccountJson` string, required — Service Account JSON for GCP authentication
    - GeneralRegistry
      - `type` 'registry', required — Type of registry authentication
      - `username` string, required — Username to use for the registry
      - `password` string, required — Password to use for the registry
  - `force` boolean — Whether the whole build should be forced to run regardless of the cache
  - `steps` TemplateStep[] — List of steps to execute in the template build
    - `type` string, required — Type of the step
    - `args` string[] — Arguments for the step
    - `filesHash` string — Hash of the files used in the step
    - `force` boolean — Whether the step should be forced to run regardless of the cache
  - `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

## Response `202`

The build has started

## Other responses

- `401` — Authentication error
- `500` — Server error

## Changes

- **2026-08-20** `e01b3f5506fe` — 2 info
  - added the optional property `error_code` to the response with the `401` status
  - added the optional property `error_code` to the response with the `500` status
- **2026-07-24** `93ed246a4c10` — 2 info
  - the endpoint scheme security `AdminApiKeyAuth AND AdminTeamAuth` was added to the API
  - the endpoint scheme security `Supabase1TokenAuth AND Supabase2TeamAuth` was removed from the API
- **2026-05-27** `e13ef89d456c` — 1 info
  - the endpoint scheme security `AuthProviderBearerAuth AND AuthProviderTeamAuth` was added to the API
- **2026-01-27** `05ac348d449f` — 2 info
  - the endpoint scheme security `Supabase1TokenAuth AND Supabase2TeamAuth` was added to the API
  - the endpoint scheme security `Supabase1TokenAuth` was removed from the API
- **2025-09-03** `a5bc2df672a8` — 1 info
  - added the new optional request property `fromImageRegistry`

[Full history](https://skmtc.dev/e2b-dev/apis/e2b-api/changes/v2/templates/:templateID/builds/:buildID/post.md)

---

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