Skip to main content
POST
Create template (v3)

Authorizations

X-API-Key
string
header
required

Headers

Idempotency-Key
string

Optional team-scoped key for retrying the request. Use 1 to 255 lowercase ASCII letters, digits, or hyphens (a-z, 0-9, -), such as a lowercase UUID. The HTTP method, path, query, and request content identify the request. When idempotency is enabled, a matching retry of a completed request replays its status and body, including the IDs of any resources it created, without repeating the operation. A failure explicitly classified as safe to retry (Should-Retry: true) permits a fresh attempt with the same key and request. Only one attempt can run at a time. A different request returns 409 with error_code idempotency_request_mismatch. A matching request whose original has no recorded response yet and is within its expected response window returns 409 with error_code idempotency_in_progress. A matching request whose original has no recorded response and whose expected response deadline has passed or is unknown returns 422 with error_code idempotency_outcome_unknown. These conflicts and unknown outcomes do not execute the request again. If the key's record is unavailable or idempotency is misconfigured, the request returns 503; Should-Retry tells whether to retry with the same key. After the retention period expires, the key can start a new operation.

Required string length: 1 - 255
Pattern: ^[a-z0-9-]+$

Body

application/json
name
string

Name of the template. Can include a tag with colon separator (e.g. "my-template" or "my-template:v1"). If tag is included, it will be treated as if the tag was provided in the tags array.

Maximum string length: 128
tags
string[]

Tags to assign to the template build

alias
string
deprecated

Alias of the template. Deprecated, use name instead.

Maximum string length: 128
teamID
string
deprecated

Identifier of the team, as its UUID or its public project ID (prj_)

cpuCount
integer<int32>

CPU cores for the sandbox

Required range: x >= 1
maxCpuCount
integer<int32>

Maximum CPU count the template's sandboxes can be resized to; makes the template resizable. Must be at least cpuCount.

Required range: x >= 1
memoryMB
integer<int32>

Memory for the sandbox in MiB

Required range: x >= 128
minFreeDiskMb
integer<int32>

Requested minimum free space after the template's build steps, in MiB. Omit to use the team's default. Set to 0 to request no minimum free-disk growth. The filesystem is never shrunk, including inherited or already-larger filesystems. Growth is best effort, so filesystem metadata can leave the available space slightly below the requested minimum.

Required range: x >= 0

Response

The build was requested successfully

templateID
string
required

Identifier of the template

buildID
string
required

Identifier of the last successful build for given template

public
boolean
required

Whether the template is public or only accessible by the team

names
string[]
required

Names of the template

tags
string[]
required

Tags assigned to the template build

aliases
string[]
required
deprecated

Aliases of the template